pub struct InternalUrl {
pub path: String,
pub metadata: InternalUrlMetadata,
pub host: Option<String>,
pub query: Option<UrlQuery>,
pub fragment: Option<String>,
/* private fields */
}Expand description
An internal URL.
The URL scheme is “internal:”, followed by a custom path representation.
The URL::base and URL::relative functions are supported in two modes. When slashable is true, they will interpret the path as a Unix-style filesystem path, whereby the path separator is “/”, and “.” and “..” are supported for path traversal. When slashable is false, URL::relative does simple string concatenation, and you must explicitly register a base_path if you want to support URL::base.
URL::conform is critical for internal URLs: it makes sure to fill in metadata from the registry.
If your use case is testing, it could be that MockUrl would be easier to use, as it is not owned by UrlContext and can mock any scheme.
Fields§
§path: StringThe path.
metadata: InternalUrlMetadataMetadata.
host: Option<String>The optional host (for representation purposes only).
query: Option<UrlQuery>The optional query.
fragment: Option<String>The optional fragment.
Implementations§
Trait Implementations§
Source§impl Clone for InternalUrl
impl Clone for InternalUrl
Source§fn clone(&self) -> InternalUrl
fn clone(&self) -> InternalUrl
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for InternalUrl
impl Debug for InternalUrl
Source§impl Display for InternalUrl
impl Display for InternalUrl
Source§impl URL for InternalUrl
impl URL for InternalUrl
Source§fn context(&self) -> &UrlContext
fn context(&self) -> &UrlContext
Source§fn format(&self) -> Option<String>
fn format(&self) -> Option<String>
Source§fn base(&self) -> Option<UrlRef>
fn base(&self) -> Option<UrlRef>
Source§fn conform(&mut self) -> Result<(), UrlError>
fn conform(&mut self) -> Result<(), UrlError>
blocking only.Source§fn conform_async(&self) -> Result<ConformFuture, UrlError>
fn conform_async(&self) -> Result<ConformFuture, UrlError>
async only.Source§fn open_async(&self) -> Result<OpenFuture, UrlError>
fn open_async(&self) -> Result<OpenFuture, UrlError>
async only.Auto Trait Implementations§
impl Freeze for InternalUrl
impl !RefUnwindSafe for InternalUrl
impl Send for InternalUrl
impl Sync for InternalUrl
impl Unpin for InternalUrl
impl !UnwindSafe for InternalUrl
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
Source§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string, but without panic on OOM.