pub struct TokenizedName {
pub input: String,
pub tokens: Vec<EnsNameToken>,
}
Expand description
Represents a full ENS name, including the original input and the sequence of tokens vitalik.eth ^^^^^^^^^^^ name
Fields§
§input: String
§tokens: Vec<EnsNameToken>
Implementations§
Source§impl TokenizedName
impl TokenizedName
pub fn empty() -> Self
Sourcepub fn from_input(
input: impl AsRef<str>,
specs: &CodePointsSpecs,
apply_nfc: bool,
) -> Result<Self, ProcessError>
pub fn from_input( input: impl AsRef<str>, specs: &CodePointsSpecs, apply_nfc: bool, ) -> Result<Self, ProcessError>
Tokenizes an input string, applying NFC normalization if requested.
pub fn is_empty(&self) -> bool
Sourcepub fn iter_tokens(&self) -> impl Iterator<Item = &EnsNameToken>
pub fn iter_tokens(&self) -> impl Iterator<Item = &EnsNameToken>
Returns an iterator over all tokens in the tokenized name.
Sourcepub fn iter_labels(&self) -> impl Iterator<Item = TokenizedLabel<'_>>
pub fn iter_labels(&self) -> impl Iterator<Item = TokenizedLabel<'_>>
Returns an iterator over all labels in the tokenized name. Basically, it splits the tokenized name by stop tokens.
pub fn labels(&self) -> Vec<TokenizedLabel<'_>>
Trait Implementations§
Source§impl Clone for TokenizedName
impl Clone for TokenizedName
Source§fn clone(&self) -> TokenizedName
fn clone(&self) -> TokenizedName
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for TokenizedName
impl Debug for TokenizedName
Source§impl PartialEq for TokenizedName
impl PartialEq for TokenizedName
impl Eq for TokenizedName
impl StructuralPartialEq for TokenizedName
Auto Trait Implementations§
impl Freeze for TokenizedName
impl RefUnwindSafe for TokenizedName
impl Send for TokenizedName
impl Sync for TokenizedName
impl Unpin for TokenizedName
impl UnwindSafe for TokenizedName
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more