pub struct ConnectionUri { /* private fields */ }Expand description
A connection URI whose normal formatting always redacts credentials.
The standard redaction policy is an unavoidable safety floor. An explicit policy may classify additional provider-specific fields, but cannot make a standard sensitive component safe. Providers remain responsible for clearing credentials that neither policy recognizes.
§Examples
use qubit_fs::path::ConnectionUri;
let uri = ConnectionUri::parse("s3://reports-bucket/daily.csv")?;
assert_eq!("s3", uri.scheme());Implementations§
Source§impl ConnectionUri
impl ConnectionUri
Sourcepub fn parse(text: &str) -> FsResult<Self>
pub fn parse(text: &str) -> FsResult<Self>
Parses a connection URI with optional credentials but no fragment.
Returns an invalid-URI error for malformed syntax or a fragment.
§Parameters
text: Connection URI text to parse.policy: Redaction policy used when producing redacted views.
§Errors
Returns an invalid-URI error for malformed syntax or a fragment.
Sourcepub fn parse_with_policy(text: &str, policy: &RedactionPolicy) -> FsResult<Self>
pub fn parse_with_policy(text: &str, policy: &RedactionPolicy) -> FsResult<Self>
Parses a connection URI using an explicit redaction policy snapshot.
§Parameters
text- URI text to parse and canonicalize.policy- Policy captured for later secret classification and formatting.
Sourcepub fn scheme(&self) -> &str
pub fn scheme(&self) -> &str
Returns the normalized URI scheme without exposing credential-bearing components.
Sourcepub fn has_embedded_secret(&self) -> bool
pub fn has_embedded_secret(&self) -> bool
Returns whether the URI contains any component classified as sensitive by the standard floor or the policy snapshot captured during parsing.
Username-only userinfo is not considered a secret because it can be paired with an external credential reference. Classification uses metadata-only inspection, so the diagnostic output budget cannot hide a late sensitive component. Invalid inspection, including an exceeded input budget or invalid encoded component, is treated conservatively as secret-bearing.
§Returns
false only after inspection passes through without a sensitive
component; true after redaction or any invalid inspection result.
Sourcepub fn try_to_uri(&self) -> FsResult<Uri>
pub fn try_to_uri(&self) -> FsResult<Uri>
Sourcepub fn expose_unredacted<R>(&self, inspect: impl FnOnce(&str) -> R) -> R
pub fn expose_unredacted<R>(&self, inspect: impl FnOnce(&str) -> R) -> R
Gives inspect ephemeral access to the unredacted URI text.
The callback result is returned unchanged; callers must not use it to expose secret data through ordinary formatting or serialization.