pub trait Cri: CriBase {
fn scheme(&self) -> Self::Scheme<'_>;
fn authority(&self) -> Authority;
fn format_uri(&self, w: &mut impl Write) -> Result { ... }
fn render_uri(&self) -> String { ... }
fn resolve<R: CriRef>(&self, reference: R) -> RuntimeResolved<'_, Self, R> { ... }
fn equals(&self, other: &impl Cri) -> bool { ... }
}Expand description
A Cri (a full one, not a CRI reference)
Unlike a CriRef, this has a scheme unconditionally, and no applicable value for discard.
Required Methods
The scheme of the CRI
This is always present in a (full) CRI.
The type of authority of the CRI
There is always a value for this in a (full) CRI, although some variants indicate that actually there is no authority is present.
Provided Methods
fn format_uri(&self, w: &mut impl Write) -> Result
fn format_uri(&self, w: &mut impl Write) -> Result
Write the corresponding URI into a writer
fn render_uri(&self) -> String
fn render_uri(&self) -> String
Write the corresponding URI into a string
fn resolve<R: CriRef>(&self, reference: R) -> RuntimeResolved<'_, Self, R>
fn resolve<R: CriRef>(&self, reference: R) -> RuntimeResolved<'_, Self, R>
Resolve a reference against this base
This produces a runtime resolution – containing just the pointers, and determining any attributes at runtime.
Concrete types might get more optimized versions of this; in particular, some might modify a base in place when following a link.
Compare for equality
This returns true if two CRIs are sure to be equal in the CRI normalization model, and is equivalent to URI equality after syntax based normalization. No scheme based normalization is performed. It relies on some of the CRI well-formedness requirements to be met (no PET on characters that don’t need it, no initial empty path segments on NoAuthoritySlashless URNs).