Struct PathAndQuery
pub struct PathAndQuery {
pub(super) data: ByteStr,
pub(super) query: u16,
}
Expand description
Represents the path component of a URI
Fieldsยง
ยงdata: ByteStr
ยงquery: u16
Implementationsยง
ยงimpl PathAndQuery
impl PathAndQuery
pub fn from_static(src: &'static str) -> PathAndQuery
pub fn from_static(src: &'static str) -> PathAndQuery
Convert a PathAndQuery
from a static string.
This function will not perform any copying, however the string is checked to ensure that it is valid.
ยงPanics
This function panics if the argument is an invalid path and query.
ยงExamples
let v = PathAndQuery::from_static("/hello?world");
assert_eq!(v.path(), "/hello");
assert_eq!(v.query(), Some("world"));
Attempt to convert a Bytes
buffer to a PathAndQuery
.
This will try to prevent a copy if the type passed is the type used internally, and will copy the data if it is not.
pub fn path(&self) -> &str
pub fn path(&self) -> &str
Returns the path component
The path component is case sensitive.
abc://username:password@example.com:123/path/data?key=value&key2=value2#fragid1
|--------|
|
path
If the URI is *
then the path component is equal to *
.
ยงExamples
let path_and_query: PathAndQuery = "/hello/world".parse().unwrap();
assert_eq!(path_and_query.path(), "/hello/world");
pub fn query(&self) -> Option<&str>
pub fn query(&self) -> Option<&str>
Returns the query string component
The query component contains non-hierarchical data that, along with data in the path component, serves to identify a resource within the scope of the URIโs scheme and naming authority (if any). The query component is indicated by the first question mark (โ?โ) character and terminated by a number sign (โ#โ) character or by the end of the URI.
abc://username:password@example.com:123/path/data?key=value&key2=value2#fragid1
|-------------------|
|
query
ยงExamples
With a query string component
let path_and_query: PathAndQuery = "/hello/world?key=value&foo=bar".parse().unwrap();
assert_eq!(path_and_query.query(), Some("key=value&foo=bar"));
Without a query string component
let path_and_query: PathAndQuery = "/hello/world".parse().unwrap();
assert!(path_and_query.query().is_none());
pub fn as_str(&self) -> &str
pub fn as_str(&self) -> &str
Returns the path and query as a string component.
ยงExamples
With a query string component
let path_and_query: PathAndQuery = "/hello/world?key=value&foo=bar".parse().unwrap();
assert_eq!(path_and_query.as_str(), "/hello/world?key=value&foo=bar");
Without a query string component
let path_and_query: PathAndQuery = "/hello/world".parse().unwrap();
assert_eq!(path_and_query.as_str(), "/hello/world");
Trait Implementationsยง
ยงimpl Clone for PathAndQuery
impl Clone for PathAndQuery
ยงfn clone(&self) -> PathAndQuery
fn clone(&self) -> PathAndQuery
1.0.0 ยท Sourceยงfn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreยงimpl Debug for PathAndQuery
impl Debug for PathAndQuery
ยงimpl Display for PathAndQuery
impl Display for PathAndQuery
ยงimpl From<PathAndQuery> for Uri
Convert a PathAndQuery
into a Uri
.
impl From<PathAndQuery> for Uri
Convert a PathAndQuery
into a Uri
.
ยงfn from(path_and_query: PathAndQuery) -> Uri
fn from(path_and_query: PathAndQuery) -> Uri
ยงimpl FromStr for PathAndQuery
impl FromStr for PathAndQuery
ยงtype Err = InvalidUri
type Err = InvalidUri
ยงfn from_str(s: &str) -> Result<PathAndQuery, InvalidUri>
fn from_str(s: &str) -> Result<PathAndQuery, InvalidUri>
s
to return a value of this type. Read moreยงimpl Hash for PathAndQuery
impl Hash for PathAndQuery
ยงimpl<'a> PartialEq<&'a str> for PathAndQuery
impl<'a> PartialEq<&'a str> for PathAndQuery
ยงimpl<'a> PartialEq<PathAndQuery> for &'a str
impl<'a> PartialEq<PathAndQuery> for &'a str
ยงimpl PartialEq<PathAndQuery> for String
impl PartialEq<PathAndQuery> for String
ยงimpl PartialEq<PathAndQuery> for str
impl PartialEq<PathAndQuery> for str
ยงimpl PartialEq<String> for PathAndQuery
impl PartialEq<String> for PathAndQuery
ยงimpl PartialEq<str> for PathAndQuery
impl PartialEq<str> for PathAndQuery
ยงimpl PartialEq for PathAndQuery
impl PartialEq for PathAndQuery
ยงimpl<'a> PartialOrd<&'a str> for PathAndQuery
impl<'a> PartialOrd<&'a str> for PathAndQuery
ยงimpl<'a> PartialOrd<PathAndQuery> for &'a str
impl<'a> PartialOrd<PathAndQuery> for &'a str
ยงimpl PartialOrd<PathAndQuery> for String
impl PartialOrd<PathAndQuery> for String
ยงimpl PartialOrd<PathAndQuery> for str
impl PartialOrd<PathAndQuery> for str
ยงimpl PartialOrd<String> for PathAndQuery
impl PartialOrd<String> for PathAndQuery
ยงimpl PartialOrd<str> for PathAndQuery
impl PartialOrd<str> for PathAndQuery
ยงimpl PartialOrd for PathAndQuery
impl PartialOrd for PathAndQuery
ยงimpl<'a> TryFrom<&'a [u8]> for PathAndQuery
impl<'a> TryFrom<&'a [u8]> for PathAndQuery
ยงtype Error = InvalidUri
type Error = InvalidUri
ยงfn try_from(
s: &'a [u8],
) -> Result<PathAndQuery, <PathAndQuery as TryFrom<&'a [u8]>>::Error>
fn try_from( s: &'a [u8], ) -> Result<PathAndQuery, <PathAndQuery as TryFrom<&'a [u8]>>::Error>
ยงimpl TryFrom<&String> for PathAndQuery
impl TryFrom<&String> for PathAndQuery
ยงtype Error = InvalidUri
type Error = InvalidUri
ยงfn try_from(
s: &String,
) -> Result<PathAndQuery, <PathAndQuery as TryFrom<&String>>::Error>
fn try_from( s: &String, ) -> Result<PathAndQuery, <PathAndQuery as TryFrom<&String>>::Error>
ยงimpl<'a> TryFrom<&'a str> for PathAndQuery
impl<'a> TryFrom<&'a str> for PathAndQuery
ยงtype Error = InvalidUri
type Error = InvalidUri
ยงfn try_from(
s: &'a str,
) -> Result<PathAndQuery, <PathAndQuery as TryFrom<&'a str>>::Error>
fn try_from( s: &'a str, ) -> Result<PathAndQuery, <PathAndQuery as TryFrom<&'a str>>::Error>
ยงimpl TryFrom<String> for PathAndQuery
impl TryFrom<String> for PathAndQuery
ยงtype Error = InvalidUri
type Error = InvalidUri
ยงfn try_from(
s: String,
) -> Result<PathAndQuery, <PathAndQuery as TryFrom<String>>::Error>
fn try_from( s: String, ) -> Result<PathAndQuery, <PathAndQuery as TryFrom<String>>::Error>
ยงimpl TryFrom<Vec<u8>> for PathAndQuery
impl TryFrom<Vec<u8>> for PathAndQuery
ยงtype Error = InvalidUri
type Error = InvalidUri
impl Eq for PathAndQuery
Auto Trait Implementationsยง
impl !Freeze for PathAndQuery
impl RefUnwindSafe for PathAndQuery
impl Send for PathAndQuery
impl Sync for PathAndQuery
impl Unpin for PathAndQuery
impl UnwindSafe for PathAndQuery
Blanket Implementationsยง
Sourceยงimpl<S, D, Swp, Dwp, T> AdaptInto<D, Swp, Dwp, T> for Swhere
T: Real + Zero + Arithmetics + Clone,
Swp: WhitePoint<T>,
Dwp: WhitePoint<T>,
D: AdaptFrom<S, Swp, Dwp, T>,
impl<S, D, Swp, Dwp, T> AdaptInto<D, Swp, Dwp, T> for Swhere
T: Real + Zero + Arithmetics + Clone,
Swp: WhitePoint<T>,
Dwp: WhitePoint<T>,
D: AdaptFrom<S, Swp, Dwp, T>,
Sourceยงfn adapt_into_using<M>(self, method: M) -> Dwhere
M: TransformMatrix<T>,
fn adapt_into_using<M>(self, method: M) -> Dwhere
M: TransformMatrix<T>,
Sourceยงfn adapt_into(self) -> D
fn adapt_into(self) -> D
ยงimpl<T> ArchivePointee for T
impl<T> ArchivePointee for T
ยงtype ArchivedMetadata = ()
type ArchivedMetadata = ()
ยงfn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
Sourceยงimpl<T, C> ArraysFrom<C> for Twhere
C: IntoArrays<T>,
impl<T, C> ArraysFrom<C> for Twhere
C: IntoArrays<T>,
Sourceยงfn arrays_from(colors: C) -> T
fn arrays_from(colors: C) -> T
Sourceยงimpl<T, C> ArraysInto<C> for Twhere
C: FromArrays<T>,
impl<T, C> ArraysInto<C> for Twhere
C: FromArrays<T>,
Sourceยงfn arrays_into(self) -> C
fn arrays_into(self) -> C
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
ยงimpl<T> CallHasher for T
impl<T> CallHasher for T
Sourceยงimpl<WpParam, T, U> Cam16IntoUnclamped<WpParam, T> for Uwhere
T: FromCam16Unclamped<WpParam, U>,
impl<WpParam, T, U> Cam16IntoUnclamped<WpParam, T> for Uwhere
T: FromCam16Unclamped<WpParam, U>,
Sourceยงtype Scalar = <T as FromCam16Unclamped<WpParam, U>>::Scalar
type Scalar = <T as FromCam16Unclamped<WpParam, U>>::Scalar
parameters
when converting.Sourceยงfn cam16_into_unclamped(
self,
parameters: BakedParameters<WpParam, <U as Cam16IntoUnclamped<WpParam, T>>::Scalar>,
) -> T
fn cam16_into_unclamped( self, parameters: BakedParameters<WpParam, <U as Cam16IntoUnclamped<WpParam, T>>::Scalar>, ) -> T
self
into C
, using the provided parameters.Sourceยงimpl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Sourceยงimpl<T, C> ComponentsFrom<C> for Twhere
C: IntoComponents<T>,
impl<T, C> ComponentsFrom<C> for Twhere
C: IntoComponents<T>,
Sourceยงfn components_from(colors: C) -> T
fn components_from(colors: C) -> T
ยงimpl<F, W, T, D> Deserialize<With<T, W>, D> for F
impl<F, W, T, D> Deserialize<With<T, W>, D> for F
ยงfn deserialize(
&self,
deserializer: &mut D,
) -> Result<With<T, W>, <D as Fallible>::Error>
fn deserialize( &self, deserializer: &mut D, ) -> Result<With<T, W>, <D as Fallible>::Error>
ยง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>
Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
, which can then be
downcast
into Box<dyn 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>
Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
, which 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)
&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)
&mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
โs vtable from &mut Trait
โs.ยงimpl<T> DowncastSend for T
impl<T> DowncastSend for T
ยง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
ยง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
key
and return true
if they are equal.Sourceยงimpl<T> FromAngle<T> for T
impl<T> FromAngle<T> for T
Sourceยงfn from_angle(angle: T) -> T
fn from_angle(angle: T) -> T
angle
.Sourceยงimpl<T, U> FromStimulus<U> for Twhere
U: IntoStimulus<T>,
impl<T, U> FromStimulus<U> for Twhere
U: IntoStimulus<T>,
Sourceยงfn from_stimulus(other: U) -> T
fn from_stimulus(other: U) -> T
other
into Self
, while performing the appropriate scaling,
rounding and clamping.ยงimpl<T> Instrument for T
impl<T> Instrument for T
ยงfn instrument(self, span: Span) -> Instrumented<Self> โ
fn instrument(self, span: Span) -> Instrumented<Self> โ
Sourceยงimpl<T, U> IntoAngle<U> for Twhere
U: FromAngle<T>,
impl<T, U> IntoAngle<U> for Twhere
U: FromAngle<T>,
Sourceยงfn into_angle(self) -> U
fn into_angle(self) -> U
T
.Sourceยงimpl<WpParam, T, U> IntoCam16Unclamped<WpParam, T> for Uwhere
T: Cam16FromUnclamped<WpParam, U>,
impl<WpParam, T, U> IntoCam16Unclamped<WpParam, T> for Uwhere
T: Cam16FromUnclamped<WpParam, U>,
Sourceยงtype Scalar = <T as Cam16FromUnclamped<WpParam, U>>::Scalar
type Scalar = <T as Cam16FromUnclamped<WpParam, U>>::Scalar
parameters
when converting.Sourceยงfn into_cam16_unclamped(
self,
parameters: BakedParameters<WpParam, <U as IntoCam16Unclamped<WpParam, T>>::Scalar>,
) -> T
fn into_cam16_unclamped( self, parameters: BakedParameters<WpParam, <U as IntoCam16Unclamped<WpParam, T>>::Scalar>, ) -> T
self
into C
, using the provided parameters.Sourceยงimpl<T, U> IntoColor<U> for Twhere
U: FromColor<T>,
impl<T, U> IntoColor<U> for Twhere
U: FromColor<T>,
Sourceยงfn into_color(self) -> U
fn into_color(self) -> U
Sourceยงimpl<T, U> IntoColorUnclamped<U> for Twhere
U: FromColorUnclamped<T>,
impl<T, U> IntoColorUnclamped<U> for Twhere
U: FromColorUnclamped<T>,
Sourceยงfn into_color_unclamped(self) -> U
fn into_color_unclamped(self) -> U
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> โ
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> โ
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<T> IntoParam for T
impl<T> IntoParam for T
Sourceยงimpl<T> IntoStimulus<T> for T
impl<T> IntoStimulus<T> for T
Sourceยงfn into_stimulus(self) -> T
fn into_stimulus(self) -> T
self
into T
, while performing the appropriate scaling,
rounding and clamping.ยงimpl<T> Pointable for T
impl<T> Pointable for T
ยงimpl<T> Pointee for T
impl<T> Pointee for T
ยงimpl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
ยงimpl<T> SerializableKey for T
impl<T> SerializableKey for T
ยงimpl<T> StorageAccess<T> for T
impl<T> StorageAccess<T> for T
ยงfn as_borrowed(&self) -> &T
fn as_borrowed(&self) -> &T
ยงfn into_taken(self) -> T
fn into_taken(self) -> T
ยง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.
Sourceยงimpl<T, C> TryComponentsInto<C> for Twhere
C: TryFromComponents<T>,
impl<T, C> TryComponentsInto<C> for Twhere
C: TryFromComponents<T>,
Sourceยงtype Error = <C as TryFromComponents<T>>::Error
type Error = <C as TryFromComponents<T>>::Error
try_into_colors
fails to cast.Sourceยงfn try_components_into(self) -> Result<C, <T as TryComponentsInto<C>>::Error>
fn try_components_into(self) -> Result<C, <T as TryComponentsInto<C>>::Error>
Sourceยงimpl<T, U> TryIntoColor<U> for Twhere
U: TryFromColor<T>,
impl<T, U> TryIntoColor<U> for Twhere
U: TryFromColor<T>,
Sourceยงfn try_into_color(self) -> Result<U, OutOfBounds<U>>
fn try_into_color(self) -> Result<U, OutOfBounds<U>>
OutOfBounds
error is returned which contains
the unclamped color. Read more