[−][src]Struct xml_string::names::Nmtoken
String slice for Nmtoken
.
Implementations
impl Nmtoken
[src]
pub fn from_str(s: &str) -> Result<&Self, NameError>
[src]
Creates a new &Nmtoken
.
Failures
Fails if the given string is not a valid Nmtoken
.
Examples
assert_eq!(Nmtoken::from_str("hello")?, "hello"); assert_eq!(Nmtoken::from_str("012")?, "012"); assert!(Nmtoken::from_str("").is_err(), "Empty string is not an Nmtoken"); assert!(Nmtoken::from_str("foo bar").is_err(), "Whitespace is not allowed");
#[must_use]pub unsafe fn new_unchecked(s: &str) -> &Self
[src]
Creates a new &Nmtoken
without validation.
Safety
The given string should be a valid Nmtoken
.
Examples
let tok = unsafe { Nmtoken::new_unchecked("hello") }; assert_eq!(tok, "hello");
#[must_use]pub fn as_str(&self) -> &str
[src]
Returns the string as &str
.
Examples
let tok = Nmtoken::from_str("hello")?; assert_eq!(tok, "hello"); let s: &str = tok.as_str(); assert_eq!(s, "hello");
pub fn parse_next(s: &str) -> Result<(&Self, &str), NameError>
[src]
Parses the leading Nmtoken
and returns the value and the rest input.
Exmaples
let input = "hello, world"; let expected = Nmtoken::from_str("hello").expect("valid Nmtoken"); assert_eq!( Nmtoken::parse_next(input), Ok((expected, ", world")) );
let input = " "; assert!(Nmtoken::parse_next(input).is_err());
pub fn into_boxed_str(self: Box<Self>) -> Box<str>
[src]
Converts a Box<Nmtoken>
into a Box<str>
without copying or allocating.
Examples
let name = Nmtoken::from_str("ncname")?; let boxed_name: Box<Nmtoken> = name.into(); assert_eq!(&*boxed_name, name); let boxed_str: Box<str> = boxed_name.into_boxed_str(); assert_eq!(&*boxed_str, name.as_str());
Trait Implementations
impl AsRef<Nmtoken> for Name
[src]
impl AsRef<Nmtoken> for Ncname
[src]
impl AsRef<Nmtoken> for Nmtoken
[src]
impl AsRef<Nmtoken> for Qname
[src]
impl AsRef<str> for Nmtoken
[src]
impl<'_> Debug for &'_ Nmtoken
[src]
impl<'_> Display for &'_ Nmtoken
[src]
impl Eq for Nmtoken
[src]
impl<'_> From<&'_ Nmtoken> for Box<Nmtoken>
[src]
impl<'_> From<&'_ Nmtoken> for Rc<Nmtoken>
[src]
impl<'_> From<&'_ Nmtoken> for Arc<Nmtoken>
[src]
impl<'a> From<&'a Name> for &'a Nmtoken
[src]
impl<'a> From<&'a Ncname> for &'a Nmtoken
[src]
impl<'a> From<&'a Qname> for &'a Nmtoken
[src]
impl Hash for Nmtoken
[src]
pub fn hash<__H: Hasher>(&self, state: &mut __H)
[src]
pub fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
impl Ord for Nmtoken
[src]
pub fn cmp(&self, other: &Nmtoken) -> Ordering
[src]
#[must_use]pub fn max(self, other: Self) -> Self
1.21.0[src]
#[must_use]pub fn min(self, other: Self) -> Self
1.21.0[src]
#[must_use]pub fn clamp(self, min: Self, max: Self) -> Self
1.50.0[src]
impl<'_> PartialEq<&'_ Nmtoken> for str
[src]
pub fn eq(&self, o: &&Nmtoken) -> bool
[src]
#[must_use]pub fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
impl<'_> PartialEq<&'_ String> for Nmtoken
[src]
pub fn eq(&self, o: &&String) -> bool
[src]
#[must_use]pub fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
impl<'_> PartialEq<&'_ str> for Nmtoken
[src]
impl PartialEq<Box<str, Global>> for Nmtoken
[src]
pub fn eq(&self, o: &Box<str>) -> bool
[src]
#[must_use]pub fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
impl<'_> PartialEq<Cow<'_, str>> for Nmtoken
[src]
pub fn eq(&self, o: &Cow<'_, str>) -> bool
[src]
#[must_use]pub fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
impl PartialEq<Nmtoken> for Nmtoken
[src]
impl PartialEq<Nmtoken> for str
[src]
pub fn eq(&self, o: &Nmtoken) -> bool
[src]
#[must_use]pub fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
impl<'_> PartialEq<Nmtoken> for &'_ str
[src]
pub fn eq(&self, o: &Nmtoken) -> bool
[src]
#[must_use]pub fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
impl PartialEq<Nmtoken> for String
[src]
pub fn eq(&self, o: &Nmtoken) -> bool
[src]
#[must_use]pub fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
impl<'_> PartialEq<Nmtoken> for &'_ String
[src]
pub fn eq(&self, o: &Nmtoken) -> bool
[src]
#[must_use]pub fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
impl PartialEq<Nmtoken> for Box<str>
[src]
pub fn eq(&self, o: &Nmtoken) -> bool
[src]
#[must_use]pub fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
impl<'_> PartialEq<Nmtoken> for Cow<'_, str>
[src]
pub fn eq(&self, o: &Nmtoken) -> bool
[src]
#[must_use]pub fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
impl PartialEq<String> for Nmtoken
[src]
impl PartialEq<str> for Nmtoken
[src]
impl<'_> PartialEq<str> for &'_ Nmtoken
[src]
impl<'_> PartialOrd<&'_ Nmtoken> for str
[src]
pub fn partial_cmp(&self, o: &&Nmtoken) -> Option<Ordering>
[src]
#[must_use]pub fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn gt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn ge(&self, other: &Rhs) -> bool
1.0.0[src]
impl<'_> PartialOrd<&'_ String> for Nmtoken
[src]
pub fn partial_cmp(&self, o: &&String) -> Option<Ordering>
[src]
#[must_use]pub fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn gt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn ge(&self, other: &Rhs) -> bool
1.0.0[src]
impl<'_> PartialOrd<&'_ str> for Nmtoken
[src]
pub fn partial_cmp(&self, o: &&str) -> Option<Ordering>
[src]
#[must_use]pub fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn gt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn ge(&self, other: &Rhs) -> bool
1.0.0[src]
impl PartialOrd<Box<str, Global>> for Nmtoken
[src]
pub fn partial_cmp(&self, o: &Box<str>) -> Option<Ordering>
[src]
#[must_use]pub fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn gt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn ge(&self, other: &Rhs) -> bool
1.0.0[src]
impl<'_> PartialOrd<Cow<'_, str>> for Nmtoken
[src]
pub fn partial_cmp(&self, o: &Cow<'_, str>) -> Option<Ordering>
[src]
#[must_use]pub fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn gt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn ge(&self, other: &Rhs) -> bool
1.0.0[src]
impl PartialOrd<Nmtoken> for Nmtoken
[src]
pub fn partial_cmp(&self, other: &Nmtoken) -> Option<Ordering>
[src]
pub fn lt(&self, other: &Nmtoken) -> bool
[src]
pub fn le(&self, other: &Nmtoken) -> bool
[src]
pub fn gt(&self, other: &Nmtoken) -> bool
[src]
pub fn ge(&self, other: &Nmtoken) -> bool
[src]
impl PartialOrd<Nmtoken> for str
[src]
pub fn partial_cmp(&self, o: &Nmtoken) -> Option<Ordering>
[src]
#[must_use]pub fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn gt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn ge(&self, other: &Rhs) -> bool
1.0.0[src]
impl<'_> PartialOrd<Nmtoken> for &'_ str
[src]
pub fn partial_cmp(&self, o: &Nmtoken) -> Option<Ordering>
[src]
#[must_use]pub fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn gt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn ge(&self, other: &Rhs) -> bool
1.0.0[src]
impl PartialOrd<Nmtoken> for String
[src]
pub fn partial_cmp(&self, o: &Nmtoken) -> Option<Ordering>
[src]
#[must_use]pub fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn gt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn ge(&self, other: &Rhs) -> bool
1.0.0[src]
impl<'_> PartialOrd<Nmtoken> for &'_ String
[src]
pub fn partial_cmp(&self, o: &Nmtoken) -> Option<Ordering>
[src]
#[must_use]pub fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn gt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn ge(&self, other: &Rhs) -> bool
1.0.0[src]
impl PartialOrd<Nmtoken> for Box<str>
[src]
pub fn partial_cmp(&self, o: &Nmtoken) -> Option<Ordering>
[src]
#[must_use]pub fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn gt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn ge(&self, other: &Rhs) -> bool
1.0.0[src]
impl<'_> PartialOrd<Nmtoken> for Cow<'_, str>
[src]
pub fn partial_cmp(&self, o: &Nmtoken) -> Option<Ordering>
[src]
#[must_use]pub fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn gt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn ge(&self, other: &Rhs) -> bool
1.0.0[src]
impl PartialOrd<String> for Nmtoken
[src]
pub fn partial_cmp(&self, o: &String) -> Option<Ordering>
[src]
#[must_use]pub fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn gt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn ge(&self, other: &Rhs) -> bool
1.0.0[src]
impl PartialOrd<str> for Nmtoken
[src]
pub fn partial_cmp(&self, o: &str) -> Option<Ordering>
[src]
#[must_use]pub fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn gt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn ge(&self, other: &Rhs) -> bool
1.0.0[src]
impl<'_> PartialOrd<str> for &'_ Nmtoken
[src]
pub fn partial_cmp(&self, o: &str) -> Option<Ordering>
[src]
#[must_use]pub fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn gt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn ge(&self, other: &Rhs) -> bool
1.0.0[src]
impl StructuralEq for Nmtoken
[src]
impl StructuralPartialEq for Nmtoken
[src]
impl ToOwned for Nmtoken
[src]
type Owned = Box<Nmtoken>
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> Self::Owned
[src]
pub fn clone_into(&self, target: &mut Self::Owned)
[src]
impl<'a> TryFrom<&'a Nmtoken> for &'a Name
[src]
type Error = NameError
The type returned in the event of a conversion error.