pub struct Https { /* private fields */ }
Expand description
A simple HTTPS URI.
This is only a slim wrapper around a Bytes
value ensuring that the
scheme is "https"
.
Implementations§
source§impl Https
impl Https
pub fn from_string(s: String) -> Result<Self, Error>
pub fn from_slice(slice: &[u8]) -> Result<Self, Error>
pub fn from_bytes(bytes: Bytes) -> Result<Self, Error>
Moves the URI to its own memory.
Values use shared memory in order to allow cheap copying which may result in large allocations being kept around longer than necessary. This method moves the URI to a new memory location allowing the previous location to potentially be freed.
pub fn scheme(&self) -> Scheme
Returns the URI’s authority part as a string slice.
Returns a canonical version of authority part.
Since host names are case-insensitive, the authority part can be provided in different ways. This returns a version of the authority with all ASCII letters in lowercase.
pub fn encode_general_name(&self) -> impl Values + '_
sourcepub fn path(&self) -> &str
pub fn path(&self) -> &str
Returns the URI’s path as a string slice.
The path does not start with a slash. As a consequence, an empty path results in an empty string.
sourcepub fn join(&self, path: &[u8]) -> Result<Self, Error>
pub fn join(&self, path: &[u8]) -> Result<Self, Error>
This function will join this URI and the given path. If the current URI does not end with a trailing ‘/’, it will be injected.
sourcepub fn parent(&self) -> Option<Self>
pub fn parent(&self) -> Option<Self>
Returns the parent URI.
The parent URI is the URI with the last path segment removed. If a
URI has no path segment, the method returns None
. If a URI is
returned, it’s path will have a trailing slash to indicate that it
is a directory.
Keep in mind that a URI with an empty path will still have the module name after the authority part. The method will never return a URI with an empty module name.
Returns whether the two URIs have the same authority.
Trait Implementations§
source§impl<'a> Arbitrary<'a> for Https
impl<'a> Arbitrary<'a> for Https
source§fn arbitrary(u: &mut Unstructured<'_>) -> Result<Self>
fn arbitrary(u: &mut Unstructured<'_>) -> Result<Self>
Self
from the given unstructured data. Read moresource§fn arbitrary_take_rest(u: Unstructured<'a>) -> Result<Self, Error>
fn arbitrary_take_rest(u: Unstructured<'a>) -> Result<Self, Error>
Self
from the entirety of the given
unstructured data. Read moresource§impl<'de> Deserialize<'de> for Https
impl<'de> Deserialize<'de> for Https
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>,
source§impl PartialEq for Https
impl PartialEq for Https
source§impl<'a> PrimitiveContent for &'a Https
impl<'a> PrimitiveContent for &'a Https
source§fn encoded_len(&self, _: Mode) -> usize
fn encoded_len(&self, _: Mode) -> usize
source§fn write_encoded<W: Write>(
&self,
_mode: Mode,
target: &mut W,
) -> Result<(), Error>
fn write_encoded<W: Write>( &self, _mode: Mode, target: &mut W, ) -> Result<(), Error>
source§fn to_encoded_bytes(&self, mode: Mode) -> Bytes
fn to_encoded_bytes(&self, mode: Mode) -> Bytes
source§fn encode(self) -> Primitive<Self>
fn encode(self) -> Primitive<Self>
source§fn encode_as(self, tag: Tag) -> Primitive<Self>
fn encode_as(self, tag: Tag) -> Primitive<Self>
source§fn encode_ref(&self) -> Primitive<&Self>
fn encode_ref(&self) -> Primitive<&Self>
impl Eq for Https
Auto Trait Implementations§
impl !Freeze for Https
impl RefUnwindSafe for Https
impl Send for Https
impl Sync for Https
impl Unpin for Https
impl UnwindSafe for Https
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> Text for Twhere
T: Display,
impl<T> Text for Twhere
T: Display,
source§fn write_escaped(
&self,
mode: TextEscape,
target: &mut impl Write,
) -> Result<(), Error>
fn write_escaped( &self, mode: TextEscape, target: &mut impl Write, ) -> Result<(), Error>
target
.