pub struct JsIdentifier(/* private fields */);Expand description
Validated ASCII-safe JavaScript identifier.
Implementations§
Source§impl JsIdentifier
impl JsIdentifier
Sourcepub fn new(input: &str) -> Result<Self, JsIdentifierError>
pub fn new(input: &str) -> Result<Self, JsIdentifierError>
Creates an ASCII-safe JavaScript identifier.
§Errors
Returns JsIdentifierError when input is empty or not ASCII identifier-shaped.
Trait Implementations§
Source§impl Clone for JsIdentifier
impl Clone for JsIdentifier
Source§fn clone(&self) -> JsIdentifier
fn clone(&self) -> JsIdentifier
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 JsIdentifier
impl Debug for JsIdentifier
Source§impl Display for JsIdentifier
impl Display for JsIdentifier
Source§impl FromStr for JsIdentifier
impl FromStr for JsIdentifier
Source§impl Hash for JsIdentifier
impl Hash for JsIdentifier
Source§impl Ord for JsIdentifier
impl Ord for JsIdentifier
Source§fn cmp(&self, other: &JsIdentifier) -> Ordering
fn cmp(&self, other: &JsIdentifier) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialEq for JsIdentifier
impl PartialEq for JsIdentifier
Source§impl PartialOrd for JsIdentifier
impl PartialOrd for JsIdentifier
Source§impl TryFrom<&str> for JsIdentifier
impl TryFrom<&str> for JsIdentifier
impl Eq for JsIdentifier
impl StructuralPartialEq for JsIdentifier
Auto Trait Implementations§
impl Freeze for JsIdentifier
impl RefUnwindSafe for JsIdentifier
impl Send for JsIdentifier
impl Sync for JsIdentifier
impl Unpin for JsIdentifier
impl UnsafeUnpin for JsIdentifier
impl UnwindSafe for JsIdentifier
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