Enum stc_ts_file_analyzer::ty::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
ClassMember: Debug,
pub fn expect_constructor(self) -> ConstructorSignaturewhere
ClassMember: 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
ClassMember: Debug,
pub fn expect_method(self) -> Methodwhere
ClassMember: 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
ClassMember: Debug,
pub fn expect_property(self) -> ClassPropertywhere
ClassMember: 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
ClassMember: Debug,
pub fn expect_index_signature(self) -> IndexSignaturewhere
ClassMember: 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<ClassMember, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D
) -> Result<ClassMember, <__D as Deserializer<'de>>::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: &ClassMember) -> bool
sourceimpl Fold<ClassMember> for Expander<'_, '_, '_>
impl Fold<ClassMember> for Expander<'_, '_, '_>
fn fold(&mut self, node: ClassMember) -> ClassMember
sourceimpl Fold<ClassMember> for TypeFactsHandler<'_, '_, '_>
impl Fold<ClassMember> for TypeFactsHandler<'_, '_, '_>
fn fold(&mut self, m: ClassMember) -> ClassMember
sourceimpl<V> FoldWith<V> for ClassMemberwhere
V: ?Sized,
impl<V> FoldWith<V> for ClassMemberwhere
V: ?Sized,
fn fold_children_with(self, _visitor: &mut V) -> ClassMember
fn fold_with(self, visitor: &mut V) -> Selfwhere
V: Fold<Self>,
sourceimpl From<ClassProperty> for ClassMember
impl From<ClassProperty> for ClassMember
sourcefn from(v: ClassProperty) -> ClassMember
fn from(v: ClassProperty) -> ClassMember
Converts to this type from the input type.
sourceimpl From<ConstructorSignature> for ClassMember
impl From<ConstructorSignature> for ClassMember
sourcefn from(v: ConstructorSignature) -> ClassMember
fn from(v: ConstructorSignature) -> ClassMember
Converts to this type from the input type.
sourceimpl From<IndexSignature> for ClassMember
impl From<IndexSignature> for ClassMember
sourcefn from(v: IndexSignature) -> ClassMember
fn from(v: IndexSignature) -> ClassMember
Converts to this type from the input type.
sourceimpl From<Method> for ClassMember
impl From<Method> for ClassMember
sourcefn from(v: Method) -> ClassMember
fn from(v: Method) -> ClassMember
Converts to this type from the input type.
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
sourcefn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
sourceimpl Spanned for ClassMember
impl Spanned for ClassMember
sourceimpl TypeEq for ClassMember
impl TypeEq for ClassMember
sourcefn type_eq(&self, other: &ClassMember) -> bool
fn type_eq(&self, other: &ClassMember) -> bool
Note: This method should return
true
for non-type values.sourceimpl VisitMut<ClassMember> for ThisReplacer<'_, '_, '_>
impl VisitMut<ClassMember> for ThisReplacer<'_, '_, '_>
Noop.
fn visit_mut(&mut self, _: &mut 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> Pointable for T
impl<T> Pointable for T
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.