pub struct OxideUrl { /* private fields */ }Implementations§
Source§impl OxideUrl
impl OxideUrl
Sourcepub fn parse(input: &str) -> Result<Self, UrlError>
pub fn parse(input: &str) -> Result<Self, UrlError>
Parse a user-supplied URL string.
Bare hostnames like example.com/path are assumed HTTPS.
Relative paths (starting with / or .) are rejected — use
OxideUrl::join to resolve them against a base URL.
Sourcepub fn join(&self, reference: &str) -> Result<Self, UrlError>
pub fn join(&self, reference: &str) -> Result<Self, UrlError>
Resolve a possibly-relative reference against this URL as the base.
pub fn scheme(&self) -> &str
pub fn host_str(&self) -> Option<&str>
pub fn port(&self) -> Option<u16>
pub fn path(&self) -> &str
pub fn query(&self) -> Option<&str>
pub fn fragment(&self) -> Option<&str>
pub fn as_str(&self) -> &str
Sourcepub fn is_fetchable(&self) -> bool
pub fn is_fetchable(&self) -> bool
True for http/https URLs that can be fetched over the network.
Sourcepub fn is_local_file(&self) -> bool
pub fn is_local_file(&self) -> bool
True for file:// URLs.
Sourcepub fn is_internal(&self) -> bool
pub fn is_internal(&self) -> bool
True for oxide:// internal browser pages.
Sourcepub fn to_file_path(&self) -> Option<PathBuf>
pub fn to_file_path(&self) -> Option<PathBuf>
Extract the local filesystem path from a file:// URL.
pub fn set_fragment(&mut self, fragment: Option<&str>)
pub fn set_query(&mut self, query: Option<&str>)
pub fn query_pairs(&self) -> Vec<(String, String)>
Sourcepub fn origin_str(&self) -> String
pub fn origin_str(&self) -> String
Scheme + host + port serialized as a string (for same-origin checks).
Sourcepub fn same_origin(&self, other: &OxideUrl) -> bool
pub fn same_origin(&self, other: &OxideUrl) -> bool
Check whether two URLs share the same origin.
Trait Implementations§
impl Eq for OxideUrl
impl StructuralPartialEq for OxideUrl
Auto Trait Implementations§
impl Freeze for OxideUrl
impl RefUnwindSafe for OxideUrl
impl Send for OxideUrl
impl Sync for OxideUrl
impl Unpin for OxideUrl
impl UnsafeUnpin for OxideUrl
impl UnwindSafe for OxideUrl
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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.§impl<T> DowncastSync for T
impl<T> DowncastSync for T
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<S> FromSample<S> for S
impl<S> FromSample<S> for S
fn from_sample_(s: S) -> S
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more§impl<F, T> IntoSample<T> for Fwhere
T: FromSample<F>,
impl<F, T> IntoSample<T> for Fwhere
T: FromSample<F>,
fn into_sample(self) -> T
§impl<T> Pointable for T
impl<T> Pointable for T
§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
§impl<T, U> ToSample<U> for Twhere
U: FromSample<T>,
impl<T, U> ToSample<U> for Twhere
U: FromSample<T>,
fn to_sample_(self) -> U
§impl<T> ToSmolStr for T
impl<T> ToSmolStr for T
fn to_smolstr(&self) -> SmolStr
§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string, but without panic on OOM.