pub enum DefaultDecl {
Class(ClassExpr),
Fn(FnExpr),
TsInterfaceDecl(Box<TsInterfaceDecl>),
}
Variants§
Implementations§
Source§impl DefaultDecl
impl DefaultDecl
Sourcepub fn as_class(&self) -> Option<&ClassExpr>
pub fn as_class(&self) -> Option<&ClassExpr>
Returns Some
if self
is a reference of variant Class
, and None
otherwise.
Sourcepub fn as_mut_class(&mut self) -> Option<&mut ClassExpr>
pub fn as_mut_class(&mut self) -> Option<&mut ClassExpr>
Returns Some
if self
is a mutable reference of variant Class
, and None
otherwise.
Sourcepub fn expect_class(self) -> ClassExprwhere
Self: Debug,
pub fn expect_class(self) -> ClassExprwhere
Self: Debug,
Sourcepub fn class(self) -> Option<ClassExpr>
pub fn class(self) -> Option<ClassExpr>
Returns Some
if self
is of variant Class
, and None
otherwise.
Sourcepub const fn is_fn_expr(&self) -> bool
pub const fn is_fn_expr(&self) -> bool
Returns true
if self
is of variant Fn
.
Sourcepub fn as_fn_expr(&self) -> Option<&FnExpr>
pub fn as_fn_expr(&self) -> Option<&FnExpr>
Returns Some
if self
is a reference of variant Fn
, and None
otherwise.
Sourcepub fn as_mut_fn_expr(&mut self) -> Option<&mut FnExpr>
pub fn as_mut_fn_expr(&mut self) -> Option<&mut FnExpr>
Returns Some
if self
is a mutable reference of variant Fn
, and None
otherwise.
Sourcepub fn expect_fn_expr(self) -> FnExprwhere
Self: Debug,
pub fn expect_fn_expr(self) -> FnExprwhere
Self: Debug,
Sourcepub fn fn_expr(self) -> Option<FnExpr>
pub fn fn_expr(self) -> Option<FnExpr>
Returns Some
if self
is of variant Fn
, and None
otherwise.
Sourcepub const fn is_ts_interface_decl(&self) -> bool
pub const fn is_ts_interface_decl(&self) -> bool
Returns true
if self
is of variant TsInterfaceDecl
.
Sourcepub fn as_ts_interface_decl(&self) -> Option<&Box<TsInterfaceDecl>>
pub fn as_ts_interface_decl(&self) -> Option<&Box<TsInterfaceDecl>>
Returns Some
if self
is a reference of variant TsInterfaceDecl
, and None
otherwise.
Sourcepub fn as_mut_ts_interface_decl(&mut self) -> Option<&mut Box<TsInterfaceDecl>>
pub fn as_mut_ts_interface_decl(&mut self) -> Option<&mut Box<TsInterfaceDecl>>
Returns Some
if self
is a mutable reference of variant TsInterfaceDecl
, and None
otherwise.
Sourcepub fn expect_ts_interface_decl(self) -> Box<TsInterfaceDecl>where
Self: Debug,
pub fn expect_ts_interface_decl(self) -> Box<TsInterfaceDecl>where
Self: Debug,
Unwraps the value, yielding the content of TsInterfaceDecl
.
§Panics
Panics if the value is not TsInterfaceDecl
, with a panic message including the content of self
.
Sourcepub fn ts_interface_decl(self) -> Option<Box<TsInterfaceDecl>>
pub fn ts_interface_decl(self) -> Option<Box<TsInterfaceDecl>>
Returns Some
if self
is of variant TsInterfaceDecl
, and None
otherwise.
Trait Implementations§
Source§impl<'arbitrary> Arbitrary<'arbitrary> for DefaultDecl
impl<'arbitrary> Arbitrary<'arbitrary> for DefaultDecl
Source§fn arbitrary(u: &mut Unstructured<'arbitrary>) -> Result<Self>
fn arbitrary(u: &mut Unstructured<'arbitrary>) -> Result<Self>
Self
from the given unstructured data. Read moreSource§fn arbitrary_take_rest(u: Unstructured<'arbitrary>) -> Result<Self>
fn arbitrary_take_rest(u: Unstructured<'arbitrary>) -> Result<Self>
Self
from the entirety of the given
unstructured data. Read moreSource§fn size_hint(depth: usize) -> (usize, Option<usize>)
fn size_hint(depth: usize) -> (usize, Option<usize>)
Unstructured
this type
needs to construct itself. Read moreSource§fn try_size_hint(
depth: usize,
) -> Result<(usize, Option<usize>), MaxRecursionReached>
fn try_size_hint( depth: usize, ) -> Result<(usize, Option<usize>), MaxRecursionReached>
Unstructured
this type
needs to construct itself. Read moreSource§impl Archive for DefaultDecl
impl Archive for DefaultDecl
Source§impl Clone for DefaultDecl
impl Clone for DefaultDecl
Source§fn clone(&self) -> DefaultDecl
fn clone(&self) -> DefaultDecl
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for DefaultDecl
impl Debug for DefaultDecl
Source§impl<'de> Deserialize<'de> for DefaultDecl
impl<'de> Deserialize<'de> for DefaultDecl
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl<__D: Fallible + ?Sized> Deserialize<DefaultDecl, __D> for Archived<DefaultDecl>
impl<__D: Fallible + ?Sized> Deserialize<DefaultDecl, __D> for Archived<DefaultDecl>
Source§fn deserialize(&self, deserializer: &mut __D) -> Result<DefaultDecl, __D::Error>
fn deserialize(&self, deserializer: &mut __D) -> Result<DefaultDecl, __D::Error>
Source§impl EqIgnoreSpan for DefaultDecl
impl EqIgnoreSpan for DefaultDecl
fn eq_ignore_span(&self, other: &Self) -> bool
Source§impl From<Box<TsInterfaceDecl>> for DefaultDecl
impl From<Box<TsInterfaceDecl>> for DefaultDecl
Source§fn from(v: Box<TsInterfaceDecl>) -> Self
fn from(v: Box<TsInterfaceDecl>) -> Self
Source§impl From<ClassExpr> for DefaultDecl
impl From<ClassExpr> for DefaultDecl
Source§impl From<FnExpr> for DefaultDecl
impl From<FnExpr> for DefaultDecl
Source§impl Hash for DefaultDecl
impl Hash for DefaultDecl
Source§impl PartialEq for DefaultDecl
impl PartialEq for DefaultDecl
Source§impl<__S> Serialize<__S> for DefaultDecl
impl<__S> Serialize<__S> for DefaultDecl
Source§impl Serialize for DefaultDecl
impl Serialize for DefaultDecl
Source§impl Spanned for DefaultDecl
impl Spanned for DefaultDecl
impl Eq for DefaultDecl
impl StructuralPartialEq for DefaultDecl
Auto Trait Implementations§
impl Freeze for DefaultDecl
impl RefUnwindSafe for DefaultDecl
impl Send for DefaultDecl
impl Sync for DefaultDecl
impl Unpin for DefaultDecl
impl UnwindSafe for DefaultDecl
Blanket Implementations§
Source§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
Source§type ArchivedMetadata = ()
type ArchivedMetadata = ()
Source§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
Source§impl<T> ArchiveUnsized for Twhere
T: Archive,
impl<T> ArchiveUnsized for Twhere
T: Archive,
Source§type Archived = <T as Archive>::Archived
type Archived = <T as Archive>::Archived
Archive
, it may be unsized. Read moreSource§type MetadataResolver = ()
type MetadataResolver = ()
Source§unsafe fn resolve_metadata(
&self,
_: usize,
_: <T as ArchiveUnsized>::MetadataResolver,
_: *mut <<T as ArchiveUnsized>::Archived as ArchivePointee>::ArchivedMetadata,
)
unsafe fn resolve_metadata( &self, _: usize, _: <T as ArchiveUnsized>::MetadataResolver, _: *mut <<T as ArchiveUnsized>::Archived as ArchivePointee>::ArchivedMetadata, )
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CallHasher for T
impl<T> CallHasher for T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)Source§impl<F, W, T, D> Deserialize<With<T, W>, D> for F
impl<F, W, T, D> Deserialize<With<T, W>, D> for F
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more