#[non_exhaustive]pub struct EndpointUri {
pub scheme: String,
pub path: String,
pub params: BTreeMap<String, String>,
/* private fields */
}Expand description
A parsed route endpoint URI: a scheme, a path, and a parameter map, plus the original query bytes for byte-preserving rendering.
The private raw_query field stores the base URI’s query exactly as it appeared (without
the leading ?), or None when the base URI had no query. to_canonical_string replays
those bytes verbatim and then appends the parameters: entries in sorted order, so
rendering is deterministic and never rewrites the caller’s original query.
ADR-0051 credential boundary: redacting-wrapper
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.scheme: StringURI scheme: the non-empty substring before the first :.
path: StringURI path: everything after the first : up to the first ?.
params: BTreeMap<String, String>DSL parameters: map, keyed by parameter name, rendered in sorted order.
Implementations§
Source§impl EndpointUri
impl EndpointUri
Sourcepub fn try_from_uri_and_params(
base: &str,
params: BTreeMap<String, String>,
) -> Result<Self, EndpointUriError>
pub fn try_from_uri_and_params( base: &str, params: BTreeMap<String, String>, ) -> Result<Self, EndpointUriError>
Merge a base URI with a parameters: map, failing closed on malformed input.
The base URI must have a non-empty scheme. Query pairs in the base URI are parsed only
to detect empty keys and to reject parameters: keys that collide with a raw query key;
the query text itself is preserved byte-for-byte for rendering.
Sourcepub fn to_canonical_string(&self) -> String
pub fn to_canonical_string(&self) -> String
Render the endpoint URI deterministically: scheme:path, then the raw query
byte-for-byte (if any), then the parameter entries in BTreeMap sorted order.
Sourcepub fn to_redacted_string(
&self,
catalog: &dyn ComponentMetadataCatalog,
) -> String
pub fn to_redacted_string( &self, catalog: &dyn ComponentMetadataCatalog, ) -> String
Render the endpoint URI with every option value resolved against catalog
and masked as *** unless the catalog affirmatively resolves the key to a
non-secret UriOption.
The option set is built from BOTH the raw query pairs and the params map,
in the same rendering order and encoding as Self::to_canonical_string:
raw query values are replayed verbatim (after redaction) while params
values are percent-encoded. Fails safe: an unregistered scheme, an
unresolved key, and a secret option all render as ***.
Trait Implementations§
Source§impl Clone for EndpointUri
impl Clone for EndpointUri
Source§fn clone(&self) -> EndpointUri
fn clone(&self) -> EndpointUri
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more