iri_string::types

Struct RiFragmentStr

source
pub struct RiFragmentStr<S> { /* private fields */ }
Expand description

A borrowed slice of an IRI fragment (i.e. after the first # character).

This corresponds to ifragment rule in RFC 3987 (and fragment rule in RFC 3986). The rule for ifragment is *( ipchar / "/" / "?" ).

§Valid values

This type can have an IRI fragment. Note that the IRI foo://bar/baz#qux has the fragment qux, not #qux.

assert!(IriFragmentStr::new("").is_ok());
assert!(IriFragmentStr::new("foo").is_ok());
assert!(IriFragmentStr::new("foo/bar").is_ok());
assert!(IriFragmentStr::new("/foo/bar").is_ok());
assert!(IriFragmentStr::new("//foo/bar").is_ok());
assert!(IriFragmentStr::new("https://user:pass@example.com:8080").is_ok());
assert!(IriFragmentStr::new("https://example.com/").is_ok());

Some characters and sequences cannot used in a fragment.

// `<` and `>` cannot directly appear in an IRI reference.
assert!(IriFragmentStr::new("<not allowed>").is_err());
// Broken percent encoding cannot appear in an IRI reference.
assert!(IriFragmentStr::new("%").is_err());
assert!(IriFragmentStr::new("%GG").is_err());
// Hash sign `#` cannot appear in an IRI fragment.
assert!(IriFragmentStr::new("#hash").is_err());

Implementations§

source§

impl<S: Spec> RiFragmentStr<S>

source

pub fn new(s: &str) -> Result<&Self, Error>

Creates a new string.

source

pub unsafe fn new_unchecked(s: &str) -> &Self

Creates a new string without validation.

This does not validate the given string, so it is caller’s responsibility to ensure the given string is valid.

§Safety

The given string must be syntactically valid as Self type. If not, any use of the returned value or the call of this function itself may result in undefined behavior.

source

pub fn as_str(&self) -> &str

Returns &str.

source

pub fn len(&self) -> usize

Returns the string length.

source

pub fn is_empty(&self) -> bool

Returns whether the string is empty.

source§

impl<S: Spec> RiFragmentStr<S>

source

pub fn from_prefixed(s: &str) -> Result<&Self, Error>

Creates a new &RiFragmentStr from the fragment part prefixed by #.

§Examples
assert!(IriFragmentStr::from_prefixed("#").is_ok());
assert!(IriFragmentStr::from_prefixed("#foo").is_ok());
assert!(IriFragmentStr::from_prefixed("#foo/bar").is_ok());
assert!(IriFragmentStr::from_prefixed("#/foo/bar").is_ok());
assert!(IriFragmentStr::from_prefixed("#//foo/bar").is_ok());
assert!(IriFragmentStr::from_prefixed("#https://user:pass@example.com:8080").is_ok());
assert!(IriFragmentStr::from_prefixed("#https://example.com/").is_ok());

// `<` and `>` cannot directly appear in an IRI.
assert!(IriFragmentStr::from_prefixed("#<not allowed>").is_err());
// Broken percent encoding cannot appear in an IRI.
assert!(IriFragmentStr::new("#%").is_err());
assert!(IriFragmentStr::new("#%GG").is_err());
// `#` prefix is expected.
assert!(IriFragmentStr::from_prefixed("").is_err());
assert!(IriFragmentStr::from_prefixed("foo").is_err());
// Hash sign `#` cannot appear in an IRI fragment.
assert!(IriFragmentStr::from_prefixed("##hash").is_err());
source§

impl RiFragmentStr<IriSpec>

Conversion from an IRI into a URI.

source

pub fn encode_to_uri(&self) -> MappedToUri<'_, Self>

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::format::ToDedicatedString;
use iri_string::types::{IriFragmentStr, UriFragmentString};

let iri = IriFragmentStr::new("alpha-is-\u{03B1}")?;
// Type annotation here is not necessary.
let uri: UriFragmentString = iri.encode_to_uri().to_dedicated_string();
assert_eq!(uri, "alpha-is-%CE%B1");
source

pub fn as_uri(&self) -> Option<&UriFragmentStr>

Converts an IRI into a URI without modification, if possible.

This is semantically equivalent to UriFragmentStr::new(self.as_str()).ok().

§Examples
use iri_string::types::{IriFragmentStr, UriFragmentStr};

let ascii_iri = IriFragmentStr::new("alpha-is-%CE%B1")?;
assert_eq!(
    ascii_iri.as_uri().map(AsRef::as_ref),
    Some("alpha-is-%CE%B1")
);

let nonascii_iri = IriFragmentStr::new("alpha-is-\u{03B1}")?;
assert_eq!(nonascii_iri.as_uri(), None);

Trait Implementations§

source§

impl AsRef<RiFragmentStr<IriSpec>> for UriFragmentStr

source§

fn as_ref(&self) -> &IriFragmentStr

Converts this type into a shared reference of the (usually inferred) input type.
source§

impl AsRef<RiFragmentStr<IriSpec>> for UriFragmentString

Available on crate feature alloc only.
source§

fn as_ref(&self) -> &IriFragmentStr

Converts this type into a shared reference of the (usually inferred) input type.
source§

impl<S: Spec> AsRef<RiFragmentStr<S>> for RiFragmentStr<S>

source§

fn as_ref(&self) -> &RiFragmentStr<S>

Converts this type into a shared reference of the (usually inferred) input type.
source§

impl<S: Spec> AsRef<RiFragmentStr<S>> for RiFragmentString<S>

source§

fn as_ref(&self) -> &RiFragmentStr<S>

Converts this type into a shared reference of the (usually inferred) input type.
source§

impl<S: Spec> AsRef<str> for RiFragmentStr<S>

source§

fn as_ref(&self) -> &str

Converts this type into a shared reference of the (usually inferred) input type.
source§

impl<S: Spec> Borrow<RiFragmentStr<S>> for RiFragmentString<S>

source§

fn borrow(&self) -> &RiFragmentStr<S>

Immutably borrows from an owned value. Read more
source§

impl<S: Spec> Debug for RiFragmentStr<S>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<'de: 'a, 'a, S: 'de + Spec> Deserialize<'de> for &'a RiFragmentStr<S>

Available on crate feature serde only.
source§

fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
where D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
source§

impl<S: Spec> Display for RiFragmentStr<S>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<'a, S: Spec> From<&'a RiFragmentStr<S>> for &'a str

source§

fn from(s: &'a RiFragmentStr<S>) -> &'a str

Converts to this type from the input type.
source§

impl<S: Spec> From<&RiFragmentStr<S>> for Arc<RiFragmentStr<S>>

Available on crate feature alloc only.
source§

fn from(s: &RiFragmentStr<S>) -> Self

Converts to this type from the input type.
source§

impl<S: Spec> From<&RiFragmentStr<S>> for Box<RiFragmentStr<S>>

Available on crate feature alloc only.
source§

fn from(s: &RiFragmentStr<S>) -> Self

Converts to this type from the input type.
source§

impl<'a, S: Spec> From<&'a RiFragmentStr<S>> for Cow<'a, RiFragmentStr<S>>

Available on crate feature alloc only.
source§

fn from(s: &'a RiFragmentStr<S>) -> Self

Converts to this type from the input type.
source§

impl<'a, S: Spec> From<&'a RiFragmentStr<S>> for MappedToUri<'a, RiFragmentStr<S>>

source§

fn from(iri: &'a RiFragmentStr<S>) -> Self

Converts to this type from the input type.
source§

impl<S: Spec> From<&RiFragmentStr<S>> for Rc<RiFragmentStr<S>>

Available on crate feature alloc only.
source§

fn from(s: &RiFragmentStr<S>) -> Self

Converts to this type from the input type.
source§

impl<S: Spec> From<&RiFragmentStr<S>> for RiFragmentString<S>

source§

fn from(s: &RiFragmentStr<S>) -> Self

Converts to this type from the input type.
source§

impl<S: Spec> From<RiFragmentString<S>> for Box<RiFragmentStr<S>>

source§

fn from(s: RiFragmentString<S>) -> Box<RiFragmentStr<S>>

Converts to this type from the input type.
source§

impl<S: Spec> Hash for RiFragmentStr<S>

source§

fn hash<H: Hasher>(&self, state: &mut H)

Feeds this value into the given Hasher. Read more
source§

impl<S: Spec> Ord for RiFragmentStr<S>

source§

fn cmp(&self, other: &Self) -> Ordering

This method returns an Ordering between self and other. Read more
source§

impl<S: Spec, T: Spec> PartialEq<&RiFragmentStr<S>> for Cow<'_, RiFragmentStr<T>>

source§

fn eq(&self, o: &&RiFragmentStr<S>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<S: Spec> PartialEq<&RiFragmentStr<S>> for Cow<'_, str>

source§

fn eq(&self, o: &&RiFragmentStr<S>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<S: Spec, T: Spec> PartialEq<&RiFragmentStr<S>> for RiFragmentStr<T>

source§

fn eq(&self, o: &&RiFragmentStr<S>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<S: Spec, T: Spec> PartialEq<&RiFragmentStr<S>> for RiFragmentString<T>

source§

fn eq(&self, o: &&RiFragmentStr<S>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<S: Spec> PartialEq<&RiFragmentStr<S>> for str

source§

fn eq(&self, o: &&RiFragmentStr<S>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<S: Spec> PartialEq<&str> for RiFragmentStr<S>

source§

fn eq(&self, o: &&str) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<S: Spec, T: Spec> PartialEq<Cow<'_, RiFragmentStr<T>>> for &RiFragmentStr<S>

source§

fn eq(&self, o: &Cow<'_, RiFragmentStr<T>>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<S: Spec> PartialEq<Cow<'_, str>> for &RiFragmentStr<S>

source§

fn eq(&self, o: &Cow<'_, str>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<S: Spec> PartialEq<Cow<'_, str>> for RiFragmentStr<S>

source§

fn eq(&self, o: &Cow<'_, str>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<S: Spec> PartialEq<RiFragmentStr<S>> for &str

source§

fn eq(&self, o: &RiFragmentStr<S>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<S: Spec> PartialEq<RiFragmentStr<S>> for Cow<'_, str>

source§

fn eq(&self, o: &RiFragmentStr<S>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<S: Spec, T: Spec> PartialEq<RiFragmentStr<S>> for RiFragmentString<T>

source§

fn eq(&self, o: &RiFragmentStr<S>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<S: Spec> PartialEq<RiFragmentStr<S>> for str

source§

fn eq(&self, o: &RiFragmentStr<S>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<S: Spec, T: Spec> PartialEq<RiFragmentStr<T>> for &RiFragmentStr<S>

source§

fn eq(&self, o: &RiFragmentStr<T>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<S: Spec, T: Spec> PartialEq<RiFragmentString<T>> for &RiFragmentStr<S>

source§

fn eq(&self, o: &RiFragmentString<T>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<S: Spec, T: Spec> PartialEq<RiFragmentString<T>> for RiFragmentStr<S>

source§

fn eq(&self, o: &RiFragmentString<T>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<S: Spec> PartialEq<str> for &RiFragmentStr<S>

source§

fn eq(&self, o: &str) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<S: Spec> PartialEq<str> for RiFragmentStr<S>

source§

fn eq(&self, o: &str) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<S: Spec> PartialEq for RiFragmentStr<S>

source§

fn eq(&self, other: &Self) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<S: Spec, T: Spec> PartialOrd<&RiFragmentStr<S>> for Cow<'_, RiFragmentStr<T>>

source§

fn partial_cmp(&self, o: &&RiFragmentStr<S>) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

fn lt(&self, other: &Rhs) -> bool

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · source§

fn le(&self, other: &Rhs) -> bool

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · source§

fn gt(&self, other: &Rhs) -> bool

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

fn ge(&self, other: &Rhs) -> bool

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
source§

impl<S: Spec> PartialOrd<&RiFragmentStr<S>> for Cow<'_, str>

source§

fn partial_cmp(&self, o: &&RiFragmentStr<S>) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

fn lt(&self, other: &Rhs) -> bool

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · source§

fn le(&self, other: &Rhs) -> bool

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · source§

fn gt(&self, other: &Rhs) -> bool

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

fn ge(&self, other: &Rhs) -> bool

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
source§

impl<S: Spec, T: Spec> PartialOrd<&RiFragmentStr<S>> for RiFragmentStr<T>

source§

fn partial_cmp(&self, o: &&RiFragmentStr<S>) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

fn lt(&self, other: &Rhs) -> bool

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · source§

fn le(&self, other: &Rhs) -> bool

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · source§

fn gt(&self, other: &Rhs) -> bool

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

fn ge(&self, other: &Rhs) -> bool

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
source§

impl<S: Spec, T: Spec> PartialOrd<&RiFragmentStr<S>> for RiFragmentString<T>

source§

fn partial_cmp(&self, o: &&RiFragmentStr<S>) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

fn lt(&self, other: &Rhs) -> bool

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · source§

fn le(&self, other: &Rhs) -> bool

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · source§

fn gt(&self, other: &Rhs) -> bool

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

fn ge(&self, other: &Rhs) -> bool

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
source§

impl<S: Spec> PartialOrd<&RiFragmentStr<S>> for str

source§

fn partial_cmp(&self, o: &&RiFragmentStr<S>) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

fn lt(&self, other: &Rhs) -> bool

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · source§

fn le(&self, other: &Rhs) -> bool

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · source§

fn gt(&self, other: &Rhs) -> bool

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

fn ge(&self, other: &Rhs) -> bool

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
source§

impl<S: Spec> PartialOrd<&str> for RiFragmentStr<S>

source§

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 · source§

fn lt(&self, other: &Rhs) -> bool

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · source§

fn le(&self, other: &Rhs) -> bool

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · source§

fn gt(&self, other: &Rhs) -> bool

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

fn ge(&self, other: &Rhs) -> bool

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
source§

impl<S: Spec, T: Spec> PartialOrd<Cow<'_, RiFragmentStr<T>>> for &RiFragmentStr<S>

source§

fn partial_cmp(&self, o: &Cow<'_, RiFragmentStr<T>>) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

fn lt(&self, other: &Rhs) -> bool

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · source§

fn le(&self, other: &Rhs) -> bool

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · source§

fn gt(&self, other: &Rhs) -> bool

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

fn ge(&self, other: &Rhs) -> bool

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
source§

impl<S: Spec> PartialOrd<Cow<'_, str>> for &RiFragmentStr<S>

source§

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 · source§

fn lt(&self, other: &Rhs) -> bool

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · source§

fn le(&self, other: &Rhs) -> bool

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · source§

fn gt(&self, other: &Rhs) -> bool

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

fn ge(&self, other: &Rhs) -> bool

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
source§

impl<S: Spec> PartialOrd<Cow<'_, str>> for RiFragmentStr<S>

source§

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 · source§

fn lt(&self, other: &Rhs) -> bool

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · source§

fn le(&self, other: &Rhs) -> bool

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · source§

fn gt(&self, other: &Rhs) -> bool

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

fn ge(&self, other: &Rhs) -> bool

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
source§

impl<S: Spec> PartialOrd<RiFragmentStr<S>> for &str

source§

fn partial_cmp(&self, o: &RiFragmentStr<S>) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

fn lt(&self, other: &Rhs) -> bool

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · source§

fn le(&self, other: &Rhs) -> bool

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · source§

fn gt(&self, other: &Rhs) -> bool

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

fn ge(&self, other: &Rhs) -> bool

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
source§

impl<S: Spec> PartialOrd<RiFragmentStr<S>> for Cow<'_, str>

source§

fn partial_cmp(&self, o: &RiFragmentStr<S>) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

fn lt(&self, other: &Rhs) -> bool

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · source§

fn le(&self, other: &Rhs) -> bool

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · source§

fn gt(&self, other: &Rhs) -> bool

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

fn ge(&self, other: &Rhs) -> bool

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
source§

impl<S: Spec, T: Spec> PartialOrd<RiFragmentStr<S>> for RiFragmentString<T>

source§

fn partial_cmp(&self, o: &RiFragmentStr<S>) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

fn lt(&self, other: &Rhs) -> bool

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · source§

fn le(&self, other: &Rhs) -> bool

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · source§

fn gt(&self, other: &Rhs) -> bool

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

fn ge(&self, other: &Rhs) -> bool

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
source§

impl<S: Spec> PartialOrd<RiFragmentStr<S>> for str

source§

fn partial_cmp(&self, o: &RiFragmentStr<S>) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

fn lt(&self, other: &Rhs) -> bool

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · source§

fn le(&self, other: &Rhs) -> bool

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · source§

fn gt(&self, other: &Rhs) -> bool

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

fn ge(&self, other: &Rhs) -> bool

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
source§

impl<S: Spec, T: Spec> PartialOrd<RiFragmentStr<T>> for &RiFragmentStr<S>

source§

fn partial_cmp(&self, o: &RiFragmentStr<T>) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

fn lt(&self, other: &Rhs) -> bool

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · source§

fn le(&self, other: &Rhs) -> bool

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · source§

fn gt(&self, other: &Rhs) -> bool

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

fn ge(&self, other: &Rhs) -> bool

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
source§

impl<S: Spec, T: Spec> PartialOrd<RiFragmentString<T>> for &RiFragmentStr<S>

source§

fn partial_cmp(&self, o: &RiFragmentString<T>) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

fn lt(&self, other: &Rhs) -> bool

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · source§

fn le(&self, other: &Rhs) -> bool

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · source§

fn gt(&self, other: &Rhs) -> bool

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

fn ge(&self, other: &Rhs) -> bool

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
source§

impl<S: Spec, T: Spec> PartialOrd<RiFragmentString<T>> for RiFragmentStr<S>

source§

fn partial_cmp(&self, o: &RiFragmentString<T>) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

fn lt(&self, other: &Rhs) -> bool

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · source§

fn le(&self, other: &Rhs) -> bool

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · source§

fn gt(&self, other: &Rhs) -> bool

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

fn ge(&self, other: &Rhs) -> bool

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
source§

impl<S: Spec> PartialOrd<str> for &RiFragmentStr<S>

source§

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 · source§

fn lt(&self, other: &Rhs) -> bool

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · source§

fn le(&self, other: &Rhs) -> bool

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · source§

fn gt(&self, other: &Rhs) -> bool

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

fn ge(&self, other: &Rhs) -> bool

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
source§

impl<S: Spec> PartialOrd<str> for RiFragmentStr<S>

source§

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 · source§

fn lt(&self, other: &Rhs) -> bool

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · source§

fn le(&self, other: &Rhs) -> bool

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · source§

fn gt(&self, other: &Rhs) -> bool

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

fn ge(&self, other: &Rhs) -> bool

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
source§

impl<S: Spec> PartialOrd for RiFragmentStr<S>

source§

fn partial_cmp(&self, other: &Self) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

fn lt(&self, other: &Rhs) -> bool

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · source§

fn le(&self, other: &Rhs) -> bool

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · source§

fn gt(&self, other: &Rhs) -> bool

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

fn ge(&self, other: &Rhs) -> bool

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
source§

impl<S> Serialize for RiFragmentStr<S>
where S: Spec,

source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
source§

impl<S: Spec> ToOwned for RiFragmentStr<S>

source§

type Owned = RiFragmentString<S>

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> Self::Owned

Creates owned data from borrowed data, usually by cloning. Read more
1.63.0 · source§

fn clone_into(&self, target: &mut Self::Owned)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<'a, S: Spec> TryFrom<&'a [u8]> for &'a RiFragmentStr<S>

source§

type Error = Error

The type returned in the event of a conversion error.
source§

fn try_from(bytes: &'a [u8]) -> Result<Self, Self::Error>

Performs the conversion.
source§

impl<'a, S: Spec> TryFrom<&'a str> for &'a RiFragmentStr<S>

source§

type Error = Error

The type returned in the event of a conversion error.
source§

fn try_from(s: &'a str) -> Result<Self, Self::Error>

Performs the conversion.
source§

impl<S: Spec> Eq for RiFragmentStr<S>

Auto Trait Implementations§

§

impl<S> Freeze for RiFragmentStr<S>

§

impl<S> RefUnwindSafe for RiFragmentStr<S>

§

impl<S> Send for RiFragmentStr<S>

§

impl<S> !Sized for RiFragmentStr<S>

§

impl<S> Sync for RiFragmentStr<S>

§

impl<S> Unpin for RiFragmentStr<S>

§

impl<S> UnwindSafe for RiFragmentStr<S>

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> ToString for T
where T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more