Enum stc_ts_types::ClassMember
source · [−]pub enum ClassMember {
Constructor(ConstructorSignature),
Method(Method),
Property(ClassProperty),
IndexSignature(IndexSignature),
}
Variants
Constructor(ConstructorSignature)
Method(Method)
Property(ClassProperty)
IndexSignature(IndexSignature)
Implementations
sourceimpl ClassMember
impl ClassMember
sourcepub fn is_constructor(&self) -> bool
pub fn is_constructor(&self) -> bool
Returns true
if self
is of variant Constructor
.
sourcepub fn expect_constructor(self) -> ConstructorSignaturewhere
Self: Debug,
pub fn expect_constructor(self) -> ConstructorSignaturewhere
Self: Debug,
Unwraps the value, yielding the content of Constructor
.
Panics
Panics if the value is not Constructor
, with a panic message including the content of self
.
sourcepub fn constructor(self) -> Option<ConstructorSignature>
pub fn constructor(self) -> Option<ConstructorSignature>
Returns Some
if self
is of variant Constructor
, and None
otherwise.
sourcepub fn expect_method(self) -> Methodwhere
Self: Debug,
pub fn expect_method(self) -> Methodwhere
Self: Debug,
sourcepub fn method(self) -> Option<Method>
pub fn method(self) -> Option<Method>
Returns Some
if self
is of variant Method
, and None
otherwise.
sourcepub fn is_property(&self) -> bool
pub fn is_property(&self) -> bool
Returns true
if self
is of variant Property
.
sourcepub fn expect_property(self) -> ClassPropertywhere
Self: Debug,
pub fn expect_property(self) -> ClassPropertywhere
Self: Debug,
sourcepub fn property(self) -> Option<ClassProperty>
pub fn property(self) -> Option<ClassProperty>
Returns Some
if self
is of variant Property
, and None
otherwise.
sourcepub fn is_index_signature(&self) -> bool
pub fn is_index_signature(&self) -> bool
Returns true
if self
is of variant IndexSignature
.
sourcepub fn expect_index_signature(self) -> IndexSignaturewhere
Self: Debug,
pub fn expect_index_signature(self) -> IndexSignaturewhere
Self: Debug,
Unwraps the value, yielding the content of IndexSignature
.
Panics
Panics if the value is not IndexSignature
, with a panic message including the content of self
.
sourcepub fn index_signature(self) -> Option<IndexSignature>
pub fn index_signature(self) -> Option<IndexSignature>
Returns Some
if self
is of variant IndexSignature
, and None
otherwise.
Trait Implementations
sourceimpl Clone for ClassMember
impl Clone for ClassMember
sourcefn clone(&self) -> ClassMember
fn clone(&self) -> ClassMember
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresourceimpl Debug for ClassMember
impl Debug for ClassMember
sourceimpl<'de> Deserialize<'de> for ClassMember
impl<'de> Deserialize<'de> for ClassMember
sourcefn 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>,
Deserialize this value from the given Serde deserializer. Read more
sourceimpl EqIgnoreSpan for ClassMember
impl EqIgnoreSpan for ClassMember
fn eq_ignore_span(&self, other: &Self) -> bool
sourceimpl<V> FoldWith<V> for ClassMemberwhere
V: ?Sized,
impl<V> FoldWith<V> for ClassMemberwhere
V: ?Sized,
sourceimpl From<ClassMember> for RTsTypeElement
impl From<ClassMember> for RTsTypeElement
sourcefn from(m: ClassMember) -> Self
fn from(m: ClassMember) -> Self
Converts to this type from the input type.
sourceimpl From<ClassProperty> for ClassMember
impl From<ClassProperty> for ClassMember
sourcefn from(v: ClassProperty) -> Self
fn from(v: ClassProperty) -> Self
Converts to this type from the input type.
sourceimpl From<ConstructorSignature> for ClassMember
impl From<ConstructorSignature> for ClassMember
sourcefn from(v: ConstructorSignature) -> Self
fn from(v: ConstructorSignature) -> Self
Converts to this type from the input type.
sourceimpl From<IndexSignature> for ClassMember
impl From<IndexSignature> for ClassMember
sourcefn from(v: IndexSignature) -> Self
fn from(v: IndexSignature) -> Self
Converts to this type from the input type.
sourceimpl From<Method> for ClassMember
impl From<Method> for ClassMember
sourceimpl PartialEq<ClassMember> for ClassMember
impl PartialEq<ClassMember> for ClassMember
sourcefn eq(&self, other: &ClassMember) -> bool
fn eq(&self, other: &ClassMember) -> bool
sourceimpl Serialize for ClassMember
impl Serialize for ClassMember
sourceimpl Spanned for ClassMember
impl Spanned for ClassMember
sourceimpl TypeEq for ClassMember
impl TypeEq for ClassMember
sourceimpl Visit<ClassMember> for AssertValid
impl Visit<ClassMember> for AssertValid
fn visit(&mut self, el: &ClassMember)
sourceimpl<V> VisitMutWith<V> for ClassMemberwhere
V: ?Sized,
impl<V> VisitMutWith<V> for ClassMemberwhere
V: ?Sized,
fn visit_mut_children_with(&mut self, _visitor: &mut V)
fn visit_mut_with(&mut self, visitor: &mut V)where
V: VisitMut<Self>,
sourceimpl<V> VisitWith<V> for ClassMemberwhere
V: ?Sized,
impl<V> VisitWith<V> for ClassMemberwhere
V: ?Sized,
fn visit_children_with(&self, _visitor: &mut V)
fn visit_with(&self, visitor: &mut V)where
V: Visit<Self>,
impl StructuralPartialEq for ClassMember
impl Visitable for ClassMember
Auto Trait Implementations
impl RefUnwindSafe for ClassMember
impl Send for ClassMember
impl Sync for ClassMember
impl Unpin for ClassMember
impl UnwindSafe for ClassMember
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
sourceimpl<R, N> IntoRNode<R> for Nwhere
R: RNode<Orig = N>,
impl<R, N> IntoRNode<R> for Nwhere
R: RNode<Orig = N>,
fn into_rnode(self, g: &mut NodeIdGenerator) -> R
sourceimpl<T> SpanExt for Twhere
T: Spanned,
impl<T> SpanExt for Twhere
T: Spanned,
fn is_synthesized(&self) -> bool
fn starts_on_new_line(&self, format: ListFormat) -> bool
sourcefn comment_range(&self) -> Span
fn comment_range(&self) -> Span
Gets a custom text range to use when emitting comments.