pub struct Uri { /* private fields */ }Expand description
A validated URI that cannot contain sensitive credentials or a fragment.
§Examples
use qubit_fs::path::Uri;
let uri = Uri::parse("file:///tmp/report.txt")?;
assert_eq!("file", uri.scheme());Implementations§
Source§impl Uri
impl Uri
Sourcepub fn parse(text: &str) -> FsResult<Self>
pub fn parse(text: &str) -> FsResult<Self>
Parses a secret-free RFC 3986 URI.
Returns an invalid-URI error for malformed syntax, fragments, or URI components classified as sensitive by the fixed standard policy.
§Parameters
text: URI text to parse.policy: Redaction policy used to reject sensitive components.
§Errors
Returns an invalid-URI error for malformed syntax, fragments, or
sensitive components rejected by policy.
Sourcepub fn parse_with_policy(text: &str, policy: &RedactionPolicy) -> FsResult<Self>
pub fn parse_with_policy(text: &str, policy: &RedactionPolicy) -> FsResult<Self>
Parses a secret-free URI using an explicit redaction policy snapshot.
§Parameters
text- URI text to parse and canonicalize.policy- Policy used to classify sensitive URI components.
The standard policy is always applied as a non-removable safety floor; an explicit policy can only add classifications. Provider-specific credentials that are not recognized by either policy remain the provider’s responsibility to remove before constructing a URI.
Returns the raw RFC 3986 authority when it is syntactically present.
Returns whether an authority delimiter was present, including empty authority.