pub struct Uri(/* private fields */);Expand description
Newtype struct around fluent_uri::Uri<String> with serialization implementations that use as_str() and ‘from_str()’ respectively.
Methods from Deref<Target = Uri<String>>§
Returns the authority component.
Sourcepub fn is_relative(&self) -> bool
pub fn is_relative(&self) -> bool
Returns true if the URI reference is relative, i.e., without a scheme.
Note that this method is not the opposite of is_absolute.
§Examples
use fluent_uri::Uri;
let uri = Uri::parse("/path/to/file")?;
assert!(uri.is_relative());
let uri = Uri::parse("http://example.com/")?;
assert!(!uri.is_relative());Sourcepub fn is_absolute(&self) -> bool
pub fn is_absolute(&self) -> bool
Returns true if the URI reference is absolute, i.e., with a scheme and without a fragment.
Note that this method is not the opposite of is_relative.
§Examples
use fluent_uri::Uri;
let uri = Uri::parse("http://example.com/")?;
assert!(uri.is_absolute());
let uri = Uri::parse("http://example.com/#title1")?;
assert!(!uri.is_absolute());
let uri = Uri::parse("/path/to/file")?;
assert!(!uri.is_absolute());Trait Implementations§
Source§impl<'de> Deserialize<'de> for Uri
impl<'de> Deserialize<'de> for Uri
Source§fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Ord for Uri
impl Ord for Uri
Source§impl PartialOrd for Uri
impl PartialOrd for Uri
impl Eq for Uri
Auto Trait Implementations§
impl !Freeze for Uri
impl !RefUnwindSafe for Uri
impl Send for Uri
impl Sync for Uri
impl Unpin for Uri
impl UnwindSafe for Uri
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