Enum stc_ts_file_analyzer::ty::TypeElement
source · [−]pub enum TypeElement {
Call(CallSignature),
Constructor(ConstructorSignature),
Property(PropertySignature),
Method(MethodSignature),
Index(IndexSignature),
}
Variants
Call(CallSignature)
Constructor(ConstructorSignature)
Property(PropertySignature)
Method(MethodSignature)
Index(IndexSignature)
Implementations
sourceimpl TypeElement
impl TypeElement
sourcepub fn expect_call(self) -> CallSignaturewhere
TypeElement: Debug,
pub fn expect_call(self) -> CallSignaturewhere
TypeElement: Debug,
sourcepub fn call(self) -> Option<CallSignature>
pub fn call(self) -> Option<CallSignature>
Returns Some
if self
is of variant Call
, and None
otherwise.
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
TypeElement: Debug,
pub fn expect_constructor(self) -> ConstructorSignaturewhere
TypeElement: 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 is_property(&self) -> bool
pub fn is_property(&self) -> bool
Returns true
if self
is of variant Property
.
sourcepub fn expect_property(self) -> PropertySignaturewhere
TypeElement: Debug,
pub fn expect_property(self) -> PropertySignaturewhere
TypeElement: Debug,
sourcepub fn property(self) -> Option<PropertySignature>
pub fn property(self) -> Option<PropertySignature>
Returns Some
if self
is of variant Property
, and None
otherwise.
sourcepub fn expect_method(self) -> MethodSignaturewhere
TypeElement: Debug,
pub fn expect_method(self) -> MethodSignaturewhere
TypeElement: Debug,
sourcepub fn method(self) -> Option<MethodSignature>
pub fn method(self) -> Option<MethodSignature>
Returns Some
if self
is of variant Method
, and None
otherwise.
sourcepub fn expect_index(self) -> IndexSignaturewhere
TypeElement: Debug,
pub fn expect_index(self) -> IndexSignaturewhere
TypeElement: Debug,
sourcepub fn index(self) -> Option<IndexSignature>
pub fn index(self) -> Option<IndexSignature>
Returns Some
if self
is of variant Index
, and None
otherwise.
Trait Implementations
sourceimpl Clone for TypeElement
impl Clone for TypeElement
sourcefn clone(&self) -> TypeElement
fn clone(&self) -> TypeElement
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 TypeElement
impl Debug for TypeElement
sourceimpl<'de> Deserialize<'de> for TypeElement
impl<'de> Deserialize<'de> for TypeElement
sourcefn deserialize<__D>(
__deserializer: __D
) -> Result<TypeElement, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D
) -> Result<TypeElement, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
sourceimpl EqIgnoreSpan for TypeElement
impl EqIgnoreSpan for TypeElement
fn eq_ignore_span(&self, other: &TypeElement) -> bool
sourceimpl Fold<TypeElement> for Expander<'_, '_, '_>
impl Fold<TypeElement> for Expander<'_, '_, '_>
fn fold(&mut self, node: TypeElement) -> TypeElement
sourceimpl Fold<TypeElement> for TypeFactsHandler<'_, '_, '_>
impl Fold<TypeElement> for TypeFactsHandler<'_, '_, '_>
fn fold(&mut self, el: TypeElement) -> TypeElement
sourceimpl<V> FoldWith<V> for TypeElementwhere
V: ?Sized,
impl<V> FoldWith<V> for TypeElementwhere
V: ?Sized,
fn fold_children_with(self, _visitor: &mut V) -> TypeElement
fn fold_with(self, visitor: &mut V) -> Selfwhere
V: Fold<Self>,
sourceimpl Freeze for TypeElement
impl Freeze for TypeElement
sourcefn is_clone_cheap(&self) -> bool
fn is_clone_cheap(&self) -> bool
Returns
true
if `Clone::clone is cheap.sourcefn freeze(&mut self)
fn freeze(&mut self)
Make `Clone::clone cheap.
sourcefn freezed(self) -> Self
fn freezed(self) -> Self
Call
Self::freeze
and return self
.sourceimpl From<CallSignature> for TypeElement
impl From<CallSignature> for TypeElement
sourcefn from(v: CallSignature) -> TypeElement
fn from(v: CallSignature) -> TypeElement
Converts to this type from the input type.
sourceimpl From<ConstructorSignature> for TypeElement
impl From<ConstructorSignature> for TypeElement
sourcefn from(v: ConstructorSignature) -> TypeElement
fn from(v: ConstructorSignature) -> TypeElement
Converts to this type from the input type.
sourceimpl From<IndexSignature> for TypeElement
impl From<IndexSignature> for TypeElement
sourcefn from(v: IndexSignature) -> TypeElement
fn from(v: IndexSignature) -> TypeElement
Converts to this type from the input type.
sourceimpl From<MethodSignature> for TypeElement
impl From<MethodSignature> for TypeElement
sourcefn from(v: MethodSignature) -> TypeElement
fn from(v: MethodSignature) -> TypeElement
Converts to this type from the input type.
sourceimpl From<PropertySignature> for TypeElement
impl From<PropertySignature> for TypeElement
sourcefn from(v: PropertySignature) -> TypeElement
fn from(v: PropertySignature) -> TypeElement
Converts to this type from the input type.
sourceimpl PartialEq<TypeElement> for TypeElement
impl PartialEq<TypeElement> for TypeElement
sourcefn eq(&self, other: &TypeElement) -> bool
fn eq(&self, other: &TypeElement) -> bool
sourceimpl Serialize for TypeElement
impl Serialize for TypeElement
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 TypeElement
impl Spanned for TypeElement
sourceimpl Take for TypeElement
impl Take for TypeElement
sourcefn dummy() -> TypeElement
fn dummy() -> TypeElement
Create a dummy value of this type.
fn take(&mut self) -> Self
sourcefn map_with_mut<F>(&mut self, op: F)where
F: FnOnce(Self) -> Self,
fn map_with_mut<F>(&mut self, op: F)where
F: FnOnce(Self) -> Self,
Mutate
self
using op
, which accepts owned data.sourceimpl TypeEq for TypeElement
impl TypeEq for TypeElement
sourcefn type_eq(&self, other: &TypeElement) -> bool
fn type_eq(&self, other: &TypeElement) -> bool
Note: This method should return
true
for non-type values.sourceimpl<V> VisitMutWith<V> for TypeElementwhere
V: ?Sized,
impl<V> VisitMutWith<V> for TypeElementwhere
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 TypeElementwhere
V: ?Sized,
impl<V> VisitWith<V> for TypeElementwhere
V: ?Sized,
fn visit_children_with(&self, _visitor: &mut V)
fn visit_with(&self, visitor: &mut V)where
V: Visit<Self>,
impl StructuralPartialEq for TypeElement
impl Visitable for TypeElement
Auto Trait Implementations
impl RefUnwindSafe for TypeElement
impl Send for TypeElement
impl Sync for TypeElement
impl Unpin for TypeElement
impl UnwindSafe for TypeElement
Blanket Implementations
sourceimpl<T> AssertCloneCheap for Twhere
T: Freeze,
impl<T> AssertCloneCheap for Twhere
T: Freeze,
sourcefn assert_clone_cheap(&self)
fn assert_clone_cheap(&self)
Assert that
self
is cheap to clone. This noop on production build.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.