Skip to main content

Module uri

Module uri 

Available on crate feature http only.
Expand description

HTTP URI types — re-exported from the native rama_net::uri implementation.

rama_http_types::Uri IS rama_net::uri::Uri: a single, RFC-3986-complete URI type shared across the whole stack, replacing the previous http crate re-export.

Modules§

util
Preserved utility submodule (re-exports the percent_encoding crate).

Structs§

Fragment
Owned fragment component (the part after #, sans the # itself).
FragmentRef
Borrowed view of a URI fragment component (no leading #).
PathMatchOptions
Options controlling path prefix/suffix matching and stripping (PathRef::has_prefix_with_opts, super::PathMut::strip_prefix_with_opts, …).
PathMut
Mutable view of a Uri’s path component.
PathRef
Borrowed view of a URI path.
PathSegment
One segment in a URI path — the bytes between two / separators (or between a / and the end of the path).
PathSegments
Iterator over the segments of a URI path. Created by PathRef::segments.
Query
Owned query component. Cheaply mutable in-place via the QueryMut RAII guard.
QueryDeserializeError
Returned by QueryRef::deserialize / Query::deserialize when the query string cannot be converted into the target type — type mismatch, missing required field, malformed encoding, or an escaped value being fed into a non-owning &str field.
QueryDrain
Iterator yielding owned QueryPairs drained from a QueryMut. Created by QueryMut::drain.
QueryMut
Mutable view of a Uri’s query component.
QueryPair
One owned name[=value] pair, cheap to clone. Produced by QueryMut::pop and QueryMut::drain — popping a pair off a query doesn’t copy the byte content (the buffer is refcount-shared with the source).
QueryPairRef
Borrowed name[=value] pair view. Yielded by QueryRef::pairs / Query::pairs.
QueryPairs
Iterator over the name[=value] pairs of a URI query string. Created by QueryRef::pairs / Query::pairs.
QueryRef
Borrowed view of a URI query component (no leading ?).
Uri
First-class URI value.
UriRef
Borrowed snapshot of a Uri’s components.

Enums§

Component
Which URI component a ParseError or UriError refers to.
ParseError
Reasons parsing a byte string into a Uri can fail.
ResolveError
Errors from Uri::resolve / Uri::resolve_strict.
UriError
Reasons an operation on an already-parsed Uri can fail.
WireError
Error returned when a wire-form contract can’t be honoured.

Traits§

IntoUriComponent
Sealed marker — types accepted by URI component setters.
IntoUriInput
Marker trait for inputs accepted by Uri::parse and Uri::parse_strict.

Functions§

try_to_strip_path_prefix_from_uri
Strip prefix from the path of uri, returning a new Uri with the prefix removed (re-rooted at /). Matching is ASCII-case-insensitive on the raw path bytes, mirroring nested-router prefix stripping.