Struct stc_ts_types::name::Name
source · [−]Expand description
Efficient alternative for names with variable length like foo.bar.baz.qux
.
Tuple Fields
0: Id
1: Vec<JsWord>
Implementations
sourceimpl Name
impl Name
pub fn new(name: JsWord, ctxt: SyntaxContext) -> Self
pub const fn get_ctxt(&self) -> SyntaxContext
pub fn push(&mut self, sym: JsWord)
pub fn top(&self) -> Id
pub fn len(&self) -> usize
pub const fn is_empty(&self) -> bool
pub fn inner(&self) -> (&Id, &[JsWord])
pub fn last(&self) -> &JsWord
pub fn slice_to(&self, end: usize) -> Name
Trait Implementations
sourceimpl From<&RTsEntityName> for Name
impl From<&RTsEntityName> for Name
sourcefn from(n: &RTsEntityName) -> Self
fn from(n: &RTsEntityName) -> Self
Converts to this type from the input type.
sourceimpl From<&RTsThisTypeOrIdent> for Name
impl From<&RTsThisTypeOrIdent> for Name
sourcefn from(ty: &RTsThisTypeOrIdent) -> Self
fn from(ty: &RTsThisTypeOrIdent) -> Self
Converts to this type from the input type.
sourceimpl From<RTsEntityName> for Name
impl From<RTsEntityName> for Name
sourcefn from(n: RTsEntityName) -> Self
fn from(n: RTsEntityName) -> Self
Converts to this type from the input type.
sourceimpl From<RTsThisType> for Name
impl From<RTsThisType> for Name
sourcefn from(this: RTsThisType) -> Name
fn from(this: RTsThisType) -> Name
Converts to this type from the input type.
sourceimpl Ord for Name
impl Ord for Name
1.21.0 · sourcefn max(self, other: Self) -> Self
fn max(self, other: Self) -> Self
Compares and returns the maximum of two values. Read more
1.21.0 · sourcefn min(self, other: Self) -> Self
fn min(self, other: Self) -> Self
Compares and returns the minimum of two values. Read more
1.50.0 · sourcefn clamp(self, min: Self, max: Self) -> Selfwhere
Self: PartialOrd<Self>,
fn clamp(self, min: Self, max: Self) -> Selfwhere
Self: PartialOrd<Self>,
Restrict a value to a certain interval. Read more
sourceimpl PartialOrd<Name> for Name
impl PartialOrd<Name> for Name
sourcefn partial_cmp(&self, other: &Name) -> Option<Ordering>
fn partial_cmp(&self, other: &Name) -> Option<Ordering>
1.0.0 · sourcefn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moresourceimpl<'a> TryFrom<&'a RMemberExpr> for Name
impl<'a> TryFrom<&'a RMemberExpr> for Name
impl Eq for Name
impl StructuralEq for Name
impl StructuralPartialEq for Name
Auto Trait Implementations
impl RefUnwindSafe for Name
impl Send for Name
impl Sync for Name
impl Unpin for Name
impl UnwindSafe for Name
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> CallHasher for Twhere
T: Hash + ?Sized,
impl<T> CallHasher for Twhere
T: Hash + ?Sized,
sourceimpl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
sourcefn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.