pub enum SourceResourceLocatorV1 {
Embedded,
DataUri,
Relative(SourceRelativeLocatorV1),
Absolute,
Escaping,
Remote,
Malformed,
Oversized,
Missing,
}Expand description
Redacted classification of one resource locator declaration.
Variants§
Embedded
Payload is embedded in the primary container/buffer.
DataUri
Payload is carried by a data URI; payload/spelling is not retained.
Relative(SourceRelativeLocatorV1)
Bounded exact relative spelling, not normalized or deduplicated.
Absolute
Absolute locator; spelling is redacted.
Escaping
Escaping/traversal locator; spelling is redacted.
Remote
Remote locator; spelling is redacted.
Malformed
Malformed locator; spelling is redacted.
Oversized
Oversized locator; spelling is redacted.
Missing
Declaration has no locator.
Implementations§
Source§impl SourceResourceLocatorV1
impl SourceResourceLocatorV1
Sourcepub fn classify(value: &str) -> Self
pub fn classify(value: &str) -> Self
Classify a resource spelling while redacting unsafe or oversized input.
This is lexical classification only. It deliberately does not normalize, deduplicate, open, or assign resource identity; #475 owns those dependency-closure operations.
Sourcepub fn retained_relative_bytes(value: &str) -> usize
pub fn retained_relative_bytes(value: &str) -> usize
Exact UTF-8 bytes Self::classify would retain, without allocating.
Loaders use this to reserve aggregate text capacity before constructing a safe-relative locator. Redacted classifications return zero.
Trait Implementations§
Source§impl Clone for SourceResourceLocatorV1
impl Clone for SourceResourceLocatorV1
Source§fn clone(&self) -> SourceResourceLocatorV1
fn clone(&self) -> SourceResourceLocatorV1
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more