Struct JsIdentifier
pub struct JsIdentifier(/* private fields */);Expand description
Validated ASCII-safe JavaScript identifier.
Implementations§
§impl JsIdentifier
impl JsIdentifier
pub fn new(input: &str) -> Result<JsIdentifier, JsIdentifierError>
pub fn new(input: &str) -> Result<JsIdentifier, JsIdentifierError>
Creates an ASCII-safe JavaScript identifier.
§Errors
Returns JsIdentifierError when input is empty or not ASCII identifier-shaped.
Trait Implementations§
§impl Clone for JsIdentifier
impl Clone for JsIdentifier
§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 more§impl Debug for JsIdentifier
impl Debug for JsIdentifier
§impl Display for JsIdentifier
impl Display for JsIdentifier
§impl FromStr for JsIdentifier
impl FromStr for JsIdentifier
§type Err = JsIdentifierError
type Err = JsIdentifierError
The associated error which can be returned from parsing.
§fn from_str(input: &str) -> Result<JsIdentifier, <JsIdentifier as FromStr>::Err>
fn from_str(input: &str) -> Result<JsIdentifier, <JsIdentifier as FromStr>::Err>
Parses a string
s to return a value of this type. Read more§impl Hash for JsIdentifier
impl Hash for JsIdentifier
§impl Ord for JsIdentifier
impl Ord for JsIdentifier
§impl PartialEq for JsIdentifier
impl PartialEq for JsIdentifier
§impl PartialOrd for JsIdentifier
impl PartialOrd for JsIdentifier
§impl TryFrom<&str> for JsIdentifier
impl TryFrom<&str> for JsIdentifier
§type Error = JsIdentifierError
type Error = JsIdentifierError
The type returned in the event of a conversion error.
§fn try_from(
value: &str,
) -> Result<JsIdentifier, <JsIdentifier as TryFrom<&str>>::Error>
fn try_from( value: &str, ) -> Result<JsIdentifier, <JsIdentifier as TryFrom<&str>>::Error>
Performs the conversion.
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