[−][src]Struct xml_string::names::ParsedUriQualifiedName
Parsed URIQualifiedName
reference.
Implementations
impl<'a> ParsedUriQualifiedName<'a>
[src]
pub fn from_str(s: &'a str) -> Result<Self, NameError>
[src]
Creates a new ParsedUriQualifiedName<'_>
from the given string slice.
Failures
Fails if the given string is not a valid URIQualifiedName
.
Examples
let name = ParsedUriQualifiedName::from_str("Q{http://example.com/}name")?; assert_eq!(name, "Q{http://example.com/}name"); assert_eq!( ParsedUriQualifiedName::from_str("Q{}name")?, "Q{}name", "Empty URI is OK" ); assert_eq!( ParsedUriQualifiedName::from_str("Q{foo}bar")?, "Q{foo}bar", "URI is not validated" ); assert!( ParsedUriQualifiedName::from_str("foo").is_err(), "URIQualifiedName has `Q{{uri}}ncname` format" ); assert!( ParsedUriQualifiedName::from_str("Q{http://example.com}foo:bar").is_err(), "Colon is not allowed" ); assert!( ParsedUriQualifiedName::from_str("Q{foo{bar}qux").is_err(), "URI part cannot have `{{` and `}}`" );
#[must_use]pub fn as_uri_qualified_name(&self) -> &'a UriQualifiedName
[src]
Returns the string as &UriQualifiedName
.
Exmaples
use xml_string::names::UriQualifiedName; let name = ParsedUriQualifiedName::from_str("Q{foo}bar")?; assert_eq!(name, "Q{foo}bar"); let s: &UriQualifiedName = name.as_uri_qualified_name(); assert_eq!(s, "Q{foo}bar");
#[must_use]pub fn as_str(&self) -> &'a str
[src]
Returns the string as &str
.
Exmaples
let name = ParsedUriQualifiedName::from_str("Q{foo}bar")?; assert_eq!(name, "Q{foo}bar"); let s: &str = name.as_str(); assert_eq!(s, "Q{foo}bar");
#[must_use]pub fn uri(&self) -> &'a str
[src]
Returns the URI.
Examples
let name = ParsedUriQualifiedName::from_str("Q{foo}bar")?; assert_eq!(name.uri(), "foo"); let empty_uri = ParsedUriQualifiedName::from_str("Q{}foo")?; assert_eq!(empty_uri.uri(), "");
#[must_use]pub fn local_name(&self) -> &'a Ncname
[src]
Returns the local name.
Examples
let name = ParsedUriQualifiedName::from_str("Q{foo}bar")?; assert_eq!(name.local_name(), "bar");
#[must_use]pub fn uri_and_local(&self) -> (&'a str, &'a Ncname)
[src]
Returns a pair of the URI and the local name.
This is efficient version of (self.uri(), self.local_name())
.
Examples
use std::convert::TryFrom; let name = ParsedUriQualifiedName::from_str("Q{foo}bar")?; assert_eq!(name.uri_and_local(), (name.uri(), name.local_name()));
Trait Implementations
impl<'_> AsRef<UriQualifiedName> for ParsedUriQualifiedName<'_>
[src]
pub fn as_ref(&self) -> &UriQualifiedName
[src]
impl<'_> AsRef<str> for ParsedUriQualifiedName<'_>
[src]
impl<'a> Clone for ParsedUriQualifiedName<'a>
[src]
pub fn clone(&self) -> ParsedUriQualifiedName<'a>
[src]
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl<'a> Copy for ParsedUriQualifiedName<'a>
[src]
impl<'_> Debug for ParsedUriQualifiedName<'_>
[src]
impl<'_> Display for ParsedUriQualifiedName<'_>
[src]
impl<'a> Eq for ParsedUriQualifiedName<'a>
[src]
impl<'a> From<&'a UriQualifiedName> for ParsedUriQualifiedName<'a>
[src]
pub fn from(s: &'a UriQualifiedName) -> Self
[src]
impl<'a> From<ParsedUriQualifiedName<'a>> for &'a UriQualifiedName
[src]
pub fn from(s: ParsedUriQualifiedName<'a>) -> Self
[src]
impl<'a> Hash for ParsedUriQualifiedName<'a>
[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<'a> Ord for ParsedUriQualifiedName<'a>
[src]
pub fn cmp(&self, other: &ParsedUriQualifiedName<'a>) -> 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<&'_ ParsedUriQualifiedName<'_>> for str
[src]
pub fn eq(&self, o: &&ParsedUriQualifiedName<'_>) -> bool
[src]
#[must_use]pub fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
impl<'_, '_> PartialEq<&'_ String> for ParsedUriQualifiedName<'_>
[src]
pub fn eq(&self, other: &&String) -> bool
[src]
#[must_use]pub fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
impl<'_, '_> PartialEq<&'_ str> for ParsedUriQualifiedName<'_>
[src]
pub fn eq(&self, other: &&str) -> bool
[src]
#[must_use]pub fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
impl<'_> PartialEq<Box<str, Global>> for ParsedUriQualifiedName<'_>
[src]
pub fn eq(&self, other: &Box<str>) -> bool
[src]
#[must_use]pub fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
impl<'_, '_> PartialEq<Cow<'_, str>> for ParsedUriQualifiedName<'_>
[src]
pub fn eq(&self, other: &Cow<'_, str>) -> bool
[src]
#[must_use]pub fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
impl<'_> PartialEq<ParsedUriQualifiedName<'_>> for str
[src]
pub fn eq(&self, o: &ParsedUriQualifiedName<'_>) -> bool
[src]
#[must_use]pub fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
impl<'_, '_> PartialEq<ParsedUriQualifiedName<'_>> for &'_ str
[src]
pub fn eq(&self, o: &ParsedUriQualifiedName<'_>) -> bool
[src]
#[must_use]pub fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
impl<'_> PartialEq<ParsedUriQualifiedName<'_>> for String
[src]
pub fn eq(&self, o: &ParsedUriQualifiedName<'_>) -> bool
[src]
#[must_use]pub fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
impl<'_, '_> PartialEq<ParsedUriQualifiedName<'_>> for &'_ String
[src]
pub fn eq(&self, o: &ParsedUriQualifiedName<'_>) -> bool
[src]
#[must_use]pub fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
impl<'_> PartialEq<ParsedUriQualifiedName<'_>> for Box<str>
[src]
pub fn eq(&self, o: &ParsedUriQualifiedName<'_>) -> bool
[src]
#[must_use]pub fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
impl<'_, '_> PartialEq<ParsedUriQualifiedName<'_>> for Cow<'_, str>
[src]
pub fn eq(&self, o: &ParsedUriQualifiedName<'_>) -> bool
[src]
#[must_use]pub fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
impl<'a> PartialEq<ParsedUriQualifiedName<'a>> for ParsedUriQualifiedName<'a>
[src]
pub fn eq(&self, other: &ParsedUriQualifiedName<'a>) -> bool
[src]
pub fn ne(&self, other: &ParsedUriQualifiedName<'a>) -> bool
[src]
impl<'_> PartialEq<String> for ParsedUriQualifiedName<'_>
[src]
pub fn eq(&self, other: &String) -> bool
[src]
#[must_use]pub fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
impl<'_> PartialEq<str> for ParsedUriQualifiedName<'_>
[src]
pub fn eq(&self, other: &str) -> bool
[src]
#[must_use]pub fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
impl<'_, '_> PartialEq<str> for &'_ ParsedUriQualifiedName<'_>
[src]
pub fn eq(&self, other: &str) -> bool
[src]
#[must_use]pub fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
impl<'_, '_> PartialOrd<&'_ ParsedUriQualifiedName<'_>> for str
[src]
pub fn partial_cmp(&self, o: &&ParsedUriQualifiedName<'_>) -> 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<ParsedUriQualifiedName<'_>> for str
[src]
pub fn partial_cmp(&self, o: &ParsedUriQualifiedName<'_>) -> 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<ParsedUriQualifiedName<'_>> for &'_ str
[src]
pub fn partial_cmp(&self, o: &ParsedUriQualifiedName<'_>) -> 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<ParsedUriQualifiedName<'_>> for String
[src]
pub fn partial_cmp(&self, o: &ParsedUriQualifiedName<'_>) -> 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<ParsedUriQualifiedName<'_>> for &'_ String
[src]
pub fn partial_cmp(&self, o: &ParsedUriQualifiedName<'_>) -> 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<ParsedUriQualifiedName<'_>> for Box<str>
[src]
pub fn partial_cmp(&self, o: &ParsedUriQualifiedName<'_>) -> 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<ParsedUriQualifiedName<'_>> for Cow<'_, str>
[src]
pub fn partial_cmp(&self, o: &ParsedUriQualifiedName<'_>) -> 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<'a> PartialOrd<ParsedUriQualifiedName<'a>> for ParsedUriQualifiedName<'a>
[src]
pub fn partial_cmp(
&self,
other: &ParsedUriQualifiedName<'a>
) -> Option<Ordering>
[src]
&self,
other: &ParsedUriQualifiedName<'a>
) -> Option<Ordering>
pub fn lt(&self, other: &ParsedUriQualifiedName<'a>) -> bool
[src]
pub fn le(&self, other: &ParsedUriQualifiedName<'a>) -> bool
[src]
pub fn gt(&self, other: &ParsedUriQualifiedName<'a>) -> bool
[src]
pub fn ge(&self, other: &ParsedUriQualifiedName<'a>) -> bool
[src]
impl<'a> StructuralEq for ParsedUriQualifiedName<'a>
[src]
impl<'a> StructuralPartialEq for ParsedUriQualifiedName<'a>
[src]
impl<'a> TryFrom<&'a str> for ParsedUriQualifiedName<'a>
[src]
Auto Trait Implementations
impl<'a> RefUnwindSafe for ParsedUriQualifiedName<'a>
impl<'a> Send for ParsedUriQualifiedName<'a>
impl<'a> Sync for ParsedUriQualifiedName<'a>
impl<'a> Unpin for ParsedUriQualifiedName<'a>
impl<'a> UnwindSafe for ParsedUriQualifiedName<'a>
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,