Skip to main content

ConnectionUri

Struct ConnectionUri 

Source
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

Source

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.

Source

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.
Source

pub fn scheme(&self) -> &str

Returns the normalized URI scheme without exposing credential-bearing components.

Source

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.

Source

pub fn try_to_uri(&self) -> FsResult<Uri>

Converts this connection URI to a secret-free resource URI.

§Errors

Returns an invalid-URI error when the connection URI contains sensitive components that cannot appear in Uri.

Source

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.

Trait Implementations§

Source§

impl Clone for ConnectionUri

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for ConnectionUri

Source§

fn fmt(&self, formatter: &mut Formatter<'_>) -> FmtResult

Formats only the redacted connection URI for diagnostics.

Source§

impl Display for ConnectionUri

Source§

fn fmt(&self, formatter: &mut Formatter<'_>) -> FmtResult

Formats only the redacted connection URI.

Source§

impl Eq for ConnectionUri

Source§

impl PartialEq for ConnectionUri

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for ConnectionUri

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.