HttpUri

Struct HttpUri 

Source
pub struct HttpUri { /* private fields */ }
Expand description

A O(1) clonable struct for representing http uri.

Implementations§

Source§

impl HttpUri

Source

pub fn authority_components(&self) -> AuthorityComponents<'_>

Get authority components of http uri

Source

pub fn authority_str(&self) -> &str

Get authority str of this http uri

Source

pub fn is_rfc3986_normalized(&self) -> bool

Checks if uri is std normalized as per rfc3986

Source

pub fn normalize_rfc3986(&self) -> HttpUri

Returns a std normal http uri. standard normalization follows rfc 3986

Source

pub fn is_http_normalized(&self) -> bool

Checks if uri is http normalized.

Source

pub fn http_normalized(&self) -> HttpUri

Returns a normal http uri. This function performs additional http specific normalization along with uri normalization specified by rfc3986.

Http normalization entails:

  • Normalization of port, If default port is explicitly specified,it will be removed.
  • Normalization of path: Empty path will be normalized to /.
  • If there are non-trailing empty segments in path, they will be removed.
Source

pub fn is_https(&self) -> bool

Get if uri is https.

Source

pub fn is_localhost(&self) -> bool

Get if http uri’s host is localhost.

Source

pub fn as_str(&self) -> &str

Get uri as string.

Source

pub fn inner(&self) -> &UriStr

Get inner uri.

Methods from Deref<Target = UriStr>§

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

pub fn to_absolute_and_fragment( &self, ) -> (&RiAbsoluteStr<S>, Option<&RiFragmentStr<S>>)

Splits the IRI into an absolute IRI part and a fragment part.

A leading # character is truncated if the fragment part exists.

§Examples

If the IRI has a fragment part, Some(_) is returned.

let iri = IriStr::new("foo://bar/baz?qux=quux#corge")?;
let (absolute, fragment) = iri.to_absolute_and_fragment();
let fragment_expected = IriFragmentStr::new("corge")?;
assert_eq!(absolute, "foo://bar/baz?qux=quux");
assert_eq!(fragment, Some(fragment_expected));

When the fragment part exists but is empty string, Some(_) is returned.

let iri = IriStr::new("foo://bar/baz?qux=quux#")?;
let (absolute, fragment) = iri.to_absolute_and_fragment();
let fragment_expected = IriFragmentStr::new("")?;
assert_eq!(absolute, "foo://bar/baz?qux=quux");
assert_eq!(fragment, Some(fragment_expected));

If the IRI has no fragment, None is returned.

let iri = IriStr::new("foo://bar/baz?qux=quux")?;
let (absolute, fragment) = iri.to_absolute_and_fragment();
assert_eq!(absolute, "foo://bar/baz?qux=quux");
assert_eq!(fragment, None);
Source

pub fn to_absolute(&self) -> &RiAbsoluteStr<S>

Strips the fragment part if exists, and returns &RiAbsoluteStr.

§Examples
let iri = IriStr::new("foo://bar/baz?qux=quux#corge")?;
assert_eq!(iri.to_absolute(), "foo://bar/baz?qux=quux");
let iri = IriStr::new("foo://bar/baz?qux=quux")?;
assert_eq!(iri.to_absolute(), "foo://bar/baz?qux=quux");
Source

pub fn ensure_rfc3986_normalizable(&self) -> Result<(), Error>

Returns Ok(()) if the IRI is normalizable by the RFC 3986 algorithm.

§Examples
use iri_string::types::IriStr;

let iri = IriStr::new("HTTP://example.COM/foo/%2e/bar/..")?;
assert!(iri.ensure_rfc3986_normalizable().is_ok());

let iri2 = IriStr::new("scheme:/..//bar")?;
// The normalization result would be `scheme://bar` according to RFC
// 3986, but it is unintended and should be treated as a failure.
// This crate automatically handles this case so that `.normalize()` won't fail.
assert!(!iri.ensure_rfc3986_normalizable().is_err());
Source

pub fn is_normalized(&self) -> bool

Returns true if the IRI is already normalized.

This returns the same result as self.normalize().to_string() == self, but does this more efficiently without heap allocation.

§Examples
use iri_string::format::ToDedicatedString;
use iri_string::types::IriStr;

let iri = IriStr::new("HTTP://example.COM/foo/./bar/%2e%2e/../baz?query#fragment")?;
assert!(!iri.is_normalized());

let normalized = iri.normalize().to_dedicated_string();
assert_eq!(normalized, "http://example.com/baz?query#fragment");
assert!(normalized.is_normalized());
use iri_string::format::ToDedicatedString;
use iri_string::types::IriStr;

let iri = IriStr::new("scheme:/.///foo")?;
// Already normalized.
assert!(iri.is_normalized());
use iri_string::format::ToDedicatedString;
use iri_string::types::IriStr;

let iri = IriStr::new("scheme:relative/..//not-a-host")?;
// Default normalization algorithm assumes the path part to be NOT opaque.
assert!(!iri.is_normalized());

let normalized = iri.normalize().to_dedicated_string();
assert_eq!(normalized, "scheme:/.//not-a-host");
Source

pub fn is_normalized_rfc3986(&self) -> bool

Returns true if the IRI is already normalized in the sense of RFC 3986.

This returns the same result as self.ensure_rfc3986_normalizable() && (self.normalize().to_string() == self), but does this more efficiently without heap allocation.

§Examples
use iri_string::format::ToDedicatedString;
use iri_string::types::IriStr;

let iri = IriStr::new("HTTP://example.COM/foo/./bar/%2e%2e/../baz?query#fragment")?;
assert!(!iri.is_normalized_rfc3986());

let normalized = iri.normalize().to_dedicated_string();
assert_eq!(normalized, "http://example.com/baz?query#fragment");
assert!(normalized.is_normalized_rfc3986());
use iri_string::format::ToDedicatedString;
use iri_string::types::IriStr;

let iri = IriStr::new("scheme:/.///foo")?;
// Not normalized in the sense of RFC 3986.
assert!(!iri.is_normalized_rfc3986());
use iri_string::format::ToDedicatedString;
use iri_string::types::IriStr;

let iri = IriStr::new("scheme:relative/..//not-a-host")?;
// RFC 3986 normalization algorithm assumes the path part to be NOT opaque.
assert!(!iri.is_normalized_rfc3986());

let normalized = iri.normalize().to_dedicated_string();
assert_eq!(normalized, "scheme:/.//not-a-host");
Source

pub fn is_normalized_but_authorityless_relative_path_preserved(&self) -> bool

Returns true if the IRI is already normalized in the sense of normalize_but_preserve_authorityless_relative_path method.

This returns the same result as self.normalize_but_preserve_authorityless_relative_path().to_string() == self, but does this more efficiently without heap allocation.

§Examples
use iri_string::format::ToDedicatedString;
use iri_string::types::IriStr;

let iri = IriStr::new("HTTP://example.COM/foo/./bar/%2e%2e/../baz?query#fragment")?;
assert!(!iri.is_normalized_but_authorityless_relative_path_preserved());

let normalized = iri
    .normalize_but_preserve_authorityless_relative_path()
    .to_dedicated_string();
assert_eq!(normalized, "http://example.com/baz?query#fragment");
assert!(normalized.is_normalized());
use iri_string::format::ToDedicatedString;
use iri_string::types::IriStr;

let iri = IriStr::new("scheme:/.///foo")?;
// Already normalized in the sense of
// `normalize_but_opaque_authorityless_relative_path()` method.
assert!(iri.is_normalized_but_authorityless_relative_path_preserved());
use iri_string::format::ToDedicatedString;
use iri_string::types::IriStr;

let iri = IriStr::new("scheme:relative/..//not-a-host")?;
// Relative path is treated as opaque since the autority component is absent.
assert!(iri.is_normalized_but_authorityless_relative_path_preserved());
Source

pub fn normalize(&self) -> Normalized<'_, RiStr<S>>

Returns the normalized IRI.

§Notes

For some abnormal IRIs, the normalization can produce semantically incorrect string that looks syntactically valid. To avoid security issues by this trap, the normalization algorithm by this crate automatically applies the workaround.

If you worry about this, test by RiStr::ensure_rfc3986_normalizable method or Normalized::ensure_rfc3986_normalizable before using the result string.

§Examples
use iri_string::format::ToDedicatedString;
use iri_string::types::IriStr;

let iri = IriStr::new("HTTP://example.COM/foo/./bar/%2e%2e/../baz?query#fragment")?;

let normalized = iri.normalize().to_dedicated_string();
assert_eq!(normalized, "http://example.com/baz?query#fragment");
Source

pub fn normalize_but_preserve_authorityless_relative_path( &self, ) -> Normalized<'_, RiStr<S>>

Returns the normalized IRI, but preserving dot segments in relative path if the authority component is absent.

This normalization would be similar to that of WHATWG URL Standard while this implementation is not guaranteed to stricly follow the spec.

Note that this normalization algorithm is not compatible with RFC 3986 algorithm for some inputs.

Note that case normalization and percent-encoding normalization will still be applied to any path.

§Examples
use iri_string::format::ToDedicatedString;
use iri_string::types::IriStr;

let iri = IriStr::new("HTTP://example.COM/foo/./bar/%2e%2e/../baz?query#fragment")?;

let normalized = iri
    .normalize_but_preserve_authorityless_relative_path()
    .to_dedicated_string();
assert_eq!(normalized, "http://example.com/baz?query#fragment");
use iri_string::format::ToDedicatedString;
use iri_string::types::IriStr;

let iri = IriStr::new("scheme:relative/../f%6f%6f")?;

let normalized = iri
    .normalize_but_preserve_authorityless_relative_path()
    .to_dedicated_string();
assert_eq!(normalized, "scheme:relative/../foo");
// `.normalize()` would normalize this to `scheme:/foo`.
Source

pub fn mask_password(&self) -> PasswordMasked<'_, RiStr<S>>

Returns the proxy to the IRI with password masking feature.

§Examples
use iri_string::format::ToDedicatedString;
use iri_string::types::IriStr;

let iri = IriStr::new("http://user:password@example.com/path?query")?;
let masked = iri.mask_password();
assert_eq!(masked.to_dedicated_string(), "http://user:@example.com/path?query");

assert_eq!(
    masked.replace_password("${password}").to_string(),
    "http://user:${password}@example.com/path?query"
);
Source

pub fn scheme_str(&self) -> &str

Returns the scheme.

The following colon is truncated.

§Examples
use iri_string::types::IriStr;

let iri = IriStr::new("http://example.com/pathpath?queryquery#fragfrag")?;
assert_eq!(iri.scheme_str(), "http");
Source

pub fn authority_str(&self) -> Option<&str>

Returns the authority.

The leading // is truncated.

§Examples
use iri_string::types::IriStr;

let iri = IriStr::new("http://example.com/pathpath?queryquery#fragfrag")?;
assert_eq!(iri.authority_str(), Some("example.com"));
use iri_string::types::IriStr;

let iri = IriStr::new("urn:uuid:10db315b-fcd1-4428-aca8-15babc9a2da2")?;
assert_eq!(iri.authority_str(), None);
Source

pub fn path_str(&self) -> &str

Returns the path.

§Examples
use iri_string::types::IriStr;

let iri = IriStr::new("http://example.com/pathpath?queryquery#fragfrag")?;
assert_eq!(iri.path_str(), "/pathpath");
use iri_string::types::IriStr;

let iri = IriStr::new("urn:uuid:10db315b-fcd1-4428-aca8-15babc9a2da2")?;
assert_eq!(iri.path_str(), "uuid:10db315b-fcd1-4428-aca8-15babc9a2da2");
Source

pub fn query(&self) -> Option<&RiQueryStr<S>>

Returns the query.

The leading question mark (?) is truncated.

§Examples
use iri_string::types::{IriQueryStr, IriStr};

let iri = IriStr::new("http://example.com/pathpath?queryquery#fragfrag")?;
let query = IriQueryStr::new("queryquery")?;
assert_eq!(iri.query(), Some(query));
use iri_string::types::IriStr;

let iri = IriStr::new("urn:uuid:10db315b-fcd1-4428-aca8-15babc9a2da2")?;
assert_eq!(iri.query(), None);
Source

pub fn query_str(&self) -> Option<&str>

Returns the query in a raw string slice.

The leading question mark (?) is truncated.

§Examples
use iri_string::types::IriStr;

let iri = IriStr::new("http://example.com/pathpath?queryquery#fragfrag")?;
assert_eq!(iri.query_str(), Some("queryquery"));
use iri_string::types::IriStr;

let iri = IriStr::new("urn:uuid:10db315b-fcd1-4428-aca8-15babc9a2da2")?;
assert_eq!(iri.query_str(), None);
Source

pub fn fragment(&self) -> Option<&RiFragmentStr<S>>

Returns the fragment part if exists.

A leading # character is truncated if the fragment part exists.

§Examples
let iri = IriStr::new("foo://bar/baz?qux=quux#corge")?;
let fragment = IriFragmentStr::new("corge")?;
assert_eq!(iri.fragment(), Some(fragment));
let iri = IriStr::new("foo://bar/baz?qux=quux#")?;
let fragment = IriFragmentStr::new("")?;
assert_eq!(iri.fragment(), Some(fragment));
let iri = IriStr::new("foo://bar/baz?qux=quux")?;
assert_eq!(iri.fragment(), None);
Source

pub fn fragment_str(&self) -> Option<&str>

Returns the fragment part as a raw string slice if exists.

A leading # character is truncated if the fragment part exists.

§Examples
let iri = IriStr::new("foo://bar/baz?qux=quux#corge")?;
assert_eq!(iri.fragment_str(), Some("corge"));
let iri = IriStr::new("foo://bar/baz?qux=quux#")?;
assert_eq!(iri.fragment_str(), Some(""));
let iri = IriStr::new("foo://bar/baz?qux=quux")?;
assert_eq!(iri.fragment_str(), None);
Source

pub fn authority_components(&self) -> Option<AuthorityComponents<'_>>

Returns the authority components.

§Examples
use iri_string::types::IriStr;

let iri = IriStr::new("http://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::IriStr;

let iri = IriStr::new("urn:uuid:10db315b-fcd1-4428-aca8-15babc9a2da2")?;
assert_eq!(iri.authority_str(), None);
Source

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

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::{IriStr, UriString};

let iri = IriStr::new("http://example.com/?alpha=\u{03B1}")?;
// Type annotation here is not necessary.
let uri: UriString = iri.encode_to_uri().to_dedicated_string();
assert_eq!(uri, "http://example.com/?alpha=%CE%B1");
Source

pub fn as_uri(&self) -> Option<&RiStr<UriSpec>>

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

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

§Examples
use iri_string::types::{IriStr, UriStr};

let ascii_iri = IriStr::new("http://example.com/?alpha=%CE%B1")?;
assert_eq!(
    ascii_iri.as_uri().map(AsRef::as_ref),
    Some("http://example.com/?alpha=%CE%B1")
);

let nonascii_iri = IriStr::new("http://example.com/?alpha=\u{03B1}")?;
assert_eq!(nonascii_iri.as_uri(), None);

Trait Implementations§

Source§

impl AsRef<RiReferenceStr<UriSpec>> for HttpUri

Source§

fn as_ref(&self) -> &UriReferenceStr

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

impl AsRef<RiStr<UriSpec>> for HttpUri

Source§

fn as_ref(&self) -> &UriStr

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

impl AsRef<str> for HttpUri

Source§

fn as_ref(&self) -> &str

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

impl Clone for HttpUri

Source§

fn clone(&self) -> HttpUri

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for HttpUri

Source§

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

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

impl Deref for HttpUri

Source§

type Target = RiStr<UriSpec>

The resulting type after dereferencing.
Source§

fn deref(&self) -> &Self::Target

Dereferences the value.
Source§

impl<'de> Deserialize<'de> for HttpUri

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 Display for HttpUri

Source§

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

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

impl From<&HttpUri> for Iri<Arc<str>>

Available on crate feature sophia only.
Source§

fn from(value: &HttpUri) -> Self

Converts to this type from the input type.
Source§

impl From<&HttpUri> for Iri<String>

Available on crate feature sophia only.
Source§

fn from(value: &HttpUri) -> Self

Converts to this type from the input type.
Source§

impl From<HttpUri> for UriString

Source§

fn from(val: HttpUri) -> Self

Converts to this type from the input type.
Source§

impl FromStr for HttpUri

Source§

type Err = InvalidHttpUri

The associated error which can be returned from parsing.
Source§

fn from_str(s: &str) -> Result<Self, Self::Err>

Parses a string s to return a value of this type. Read more
Source§

impl Hash for HttpUri

Source§

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

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl PartialEq for HttpUri

Source§

fn eq(&self, other: &HttpUri) -> 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 Predicate<HttpUri> for HasNoQuery

Source§

fn label() -> Cow<'static, str>

Label of the predicate.
Source§

impl Predicate<HttpUri> for IsAbsolute

Source§

fn label() -> Cow<'static, str>

Label of the predicate.
Source§

impl Predicate<HttpUri> for IsNormal

Source§

fn label() -> Cow<'static, str>

Label of the predicate.
Source§

impl Predicate<HttpUri> for PathHasTrailingSlash

Source§

fn label() -> Cow<'static, str>

Label of the predicate.
Source§

impl Serialize for HttpUri

Available on crate feature serde only.
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 SyncEvaluablePredicate<HttpUri> for HasNoQuery

Source§

type EvalError = HasInvalidQuery

Type of evaluation error.
Source§

fn evaluate_for(sub: &HttpUri) -> Result<(), Self::EvalError>

Evaluate the predicate for given subject.
Source§

impl SyncEvaluablePredicate<HttpUri> for IsAbsolute

Source§

type EvalError = NotAnAbsoluteHttpUri

Type of evaluation error.
Source§

fn evaluate_for(sub: &HttpUri) -> Result<(), Self::EvalError>

Evaluate the predicate for given subject.
Source§

impl SyncEvaluablePredicate<HttpUri> for IsNormal

Source§

type EvalError = NotANormalHttpUri

Type of evaluation error.
Source§

fn evaluate_for(sub: &HttpUri) -> Result<(), Self::EvalError>

Evaluate the predicate for given subject.
Source§

impl SyncEvaluablePredicate<HttpUri> for PathHasTrailingSlash

Source§

type EvalError = PathHasNoTrailingSlash

Type of evaluation error.
Source§

fn evaluate_for(sub: &HttpUri) -> Result<(), Self::EvalError>

Evaluate the predicate for given subject.
Source§

impl Term for HttpUri

Available on crate feature sophia only.
Source§

type BorrowTerm<'x> = &'x HttpUri

A type of Term that can be borrowed from this type (i.e. that can be obtained from a simple reference to this type). It is used in particular for accessing constituents of quoted tripes (Term::triple) or for sharing this term with a function that expects T: Term (rather than &T) using Term::borrow_term. Read more
Source§

fn kind(&self) -> TermKind

Return the kind of RDF term that this Term represents.
Source§

fn borrow_term(&self) -> Self::BorrowTerm<'_>

Get something implementing Term from a simple reference to self, representing the same RDF term as self. Read more
Source§

fn iri(&self) -> Option<IriRef<MownStr<'_>>>

If kind returns TermKind::Iri, return this IRI. Otherwise return None. Read more
Source§

fn is_iri(&self) -> bool

Return true if this Term is an IRI, i.e. if kind retuns TermKind::Iri.
Source§

fn is_blank_node(&self) -> bool

Return true if this Term is a blank node, i.e. if kind retuns TermKind::BlankNode.
Source§

fn is_literal(&self) -> bool

Return true if this Term is a literal, i.e. if kind retuns TermKind::Literal.
Source§

fn is_variable(&self) -> bool

Return true if this Term is a variable, i.e. if kind retuns TermKind::Variable.
Source§

fn is_atom(&self) -> bool

Return true if this Term is an atomic term, i.e. an IRI, a blank node, a literal or a variable.
Source§

fn is_triple(&self) -> bool

Return true if this Term is an RDF-star quoted triple, i.e. if kind retuns TermKind::Triple.
Source§

fn bnode_id(&self) -> Option<BnodeId<MownStr<'_>>>

If kind returns TermKind::BlankNode, return the locally unique label of this blank node. Otherwise return None. Read more
Source§

fn lexical_form(&self) -> Option<MownStr<'_>>

If kind returns TermKind::Literal, return the lexical form of this literal. Otherwise return None. Read more
Source§

fn datatype(&self) -> Option<IriRef<MownStr<'_>>>

If kind returns TermKind::Literal, return the datatype IRI of this literal. Otherwise return None. Read more
Source§

fn language_tag(&self) -> Option<LanguageTag<MownStr<'_>>>

If kind returns TermKind::Literal, and if this literal is a language-tagged string, return its language tag. Otherwise return None. Read more
Source§

fn variable(&self) -> Option<VarName<MownStr<'_>>>

If kind returns TermKind::Variable, return the name of this variable. Otherwise return None. Read more
Source§

fn triple(&self) -> Option<[Self::BorrowTerm<'_>; 3]>

If kind returns TermKind::Triple, return this triple. Otherwise return None. Read more
Source§

fn to_triple(self) -> Option<[Self; 3]>
where Self: Sized,

If kind returns TermKind::Triple, return this triple, consuming this term. Otherwise return None. Read more
Source§

fn constituents<'s>( &'s self, ) -> Box<dyn Iterator<Item = Self::BorrowTerm<'s>> + 's>

Iter over all the constituents of this term. Read more
Source§

fn to_constituents<'a>(self) -> Box<dyn Iterator<Item = Self> + 'a>
where Self: Clone + 'a,

Iter over all the constiutents of this term, consuming it. Read more
Source§

fn atoms<'s>(&'s self) -> Box<dyn Iterator<Item = Self::BorrowTerm<'s>> + 's>

Iter over all the atomic constituents of this term. Read more
Source§

fn to_atoms<'a>(self) -> Box<dyn Iterator<Item = Self> + 'a>
where Self: Sized + 'a,

Iter over all the atomic constituents of this term, consuming it. Read more
Source§

fn eq<T>(&self, other: T) -> bool
where T: Term,

Check whether self and other represent the same RDF term.
Source§

fn cmp<T>(&self, other: T) -> Ordering
where T: Term,

Compare two terms: Read more
Source§

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

Compute an implementation-independant hash of this RDF term.
Source§

fn into_term<T>(self) -> T
where T: FromTerm, Self: Sized,

Convert this term in another type. Read more
Source§

fn try_into_term<T>(self) -> Result<T, <T as TryFromTerm>::Error>
where T: TryFromTerm, Self: Sized,

Try to convert this term into another type. Read more
Source§

fn as_simple(&self) -> SimpleTerm<'_>

Copies this term into a SimpleTerm, borrowing as much as possible from self (calling SimpleTerm::from_term_ref).
Source§

impl TryFrom<&RiStr<UriSpec>> for HttpUri

Source§

type Error = InvalidHttpUri

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

fn try_from(uri: &UriStr) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<&str> for HttpUri

Source§

type Error = InvalidHttpUri

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

fn try_from(uri_str: &str) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl<SP: Predicate<HttpUri>> AuthorizedInferenceRuleGhost<IsNormal, HttpUri> for PhantomData<Normalization<SP>>

Source§

impl Eq for HttpUri

Source§

impl PreservingTransformGhost<IsAbsolute, HttpUri> for PhantomData<NormalizationTransform>

Source§

impl PurePredicate<HttpUri> for HasNoQuery

Source§

impl PurePredicate<HttpUri> for IsAbsolute

Source§

impl PurePredicate<HttpUri> for IsNormal

Source§

impl PurePredicate<HttpUri> for PathHasTrailingSlash

Source§

impl StructuralPartialEq for HttpUri

Auto Trait Implementations§

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<Choices> CoproductSubsetter<CNil, HNil> for Choices

Source§

type Remainder = Choices

Source§

fn subset( self, ) -> Result<CNil, <Choices as CoproductSubsetter<CNil, HNil>>::Remainder>

Extract a subset of the possible types in a coproduct (or get the remaining possibilities) Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T, U, I> LiftInto<U, I> for T
where U: LiftFrom<T, I>,

Source§

fn lift_into(self) -> U

Performs the indexed conversion.
Source§

impl<P, T> Receiver for P
where P: Deref<Target = T> + ?Sized, T: ?Sized,

Source§

type Target = T

🔬This is a nightly-only experimental API. (arbitrary_self_types)
The target type on which the method may be called.
Source§

impl<Source> Sculptor<HNil, HNil> for Source

Source§

type Remainder = Source

Source§

fn sculpt(self) -> (HNil, <Source as Sculptor<HNil, HNil>>::Remainder)

Consumes the current HList and returns an HList with the requested shape. Read more
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

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

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

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T> ToStringFallible for T
where T: Display,

Source§

fn try_to_string(&self) -> Result<String, TryReserveError>

ToString::to_string, but without panic on OOM.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

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

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<S, P> TryProven<P> for S

Source§

type Err = ProvenError<S, <P as SyncEvaluablePredicate<S>>::EvalError>

Type of error.
Source§

fn try_proven(self) -> Result<Proven<S, P>, <S as TryProven<P>>::Err>

A trait for subjects, to try to create proven propositions with evaluating predicate..
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,