pub struct EnsNameNormalizer { /* private fields */ }Expand description
Main struct to handle ENS name normalization including tokenization, validation, beautification and normalization
Implementations§
Source§impl EnsNameNormalizer
impl EnsNameNormalizer
pub fn new(specs: CodePointsSpecs) -> Self
Sourcepub fn tokenize(
&self,
input: impl AsRef<str>,
) -> Result<TokenizedName, ProcessError>
pub fn tokenize( &self, input: impl AsRef<str>, ) -> Result<TokenizedName, ProcessError>
Tokenize the input string, return a TokenizedName object with Vec<EnsNameToken> inside
Sourcepub fn process(
&self,
input: impl AsRef<str>,
) -> Result<ProcessedName, ProcessError>
pub fn process( &self, input: impl AsRef<str>, ) -> Result<ProcessedName, ProcessError>
Process the input string, return a ProcessedName object with Vec<ValidatedLabel> inside
This function will tokenize and validate the name. Processed name can be normalized and beautified.
Trait Implementations§
Source§impl Default for EnsNameNormalizer
impl Default for EnsNameNormalizer
Source§fn default() -> EnsNameNormalizer
fn default() -> EnsNameNormalizer
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for EnsNameNormalizer
impl RefUnwindSafe for EnsNameNormalizer
impl Send for EnsNameNormalizer
impl Sync for EnsNameNormalizer
impl Unpin for EnsNameNormalizer
impl UnsafeUnpin for EnsNameNormalizer
impl UnwindSafe for EnsNameNormalizer
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> 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