pub struct DependencyResourceKeyV1(/* private fields */);Expand description
Safe, normalized, source-relative dependency key.
Implementations§
Source§impl DependencyResourceKeyV1
impl DependencyResourceKeyV1
Sourcepub fn from_relative(
locator: &SourceRelativeLocatorV1,
syntax: ResourceKeySyntaxV1,
) -> Result<Self, DependencyClosureError>
pub fn from_relative( locator: &SourceRelativeLocatorV1, syntax: ResourceKeySyntaxV1, ) -> Result<Self, DependencyClosureError>
Normalize one already-redacted relative locator without host I/O.
§Errors
Returns DependencyClosureError for invalid percent encoding,
unsafe path syntax, too many components, or an oversized normalized key.
Sourcepub fn from_source_str(
raw: &str,
syntax: ResourceKeySyntaxV1,
) -> Result<Self, DependencyClosureError>
pub fn from_source_str( raw: &str, syntax: ResourceKeySyntaxV1, ) -> Result<Self, DependencyClosureError>
Normalize one raw source spelling while enforcing the same fail-closed
contract as Self::from_relative.
Format loaders normally call Self::from_relative after raw-source
classification. This constructor is also useful for bounded preflight
tests and custom loaders that do not retain a raw-facts row first.
§Errors
Returns DependencyClosureError for an unsafe or oversized key.
Sourcepub fn source_component_count(locator: &SourceRelativeLocatorV1) -> usize
pub fn source_component_count(locator: &SourceRelativeLocatorV1) -> usize
Number of source path components, without allocation.
Trait Implementations§
Source§impl Clone for DependencyResourceKeyV1
impl Clone for DependencyResourceKeyV1
Source§fn clone(&self) -> DependencyResourceKeyV1
fn clone(&self) -> DependencyResourceKeyV1
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for DependencyResourceKeyV1
impl Debug for DependencyResourceKeyV1
Source§impl<'de> Deserialize<'de> for DependencyResourceKeyV1
impl<'de> Deserialize<'de> for DependencyResourceKeyV1
Source§fn 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
impl Eq for DependencyResourceKeyV1
Source§impl Hash for DependencyResourceKeyV1
impl Hash for DependencyResourceKeyV1
Source§impl Ord for DependencyResourceKeyV1
impl Ord for DependencyResourceKeyV1
Source§fn cmp(&self, other: &DependencyResourceKeyV1) -> Ordering
fn cmp(&self, other: &DependencyResourceKeyV1) -> Ordering
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialEq for DependencyResourceKeyV1
impl PartialEq for DependencyResourceKeyV1
Source§impl PartialOrd for DependencyResourceKeyV1
impl PartialOrd for DependencyResourceKeyV1
Source§impl Serialize for DependencyResourceKeyV1
impl Serialize for DependencyResourceKeyV1
impl StructuralPartialEq for DependencyResourceKeyV1
Auto Trait Implementations§
impl Freeze for DependencyResourceKeyV1
impl RefUnwindSafe for DependencyResourceKeyV1
impl Send for DependencyResourceKeyV1
impl Sync for DependencyResourceKeyV1
impl Unpin for DependencyResourceKeyV1
impl UnsafeUnpin for DependencyResourceKeyV1
impl UnwindSafe for DependencyResourceKeyV1
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more