Enum stc_ts_types::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
Self: Debug,
pub fn expect_call(self) -> CallSignaturewhere
Self: 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
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 is_property(&self) -> bool
pub fn is_property(&self) -> bool
Returns true
if self
is of variant Property
.
sourcepub fn expect_property(self) -> PropertySignaturewhere
Self: Debug,
pub fn expect_property(self) -> PropertySignaturewhere
Self: 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
Self: Debug,
pub fn expect_method(self) -> MethodSignaturewhere
Self: 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
Self: Debug,
pub fn expect_index(self) -> IndexSignaturewhere
Self: 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<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 TypeElement
impl EqIgnoreSpan for TypeElement
fn eq_ignore_span(&self, other: &Self) -> bool
sourceimpl<V> FoldWith<V> for TypeElementwhere
V: ?Sized,
impl<V> FoldWith<V> for TypeElementwhere
V: ?Sized,
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) -> Self
fn from(v: CallSignature) -> Self
Converts to this type from the input type.
sourceimpl From<ConstructorSignature> for TypeElement
impl From<ConstructorSignature> for TypeElement
sourcefn from(v: ConstructorSignature) -> Self
fn from(v: ConstructorSignature) -> Self
Converts to this type from the input type.
sourceimpl From<IndexSignature> for TypeElement
impl From<IndexSignature> for TypeElement
sourcefn from(v: IndexSignature) -> Self
fn from(v: IndexSignature) -> Self
Converts to this type from the input type.
sourceimpl From<MethodSignature> for TypeElement
impl From<MethodSignature> for TypeElement
sourcefn from(v: MethodSignature) -> Self
fn from(v: MethodSignature) -> Self
Converts to this type from the input type.
sourceimpl From<PropertySignature> for TypeElement
impl From<PropertySignature> for TypeElement
sourcefn from(v: PropertySignature) -> Self
fn from(v: PropertySignature) -> Self
Converts to this type from the input type.
sourceimpl From<TypeElement> for RTsTypeElement
impl From<TypeElement> for RTsTypeElement
sourcefn from(e: TypeElement) -> Self
fn from(e: TypeElement) -> Self
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
sourceimpl Spanned for TypeElement
impl Spanned for TypeElement
sourceimpl Take for TypeElement
impl Take for TypeElement
sourceimpl TypeEq for TypeElement
impl TypeEq for TypeElement
sourceimpl Visit<TypeElement> for AssertValid
impl Visit<TypeElement> for AssertValid
fn visit(&mut self, el: &TypeElement)
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> 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.