Struct iri_string::types::RiRelativeString
source · [−]pub struct RiRelativeString<S> { /* private fields */ }
Expand description
An owned string of a relative IRI reference.
This corresponds to irelative-ref
rule in RFC 3987
(and relative-ref
rule in RFC 3986).
The rule for irelative-ref
is irelative-part [ "?" iquery ] [ "#" ifragment ]
.
For details, see the document for RiRelativeStr
.
Enabled by alloc
or std
feature.
Implementations
sourceimpl<S: Spec> RiRelativeString<S>
impl<S: Spec> RiRelativeString<S>
sourcepub fn shrink_to_fit(&mut self)
pub fn shrink_to_fit(&mut self)
Shrinks the capacity of the inner buffer to match its length.
sourcepub fn as_slice(&self) -> &RiRelativeStr<S>
pub fn as_slice(&self) -> &RiRelativeStr<S>
Returns the borrowed IRI string slice.
This is equivalent to &*self
.
sourceimpl<S: Spec> RiRelativeString<S>
impl<S: Spec> RiRelativeString<S>
sourcepub fn set_fragment(&mut self, fragment: Option<&RiFragmentStr<S>>)
pub fn set_fragment(&mut self, fragment: Option<&RiFragmentStr<S>>)
Sets the fragment part to the given string.
Removes fragment part (and following #
character) if None
is given.
sourceimpl RiRelativeString<IriSpec>
impl RiRelativeString<IriSpec>
Conversion from an IRI into a URI.
sourcepub fn encode_to_uri(&mut self)
pub fn encode_to_uri(&mut self)
Percent-encodes the IRI into a valid URI that identifies the equivalent resource.
After the encode, the IRI is also a valid URI.
If you want a new URI string rather than modifying the IRI string,
use encode_into_uri
method.
If you need more precise control over memory allocation and buffer
handling, use MappedToUri
type.
Examples
#[cfg(feature = "alloc")] {
use iri_string::types::IriRelativeString;
let mut iri = IriRelativeString::try_from("../?alpha=\u{03B1}")?;
iri.encode_to_uri();
assert_eq!(iri, "../?alpha=%CE%B1");
sourcepub fn encode_into_uri(self) -> UriRelativeString
pub fn encode_into_uri(self) -> UriRelativeString
Percent-encodes the IRI into a valid URI that identifies the equivalent resource.
If you want to modify the value rather than creating a new
URI string, use encode_to_uri
method.
If you need more precise control over memory allocation and buffer
handling, use MappedToUri
type.
Examples
#[cfg(feature = "alloc")] {
use iri_string::types::{IriRelativeString, UriRelativeString};
let iri = IriRelativeString::try_from("../?alpha=\u{03B1}")?;
// Type annotation here is not necessary.
let uri: UriRelativeString = iri.encode_into_uri();
assert_eq!(uri, "../?alpha=%CE%B1");
sourcepub fn try_into_uri(self) -> Result<UriRelativeString, IriRelativeString>
pub fn try_into_uri(self) -> Result<UriRelativeString, IriRelativeString>
Converts an IRI into a URI without modification, if possible.
Examples
use iri_string::types::{IriRelativeString, UriRelativeString};
let ascii_iri = IriRelativeString::try_from("../?alpha=%CE%B1")?;
assert_eq!(
ascii_iri.try_into_uri().map(|uri| uri.to_string()),
Ok("../?alpha=%CE%B1".to_string())
);
let nonascii_iri = IriRelativeString::try_from("../?alpha=\u{03B1}")?;
assert_eq!(
nonascii_iri.try_into_uri().map_err(|iri| iri.to_string()),
Err("../?alpha=\u{03B1}".to_string())
);
Methods from Deref<Target = RiRelativeStr<S>>
sourcepub fn resolve_against(
&self,
base: &RiAbsoluteStr<S>
) -> Result<RiString<S>, TaskError<Error>>
pub fn resolve_against(
&self,
base: &RiAbsoluteStr<S>
) -> Result<RiString<S>, TaskError<Error>>
Returns resolved IRI against the given base IRI, using strict resolver.
For reference resolution output examples, see RFC 3986 section 5.4.
Enabled by alloc
or std
feature.
Strictness
The IRI parsers provided by this crate is strict (e.g. http:g
is
always interpreted as a composition of the scheme http
and the path
g
), so backward compatible parsing and resolution are not provided.
About parser and resolver strictness, see RFC 3986 section 5.4.2:
Some parsers allow the scheme name to be present in a relative reference if it is the same as the base URI scheme. This is considered to be a loophole in prior specifications of partial URI RFC1630. Its use should be avoided but is allowed for backward compatibility.
Failures
This fails if
- memory allocation failed, or
- the IRI referernce is unresolvable against the base.
To see examples of unresolvable IRIs, visit the documentation
for normalize
module.
sourcepub fn resolve_normalize_against(
&self,
base: &RiAbsoluteStr<S>
) -> Result<RiString<S>, TaskError<Error>>
pub fn resolve_normalize_against(
&self,
base: &RiAbsoluteStr<S>
) -> Result<RiString<S>, TaskError<Error>>
Returns normalized and resolved IRI against the given base IRI.
This returns the normalized result of
resolve_against
method.
Enabled by alloc
or std
feature.
Failures
This fails if
- memory allocation failed, or
- the IRI referernce is unresolvable against the base.
To see examples of unresolvable IRIs, visit the documentation
for normalize
module.
Returns the authority.
The leading //
is truncated.
Examples
use iri_string::types::IriRelativeStr;
let iri = IriRelativeStr::new("//example.com/pathpath?queryquery#fragfrag")?;
assert_eq!(iri.authority_str(), Some("example.com"));
use iri_string::types::IriRelativeStr;
let iri = IriRelativeStr::new("foo//bar:baz")?;
assert_eq!(iri.authority_str(), None);
sourcepub fn path_str(&self) -> &str
pub fn path_str(&self) -> &str
Returns the path.
Examples
use iri_string::types::IriRelativeStr;
let iri = IriRelativeStr::new("//example.com/pathpath?queryquery#fragfrag")?;
assert_eq!(iri.path_str(), "/pathpath");
use iri_string::types::IriRelativeStr;
let iri = IriRelativeStr::new("foo//bar:baz")?;
assert_eq!(iri.path_str(), "foo//bar:baz");
sourcepub fn query_str(&self) -> Option<&str>
pub fn query_str(&self) -> Option<&str>
Returns the path.
The leading question mark (?
) is truncated.
Examples
use iri_string::types::IriRelativeStr;
let iri = IriRelativeStr::new("//example.com/pathpath?queryquery#fragfrag")?;
assert_eq!(iri.query_str(), Some("queryquery"));
use iri_string::types::IriRelativeStr;
let iri = IriRelativeStr::new("foo//bar:baz?")?;
assert_eq!(iri.query_str(), Some(""));
sourcepub fn fragment(&self) -> Option<&RiFragmentStr<S>>
pub fn fragment(&self) -> Option<&RiFragmentStr<S>>
Returns the fragment part if exists.
A leading #
character is truncated if the fragment part exists.
Examples
If the IRI has a fragment part, Some(_)
is returned.
let iri = IriRelativeStr::new("?foo#bar")?;
let fragment = IriFragmentStr::new("bar")?;
assert_eq!(iri.fragment(), Some(fragment));
let iri = IriRelativeStr::new("#foo")?;
let fragment = IriFragmentStr::new("foo")?;
assert_eq!(iri.fragment(), Some(fragment));
When the fragment part exists but is empty string, Some(_)
is returned.
let iri = IriRelativeStr::new("#")?;
let fragment = IriFragmentStr::new("")?;
assert_eq!(iri.fragment(), Some(fragment));
If the IRI has no fragment, None
is returned.
let iri = IriRelativeStr::new("")?;
assert_eq!(iri.fragment(), None);
Returns the authority components.
Examples
use iri_string::types::IriRelativeStr;
let iri = IriRelativeStr::new("//user:pass@example.com:8080/pathpath?queryquery")?;
let authority = iri.authority_components()
.expect("authority is available");
assert_eq!(authority.userinfo(), Some("user:pass"));
assert_eq!(authority.host(), "example.com");
assert_eq!(authority.port(), Some("8080"));
use iri_string::types::IriRelativeStr;
let iri = IriRelativeStr::new("foo//bar:baz")?;
assert_eq!(iri.authority_str(), None);
sourcepub fn encode_to_uri(&self) -> UriRelativeString
pub fn encode_to_uri(&self) -> UriRelativeString
Percent-encodes the IRI into a valid URI that identifies the equivalent resource.
If you need more precise control over memory allocation and buffer
handling, use MappedToUri
type.
Examples
use iri_string::types::{IriRelativeStr, UriRelativeString};
let iri = IriRelativeStr::new("../?alpha=\u{03B1}")?;
// Type annotation here is not necessary.
let uri: UriRelativeString = iri.encode_to_uri();
assert_eq!(uri, "../?alpha=%CE%B1");
sourcepub fn as_uri(&self) -> Option<&UriRelativeStr>
pub fn as_uri(&self) -> Option<&UriRelativeStr>
Converts an IRI into a URI without modification, if possible.
This is semantically equivalent to
UriRelativeStr::new(self.as_str()).ok()
.
Examples
use iri_string::types::{IriRelativeStr, UriRelativeStr};
let ascii_iri = IriRelativeStr::new("../?alpha=%CE%B1")?;
assert_eq!(
ascii_iri.as_uri().map(AsRef::as_ref),
Some("../?alpha=%CE%B1")
);
let nonascii_iri = IriRelativeStr::new("../?alpha=\u{03B1}")?;
assert_eq!(nonascii_iri.as_uri(), None);
Trait Implementations
sourceimpl<S: Spec> AsRef<RiReferenceStr<S>> for RiRelativeString<S>
impl<S: Spec> AsRef<RiReferenceStr<S>> for RiRelativeString<S>
sourcefn as_ref(&self) -> &RiReferenceStr<S>
fn as_ref(&self) -> &RiReferenceStr<S>
Converts this type into a shared reference of the (usually inferred) input type.
sourceimpl<S: Spec> AsRef<RiRelativeStr<S>> for RiRelativeString<S>
impl<S: Spec> AsRef<RiRelativeStr<S>> for RiRelativeString<S>
sourcefn as_ref(&self) -> &RiRelativeStr<S>
fn as_ref(&self) -> &RiRelativeStr<S>
Converts this type into a shared reference of the (usually inferred) input type.
sourceimpl<S: Spec> AsRef<str> for RiRelativeString<S>
impl<S: Spec> AsRef<str> for RiRelativeString<S>
sourceimpl<S: Spec> Borrow<RiRelativeStr<S>> for RiRelativeString<S>
impl<S: Spec> Borrow<RiRelativeStr<S>> for RiRelativeString<S>
sourcefn borrow(&self) -> &RiRelativeStr<S>
fn borrow(&self) -> &RiRelativeStr<S>
Immutably borrows from an owned value. Read more
sourceimpl<S: Spec> Borrow<str> for RiRelativeString<S>
impl<S: Spec> Borrow<str> for RiRelativeString<S>
sourceimpl<S: Spec> Clone for RiRelativeString<S>
impl<S: Spec> Clone for RiRelativeString<S>
sourceimpl<S: Spec> Debug for RiRelativeString<S>
impl<S: Spec> Debug for RiRelativeString<S>
sourceimpl<S: Spec> Deref for RiRelativeString<S>
impl<S: Spec> Deref for RiRelativeString<S>
type Target = RiRelativeStr<S>
type Target = RiRelativeStr<S>
The resulting type after dereferencing.
sourcefn deref(&self) -> &RiRelativeStr<S>
fn deref(&self) -> &RiRelativeStr<S>
Dereferences the value.
sourceimpl<'de, S: Spec> Deserialize<'de> for RiRelativeString<S>
impl<'de, S: Spec> Deserialize<'de> for RiRelativeString<S>
sourcefn deserialize<D>(deserializer: D) -> Result<Self, D::Error> where
D: Deserializer<'de>,
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error> where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
sourceimpl<S: Spec> Display for RiRelativeString<S>
impl<S: Spec> Display for RiRelativeString<S>
sourceimpl<S: Spec> From<&'_ RiRelativeStr<S>> for RiRelativeString<S>
impl<S: Spec> From<&'_ RiRelativeStr<S>> for RiRelativeString<S>
sourcefn from(s: &RiRelativeStr<S>) -> Self
fn from(s: &RiRelativeStr<S>) -> Self
Converts to this type from the input type.
sourceimpl<'a> From<&'a RiRelativeString<IriSpec>> for MappedToUri<'a, IriRelativeStr>
impl<'a> From<&'a RiRelativeString<IriSpec>> for MappedToUri<'a, IriRelativeStr>
sourcefn from(iri: &'a IriRelativeString) -> Self
fn from(iri: &'a IriRelativeString) -> Self
Converts to this type from the input type.
sourceimpl<'a> From<&'a RiRelativeString<UriSpec>> for MappedToUri<'a, UriRelativeStr>
impl<'a> From<&'a RiRelativeString<UriSpec>> for MappedToUri<'a, UriRelativeStr>
sourcefn from(iri: &'a UriRelativeString) -> Self
fn from(iri: &'a UriRelativeString) -> Self
Converts to this type from the input type.
sourceimpl<S: Spec> From<RiRelativeString<S>> for String
impl<S: Spec> From<RiRelativeString<S>> for String
sourcefn from(s: RiRelativeString<S>) -> Self
fn from(s: RiRelativeString<S>) -> Self
Converts to this type from the input type.
sourceimpl<'a, S: Spec> From<RiRelativeString<S>> for Cow<'a, RiRelativeStr<S>>
impl<'a, S: Spec> From<RiRelativeString<S>> for Cow<'a, RiRelativeStr<S>>
sourcefn from(s: RiRelativeString<S>) -> Cow<'a, RiRelativeStr<S>>
fn from(s: RiRelativeString<S>) -> Cow<'a, RiRelativeStr<S>>
Converts to this type from the input type.
sourceimpl<S: Spec> From<RiRelativeString<S>> for Box<RiRelativeStr<S>>
impl<S: Spec> From<RiRelativeString<S>> for Box<RiRelativeStr<S>>
sourcefn from(s: RiRelativeString<S>) -> Box<RiRelativeStr<S>>
fn from(s: RiRelativeString<S>) -> Box<RiRelativeStr<S>>
Converts to this type from the input type.
sourceimpl<S: Spec> From<RiRelativeString<S>> for RiReferenceString<S>
impl<S: Spec> From<RiRelativeString<S>> for RiReferenceString<S>
sourcefn from(s: RiRelativeString<S>) -> RiReferenceString<S>
fn from(s: RiRelativeString<S>) -> RiReferenceString<S>
Converts to this type from the input type.
sourceimpl From<RiRelativeString<UriSpec>> for IriRelativeString
impl From<RiRelativeString<UriSpec>> for IriRelativeString
sourcefn from(uri: UriRelativeString) -> Self
fn from(uri: UriRelativeString) -> Self
Converts to this type from the input type.
sourceimpl<S: Spec> FromStr for RiRelativeString<S>
impl<S: Spec> FromStr for RiRelativeString<S>
sourceimpl<S: Spec> Hash for RiRelativeString<S>
impl<S: Spec> Hash for RiRelativeString<S>
sourceimpl<S: Spec> Ord for RiRelativeString<S>
impl<S: Spec> Ord for RiRelativeString<S>
sourceimpl<S: Spec, T: Spec> PartialEq<&'_ RiReferenceStr<T>> for RiRelativeString<S>
impl<S: Spec, T: Spec> PartialEq<&'_ RiReferenceStr<T>> for RiRelativeString<S>
sourceimpl<S: Spec, T: Spec> PartialEq<&'_ RiRelativeStr<S>> for RiRelativeString<T>
impl<S: Spec, T: Spec> PartialEq<&'_ RiRelativeStr<S>> for RiRelativeString<T>
sourceimpl<S: Spec> PartialEq<&'_ str> for RiRelativeString<S>
impl<S: Spec> PartialEq<&'_ str> for RiRelativeString<S>
sourceimpl<S: Spec, T: Spec> PartialEq<Cow<'_, RiReferenceStr<T>>> for RiRelativeString<S>
impl<S: Spec, T: Spec> PartialEq<Cow<'_, RiReferenceStr<T>>> for RiRelativeString<S>
sourceimpl<S: Spec, T: Spec> PartialEq<Cow<'_, RiRelativeStr<S>>> for RiRelativeString<T>
impl<S: Spec, T: Spec> PartialEq<Cow<'_, RiRelativeStr<S>>> for RiRelativeString<T>
sourceimpl<S: Spec, T: Spec> PartialEq<RiReferenceStr<T>> for RiRelativeString<S>
impl<S: Spec, T: Spec> PartialEq<RiReferenceStr<T>> for RiRelativeString<S>
sourceimpl<S: Spec, T: Spec> PartialEq<RiReferenceString<T>> for RiRelativeString<S>
impl<S: Spec, T: Spec> PartialEq<RiReferenceString<T>> for RiRelativeString<S>
sourceimpl<S: Spec, T: Spec> PartialEq<RiRelativeStr<S>> for RiRelativeString<T>
impl<S: Spec, T: Spec> PartialEq<RiRelativeStr<S>> for RiRelativeString<T>
sourceimpl<S: Spec> PartialEq<RiRelativeString<S>> for str
impl<S: Spec> PartialEq<RiRelativeString<S>> for str
sourceimpl<S: Spec> PartialEq<RiRelativeString<S>> for &str
impl<S: Spec> PartialEq<RiRelativeString<S>> for &str
sourceimpl<S: Spec> PartialEq<RiRelativeString<S>> for String
impl<S: Spec> PartialEq<RiRelativeString<S>> for String
sourceimpl<S: Spec, T: Spec> PartialEq<RiRelativeString<S>> for RiReferenceStr<T>
impl<S: Spec, T: Spec> PartialEq<RiRelativeString<S>> for RiReferenceStr<T>
sourceimpl<S: Spec, T: Spec> PartialEq<RiRelativeString<S>> for &RiReferenceStr<T>
impl<S: Spec, T: Spec> PartialEq<RiRelativeString<S>> for &RiReferenceStr<T>
sourceimpl<S: Spec, T: Spec> PartialEq<RiRelativeString<S>> for Cow<'_, RiReferenceStr<T>>
impl<S: Spec, T: Spec> PartialEq<RiRelativeString<S>> for Cow<'_, RiReferenceStr<T>>
sourceimpl<S: Spec, T: Spec> PartialEq<RiRelativeString<S>> for RiReferenceString<T>
impl<S: Spec, T: Spec> PartialEq<RiRelativeString<S>> for RiReferenceString<T>
sourceimpl<S: Spec, T: Spec> PartialEq<RiRelativeString<T>> for RiRelativeString<S>
impl<S: Spec, T: Spec> PartialEq<RiRelativeString<T>> for RiRelativeString<S>
sourceimpl<S: Spec, T: Spec> PartialEq<RiRelativeString<T>> for RiRelativeStr<S>
impl<S: Spec, T: Spec> PartialEq<RiRelativeString<T>> for RiRelativeStr<S>
sourceimpl<S: Spec, T: Spec> PartialEq<RiRelativeString<T>> for &RiRelativeStr<S>
impl<S: Spec, T: Spec> PartialEq<RiRelativeString<T>> for &RiRelativeStr<S>
sourceimpl<S: Spec, T: Spec> PartialEq<RiRelativeString<T>> for Cow<'_, RiRelativeStr<S>>
impl<S: Spec, T: Spec> PartialEq<RiRelativeString<T>> for Cow<'_, RiRelativeStr<S>>
sourceimpl<S: Spec> PartialEq<String> for RiRelativeString<S>
impl<S: Spec> PartialEq<String> for RiRelativeString<S>
sourceimpl<S: Spec> PartialEq<str> for RiRelativeString<S>
impl<S: Spec> PartialEq<str> for RiRelativeString<S>
sourceimpl<S: Spec, T: Spec> PartialOrd<&'_ RiReferenceStr<T>> for RiRelativeString<S>
impl<S: Spec, T: Spec> PartialOrd<&'_ RiReferenceStr<T>> for RiRelativeString<S>
sourcefn partial_cmp(&self, o: &&RiReferenceStr<T>) -> Option<Ordering>
fn partial_cmp(&self, o: &&RiReferenceStr<T>) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
1.0.0 · sourcefn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
sourceimpl<S: Spec, T: Spec> PartialOrd<&'_ RiRelativeStr<S>> for RiRelativeString<T>
impl<S: Spec, T: Spec> PartialOrd<&'_ RiRelativeStr<S>> for RiRelativeString<T>
sourcefn partial_cmp(&self, o: &&RiRelativeStr<S>) -> Option<Ordering>
fn partial_cmp(&self, o: &&RiRelativeStr<S>) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
1.0.0 · sourcefn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
sourceimpl<S: Spec> PartialOrd<&'_ str> for RiRelativeString<S>
impl<S: Spec> PartialOrd<&'_ str> for RiRelativeString<S>
sourcefn partial_cmp(&self, o: &&str) -> Option<Ordering>
fn partial_cmp(&self, o: &&str) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
1.0.0 · sourcefn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
sourceimpl<S: Spec, T: Spec> PartialOrd<Cow<'_, RiReferenceStr<T>>> for RiRelativeString<S>
impl<S: Spec, T: Spec> PartialOrd<Cow<'_, RiReferenceStr<T>>> for RiRelativeString<S>
sourcefn partial_cmp(&self, o: &Cow<'_, RiReferenceStr<T>>) -> Option<Ordering>
fn partial_cmp(&self, o: &Cow<'_, RiReferenceStr<T>>) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
1.0.0 · sourcefn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
sourceimpl<S: Spec, T: Spec> PartialOrd<Cow<'_, RiRelativeStr<S>>> for RiRelativeString<T>
impl<S: Spec, T: Spec> PartialOrd<Cow<'_, RiRelativeStr<S>>> for RiRelativeString<T>
sourcefn partial_cmp(&self, o: &Cow<'_, RiRelativeStr<S>>) -> Option<Ordering>
fn partial_cmp(&self, o: &Cow<'_, RiRelativeStr<S>>) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
1.0.0 · sourcefn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
sourceimpl<S: Spec> PartialOrd<Cow<'_, str>> for RiRelativeString<S>
impl<S: Spec> PartialOrd<Cow<'_, str>> for RiRelativeString<S>
sourcefn partial_cmp(&self, o: &Cow<'_, str>) -> Option<Ordering>
fn partial_cmp(&self, o: &Cow<'_, str>) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
1.0.0 · sourcefn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
sourceimpl<S: Spec, T: Spec> PartialOrd<RiReferenceStr<T>> for RiRelativeString<S>
impl<S: Spec, T: Spec> PartialOrd<RiReferenceStr<T>> for RiRelativeString<S>
sourcefn partial_cmp(&self, o: &RiReferenceStr<T>) -> Option<Ordering>
fn partial_cmp(&self, o: &RiReferenceStr<T>) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
1.0.0 · sourcefn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
sourceimpl<S: Spec, T: Spec> PartialOrd<RiReferenceString<T>> for RiRelativeString<S>
impl<S: Spec, T: Spec> PartialOrd<RiReferenceString<T>> for RiRelativeString<S>
sourcefn partial_cmp(&self, o: &RiReferenceString<T>) -> Option<Ordering>
fn partial_cmp(&self, o: &RiReferenceString<T>) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
1.0.0 · sourcefn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
sourceimpl<S: Spec, T: Spec> PartialOrd<RiRelativeStr<S>> for RiRelativeString<T>
impl<S: Spec, T: Spec> PartialOrd<RiRelativeStr<S>> for RiRelativeString<T>
sourcefn partial_cmp(&self, o: &RiRelativeStr<S>) -> Option<Ordering>
fn partial_cmp(&self, o: &RiRelativeStr<S>) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
1.0.0 · sourcefn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
sourceimpl<S: Spec> PartialOrd<RiRelativeString<S>> for str
impl<S: Spec> PartialOrd<RiRelativeString<S>> for str
sourcefn partial_cmp(&self, o: &RiRelativeString<S>) -> Option<Ordering>
fn partial_cmp(&self, o: &RiRelativeString<S>) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
1.0.0 · sourcefn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
sourceimpl<S: Spec> PartialOrd<RiRelativeString<S>> for &str
impl<S: Spec> PartialOrd<RiRelativeString<S>> for &str
sourcefn partial_cmp(&self, o: &RiRelativeString<S>) -> Option<Ordering>
fn partial_cmp(&self, o: &RiRelativeString<S>) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
1.0.0 · sourcefn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
sourceimpl<S: Spec> PartialOrd<RiRelativeString<S>> for Cow<'_, str>
impl<S: Spec> PartialOrd<RiRelativeString<S>> for Cow<'_, str>
sourcefn partial_cmp(&self, o: &RiRelativeString<S>) -> Option<Ordering>
fn partial_cmp(&self, o: &RiRelativeString<S>) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
1.0.0 · sourcefn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
sourceimpl<S: Spec> PartialOrd<RiRelativeString<S>> for String
impl<S: Spec> PartialOrd<RiRelativeString<S>> for String
sourcefn partial_cmp(&self, o: &RiRelativeString<S>) -> Option<Ordering>
fn partial_cmp(&self, o: &RiRelativeString<S>) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
1.0.0 · sourcefn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
sourceimpl<S: Spec, T: Spec> PartialOrd<RiRelativeString<S>> for RiReferenceStr<T>
impl<S: Spec, T: Spec> PartialOrd<RiRelativeString<S>> for RiReferenceStr<T>
sourcefn partial_cmp(&self, o: &RiRelativeString<S>) -> Option<Ordering>
fn partial_cmp(&self, o: &RiRelativeString<S>) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
1.0.0 · sourcefn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
sourceimpl<S: Spec, T: Spec> PartialOrd<RiRelativeString<S>> for &RiReferenceStr<T>
impl<S: Spec, T: Spec> PartialOrd<RiRelativeString<S>> for &RiReferenceStr<T>
sourcefn partial_cmp(&self, o: &RiRelativeString<S>) -> Option<Ordering>
fn partial_cmp(&self, o: &RiRelativeString<S>) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
1.0.0 · sourcefn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
sourceimpl<S: Spec, T: Spec> PartialOrd<RiRelativeString<S>> for Cow<'_, RiReferenceStr<T>>
impl<S: Spec, T: Spec> PartialOrd<RiRelativeString<S>> for Cow<'_, RiReferenceStr<T>>
sourcefn partial_cmp(&self, o: &RiRelativeString<S>) -> Option<Ordering>
fn partial_cmp(&self, o: &RiRelativeString<S>) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
1.0.0 · sourcefn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
sourceimpl<S: Spec, T: Spec> PartialOrd<RiRelativeString<S>> for RiReferenceString<T>
impl<S: Spec, T: Spec> PartialOrd<RiRelativeString<S>> for RiReferenceString<T>
sourcefn partial_cmp(&self, o: &RiRelativeString<S>) -> Option<Ordering>
fn partial_cmp(&self, o: &RiRelativeString<S>) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
1.0.0 · sourcefn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
sourceimpl<S: Spec, T: Spec> PartialOrd<RiRelativeString<T>> for RiRelativeString<S>
impl<S: Spec, T: Spec> PartialOrd<RiRelativeString<T>> for RiRelativeString<S>
sourcefn partial_cmp(&self, other: &RiRelativeString<T>) -> Option<Ordering>
fn partial_cmp(&self, other: &RiRelativeString<T>) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
1.0.0 · sourcefn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
sourceimpl<S: Spec, T: Spec> PartialOrd<RiRelativeString<T>> for RiRelativeStr<S>
impl<S: Spec, T: Spec> PartialOrd<RiRelativeString<T>> for RiRelativeStr<S>
sourcefn partial_cmp(&self, o: &RiRelativeString<T>) -> Option<Ordering>
fn partial_cmp(&self, o: &RiRelativeString<T>) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
1.0.0 · sourcefn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
sourceimpl<S: Spec, T: Spec> PartialOrd<RiRelativeString<T>> for &RiRelativeStr<S>
impl<S: Spec, T: Spec> PartialOrd<RiRelativeString<T>> for &RiRelativeStr<S>
sourcefn partial_cmp(&self, o: &RiRelativeString<T>) -> Option<Ordering>
fn partial_cmp(&self, o: &RiRelativeString<T>) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
1.0.0 · sourcefn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
sourceimpl<S: Spec, T: Spec> PartialOrd<RiRelativeString<T>> for Cow<'_, RiRelativeStr<S>>
impl<S: Spec, T: Spec> PartialOrd<RiRelativeString<T>> for Cow<'_, RiRelativeStr<S>>
sourcefn partial_cmp(&self, o: &RiRelativeString<T>) -> Option<Ordering>
fn partial_cmp(&self, o: &RiRelativeString<T>) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
1.0.0 · sourcefn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
sourceimpl<S: Spec> PartialOrd<String> for RiRelativeString<S>
impl<S: Spec> PartialOrd<String> for RiRelativeString<S>
sourcefn partial_cmp(&self, o: &String) -> Option<Ordering>
fn partial_cmp(&self, o: &String) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
1.0.0 · sourcefn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
sourceimpl<S: Spec> PartialOrd<str> for RiRelativeString<S>
impl<S: Spec> PartialOrd<str> for RiRelativeString<S>
sourcefn partial_cmp(&self, o: &str) -> Option<Ordering>
fn partial_cmp(&self, o: &str) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
1.0.0 · sourcefn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
sourceimpl<S> Serialize for RiRelativeString<S> where
S: Spec,
impl<S> Serialize for RiRelativeString<S> where
S: Spec,
sourceimpl<S: Spec> TryFrom<&'_ str> for RiRelativeString<S>
impl<S: Spec> TryFrom<&'_ str> for RiRelativeString<S>
sourceimpl<S: Spec> TryFrom<RiReferenceString<S>> for RiRelativeString<S>
impl<S: Spec> TryFrom<RiReferenceString<S>> for RiRelativeString<S>
type Error = CreationError<RiReferenceString<S>>
type Error = CreationError<RiReferenceString<S>>
The type returned in the event of a conversion error.
sourcefn try_from(s: RiReferenceString<S>) -> Result<Self, Self::Error>
fn try_from(s: RiReferenceString<S>) -> Result<Self, Self::Error>
Performs the conversion.
sourceimpl<S: Spec> TryFrom<String> for RiRelativeString<S>
impl<S: Spec> TryFrom<String> for RiRelativeString<S>
impl<S: Spec> Eq for RiRelativeString<S>
Auto Trait Implementations
impl<S> RefUnwindSafe for RiRelativeString<S>
impl<S> Send for RiRelativeString<S>
impl<S> Sync for RiRelativeString<S>
impl<S> Unpin for RiRelativeString<S>
impl<S> UnwindSafe for RiRelativeString<S>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more