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 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 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 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> 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
§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<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