Struct vimwiki::vendor::uriparse::URI [−]
pub struct URI<'uri> { /* fields omitted */ }
Expand description
A Uniform Resource Identifier (URI) as defined in RFC3986.
A URI is a URI reference, one with a scheme.
Implementations
impl<'uri> URI<'uri>
impl<'uri> URI<'uri>
pub fn as_uri_reference(&self) -> &URIReference<'uri>
Returns the authority, if present, of the URI.
Examples
use std::convert::TryFrom; use uriparse::URI; let uri = URI::try_from("http://example.com:80/my/path").unwrap(); assert_eq!(uri.authority().unwrap().to_string(), "example.com:80");
pub fn builder<'new_uri>() -> URIBuilder<'new_uri>
pub fn builder<'new_uri>() -> URIBuilder<'new_uri>
Constructs a default builder for a URI.
This provides an alternative means of constructing a URI besides parsing and
URI::from_parts
.
Examples
use std::convert::TryFrom; use uriparse::{Authority, Path, Scheme, URI}; let uri = URI::builder() .with_scheme(Scheme::HTTP) .with_authority(Some(Authority::try_from("example.com").unwrap())) .with_path(Path::try_from("/my/path").unwrap()) .build() .unwrap(); assert_eq!(uri.to_string(), "http://example.com/my/path");
pub fn can_be_a_base(&self) -> bool
pub fn can_be_a_base(&self) -> bool
Returns whether the URI can act as a base URI.
A URI can be a base if it is absolute (i.e. it has no fragment component).
Examples
use std::convert::TryFrom; use uriparse::URI; let uri = URI::try_from("http://example.com/my/path").unwrap(); assert!(uri.can_be_a_base()); let uri = URI::try_from("ftp://127.0.0.1#fragment").unwrap(); assert!(!uri.can_be_a_base());
pub fn from_parts<'new_uri, TScheme, TAuthority, TPath, TQuery, TFragment, TSchemeError, TAuthorityError, TPathError, TQueryError, TFragmentError>(
scheme: TScheme,
authority: Option<TAuthority>,
path: TPath,
query: Option<TQuery>,
fragment: Option<TFragment>
) -> Result<URI<'new_uri>, URIError> where
Scheme<'new_uri>: TryFrom<TScheme>,
Authority<'new_uri>: TryFrom<TAuthority>,
Path<'new_uri>: TryFrom<TPath>,
Query<'new_uri>: TryFrom<TQuery>,
Fragment<'new_uri>: TryFrom<TFragment>,
URIReferenceError: From<TSchemeError>,
URIReferenceError: From<TAuthorityError>,
URIReferenceError: From<TPathError>,
URIReferenceError: From<TQueryError>,
URIReferenceError: From<TFragmentError>,
<Scheme<'new_uri> as TryFrom<TScheme>>::Error == TSchemeError,
<Authority<'new_uri> as TryFrom<TAuthority>>::Error == TAuthorityError,
<Path<'new_uri> as TryFrom<TPath>>::Error == TPathError,
<Query<'new_uri> as TryFrom<TQuery>>::Error == TQueryError,
<Fragment<'new_uri> as TryFrom<TFragment>>::Error == TFragmentError,
pub fn from_parts<'new_uri, TScheme, TAuthority, TPath, TQuery, TFragment, TSchemeError, TAuthorityError, TPathError, TQueryError, TFragmentError>(
scheme: TScheme,
authority: Option<TAuthority>,
path: TPath,
query: Option<TQuery>,
fragment: Option<TFragment>
) -> Result<URI<'new_uri>, URIError> where
Scheme<'new_uri>: TryFrom<TScheme>,
Authority<'new_uri>: TryFrom<TAuthority>,
Path<'new_uri>: TryFrom<TPath>,
Query<'new_uri>: TryFrom<TQuery>,
Fragment<'new_uri>: TryFrom<TFragment>,
URIReferenceError: From<TSchemeError>,
URIReferenceError: From<TAuthorityError>,
URIReferenceError: From<TPathError>,
URIReferenceError: From<TQueryError>,
URIReferenceError: From<TFragmentError>,
<Scheme<'new_uri> as TryFrom<TScheme>>::Error == TSchemeError,
<Authority<'new_uri> as TryFrom<TAuthority>>::Error == TAuthorityError,
<Path<'new_uri> as TryFrom<TPath>>::Error == TPathError,
<Query<'new_uri> as TryFrom<TQuery>>::Error == TQueryError,
<Fragment<'new_uri> as TryFrom<TFragment>>::Error == TFragmentError,
Constructs a new URI
from the individual parts: scheme, authority, path, query, and
fragment.
The lifetime used by the resulting value will be the lifetime of the part that is most restricted in scope.
Examples
use std::convert::TryFrom; use uriparse::{Fragment, URI}; let uri = URI::from_parts( "http", Some("example.com"), "", Some("query"), None::<Fragment> ).unwrap(); assert_eq!(uri.to_string(), "http://example.com/?query");
Returns the fragment, if present, of the URI.
Examples
use std::convert::TryFrom; use uriparse::URI; let uri = URI::try_from("http://example.com#fragment").unwrap(); assert_eq!(uri.fragment().unwrap(), "fragment");
Returns whether the URI has an authority component.
Examples
use std::convert::TryFrom; use uriparse::URI; let uri = URI::try_from("http://example.com").unwrap(); assert!(uri.has_authority()); let uri = URI::try_from("urn:test").unwrap(); assert!(!uri.has_authority());
pub fn has_fragment(&self) -> bool
pub fn has_fragment(&self) -> bool
Returns whether the URI has a fragment component.
Examples
use std::convert::TryFrom; use uriparse::URI; let uri = URI::try_from("http://example.com#test").unwrap(); assert!(uri.has_fragment()); let uri = URI::try_from("http://example.com").unwrap(); assert!(!uri.has_fragment());
pub fn has_password(&self) -> bool
pub fn has_password(&self) -> bool
Returns whether the URI has a password component.
Examples
use std::convert::TryFrom; use uriparse::URI; let uri = URI::try_from("http://user:pass@127.0.0.1").unwrap(); assert!(uri.has_password()); let uri = URI::try_from("http://user@127.0.0.1").unwrap(); assert!(!uri.has_password());
Returns whether the URI has a port.
Examples
use std::convert::TryFrom; use uriparse::URI; let uri = URI::try_from("http://127.0.0.1:8080").unwrap(); assert!(uri.has_port()); let uri = URI::try_from("http://127.0.0.1").unwrap(); assert!(!uri.has_port());
Returns whether the URI has a query component.
Examples
use std::convert::TryFrom; use uriparse::URI; let uri = URI::try_from("http://example.com/my/path?my=query").unwrap(); assert!(uri.has_query()); let uri = URI::try_from("http://example.com/my/path").unwrap(); assert!(!uri.has_query());
pub fn has_username(&self) -> bool
pub fn has_username(&self) -> bool
Returns whether the URI has a username component.
Examples
use std::convert::TryFrom; use uriparse::URI; let uri = URI::try_from("http://username@example.com").unwrap(); assert!(uri.has_username()); let uri = URI::try_from("http://example.com").unwrap(); assert!(!uri.has_username());
Returns the host, if present, of the URI.
Examples
use std::convert::TryFrom; use uriparse::URI; let uri = URI::try_from("http://username@example.com").unwrap(); assert_eq!(uri.host().unwrap().to_string(), "example.com");
pub fn into_base_uri(self) -> URI<'uri>
pub fn into_base_uri(self) -> URI<'uri>
Converts the URI into a base URI (i.e. the fragment component is removed).
Examples
use std::convert::TryFrom; use uriparse::URI; let uri = URI::try_from("http://example.com#fragment").unwrap(); assert_eq!(uri.to_string(), "http://example.com/#fragment"); let uri = uri.into_base_uri(); assert_eq!(uri.to_string(), "http://example.com/");
pub fn into_builder(self) -> URIBuilder<'uri>
pub fn into_builder(self) -> URIBuilder<'uri>
Consumes the URI and converts it into a builder with the same values.
Examples
use std::convert::TryFrom; use uriparse::{Fragment, Query, URI}; let uri = URI::try_from("http://example.com/path?query#fragment").unwrap(); let mut builder = uri.into_builder(); builder.query(None::<Query>).fragment(None::<Fragment>); let uri = builder.build().unwrap(); assert_eq!(uri.to_string(), "http://example.com/path");
pub fn into_owned(self) -> URI<'static>
pub fn into_owned(self) -> URI<'static>
Converts the URI
into an owned copy.
If you construct the URI from a source with a non-static lifetime, you may run into lifetime problems due to the way the struct is designed. Calling this function will ensure that the returned value has a static lifetime.
This is different from just cloning. Cloning the URI will just copy the references, and thus the lifetime will remain the same.
Consumes the URI
and returns its parts: scheme, authority, path, query, and fragment.
Examples
use std::convert::TryFrom; use uriparse::URI; let uri = URI::try_from( "http://username:password@example.com:80/my/path?my=query#fragment", ).unwrap(); let (scheme, authority, path, query, fragment) = uri.into_parts(); assert_eq!(scheme, "http"); assert_eq!(authority.unwrap().to_string(), "username:password@example.com:80"); assert_eq!(path, "/my/path"); assert_eq!(query.unwrap(), "my=query"); assert_eq!(fragment.unwrap(), "fragment");
pub fn is_normalized(&self) -> bool
pub fn is_normalized(&self) -> bool
Returns whether the URI is normalized.
A normalized URI will have all of its components normalized.
Examples
use std::convert::TryFrom; use uriparse::URI; let uri = URI::try_from("http://example.com/?a=b").unwrap(); assert!(uri.is_normalized()); let mut uri = URI::try_from("http://EXAMPLE.com/?a=b").unwrap(); assert!(!uri.is_normalized()); uri.normalize(); assert!(uri.is_normalized());
Maps the authority using the given map function.
This function will panic if, as a result of the authority change, the URI reference becomes invalid.
Examples
use std::convert::TryFrom; use uriparse::{Authority, URI}; let mut uri = URI::try_from("http://example.com").unwrap(); uri.map_authority(|_| Some(Authority::try_from("127.0.0.1").unwrap())); assert_eq!(uri.to_string(), "http://127.0.0.1/");
Maps the fragment using the given map function.
Examples
use std::convert::TryFrom; use uriparse::{Fragment, URI}; let mut uri = URI::try_from("http://example.com").unwrap(); uri.map_fragment(|_| Some(Fragment::try_from("fragment").unwrap())); assert_eq!(uri.to_string(), "http://example.com/#fragment");
Maps the path using the given map function.
This function will panic if, as a result of the path change, the URI becomes invalid.
Examples
use std::convert::TryFrom; use uriparse::URI; let mut uri = URI::try_from("http://example.com").unwrap(); uri.map_path(|mut path| { path.push("test").unwrap(); path.push("path").unwrap(); path }); assert_eq!(uri.to_string(), "http://example.com/test/path");
Maps the query using the given map function.
Examples
use std::convert::TryFrom; use uriparse::{Query, URI}; let mut uri = URI::try_from("http://example.com").unwrap(); uri.map_query(|_| Some(Query::try_from("query").unwrap())); assert_eq!(uri.to_string(), "http://example.com/?query");
Maps the scheme using the given map function.
Examples
use std::convert::TryFrom; use uriparse::{Scheme, URI}; let mut uri = URI::try_from("http://example.com").unwrap(); uri.map_scheme(|_| Scheme::try_from("https").unwrap()); assert_eq!(uri.to_string(), "https://example.com/");
pub fn normalize(&mut self)
pub fn normalize(&mut self)
Normalizes the URI.
A normalized URI will have all of its components normalized.
Examples
use std::convert::TryFrom; use uriparse::URI; let mut uri = URI::try_from("http://example.com/?a=b").unwrap(); uri.normalize(); assert_eq!(uri.to_string(), "http://example.com/?a=b"); let mut uri = URI::try_from("http://EXAMPLE.com/?a=b").unwrap(); assert_eq!(uri.to_string(), "http://EXAMPLE.com/?a=b"); uri.normalize(); assert_eq!(uri.to_string(), "http://example.com/?a=b");
Returns the path of the URI.
Examples
use std::convert::TryFrom; use uriparse::URI; let uri = URI::try_from("http://127.0.0.1/my/path").unwrap(); assert_eq!(uri.path(), "/my/path");
Returns the password, if present, of the URI.
Usage of a password in URIs is deprecated.
Examples
use std::convert::TryFrom; use uriparse::URI; let uri = URI::try_from("http://user:pass@example.com").unwrap(); assert_eq!(uri.password().unwrap(), "pass");
Returns the port, if present, of the URI.
Examples
use std::convert::TryFrom; use uriparse::URI; let uri = URI::try_from("http://example.com:8080/").unwrap(); assert_eq!(uri.port().unwrap(), 8080);
Returns the query, if present, of the URI.
Examples
use std::convert::TryFrom; use uriparse::URI; let uri = URI::try_from("http://127.0.0.1?my=query").unwrap(); assert_eq!(uri.query().unwrap(), "my=query");
pub fn resolve(&self, reference: &'uri URIReference<'uri>) -> URI<'uri>
pub fn resolve(&self, reference: &'uri URIReference<'uri>) -> URI<'uri>
Creates a new URI which is created by resolving the given reference against this URI.
The algorithm used for resolving the reference is described in [RFC3986, Section 5.2.2].
Returns the scheme of the URI.
Examples
use std::convert::TryFrom; use uriparse::URI; let uri = URI::try_from("http://127.0.0.1/").unwrap(); assert_eq!(uri.scheme(), "http");
Sets the authority of the URI.
An error will be returned if the conversion to an Authority
fails.
The existing path will be set to absolute (i.e. starts with a '/'
).
Examples
use std::convert::TryFrom; use uriparse::URI; let mut uri = URI::try_from("http://example.com").unwrap(); uri.set_authority(Some("user@example.com:80")); assert_eq!(uri.to_string(), "http://user@example.com:80/");
Sets the fragment of the URI.
An error will be returned if the conversion to a Fragment
fails.
Examples
use std::convert::TryFrom; use uriparse::URI; let mut uri = URI::try_from("http://example.com").unwrap(); uri.set_fragment(Some("fragment")); assert_eq!(uri.to_string(), "http://example.com/#fragment");
Sets the path of the URI.
An error will be returned in one of two cases:
- The conversion to
Path
failed. - The path was set to a value that resulted in an invalid URI.
Regardless of whether the given path was set as absolute or relative, if the URI reference currently has an authority, the path will be forced to be absolute.
Examples
use std::convert::TryFrom; use uriparse::URI; let mut uri = URI::try_from("http://example.com").unwrap(); uri.set_path("my/path"); assert_eq!(uri.to_string(), "http://example.com/my/path");
Trait Implementations
impl<'de, 'uri> Deserialize<'de> for URI<'uri>
impl<'de, 'uri> Deserialize<'de> for URI<'uri>
pub fn deserialize<__D>(
__deserializer: __D
) -> Result<URI<'uri>, <__D as Deserializer<'de>>::Error> where
__D: Deserializer<'de>,
pub fn deserialize<__D>(
__deserializer: __D
) -> Result<URI<'uri>, <__D as Deserializer<'de>>::Error> where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl<'uri> From<URI<'uri>> for URIReference<'uri>
impl<'uri> From<URI<'uri>> for URIReference<'uri>
pub fn from(value: URI<'uri>) -> URIReference<'uri>
pub fn from(value: URI<'uri>) -> URIReference<'uri>
Performs the conversion.
pub fn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error> where
__S: Serializer,
pub fn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error> where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
impl<'uri> TryFrom<URIReference<'uri>> for URI<'uri>
impl<'uri> TryFrom<URIReference<'uri>> for URI<'uri>
pub fn try_from(
value: URIReference<'uri>
) -> Result<URI<'uri>, <URI<'uri> as TryFrom<URIReference<'uri>>>::Error>
pub fn try_from(
value: URIReference<'uri>
) -> Result<URI<'uri>, <URI<'uri> as TryFrom<URIReference<'uri>>>::Error>
Performs the conversion.
impl<'uri> StructuralEq for URI<'uri>
impl<'uri> StructuralPartialEq for URI<'uri>
Auto Trait Implementations
impl<'uri> RefUnwindSafe for URI<'uri>
impl<'uri> UnwindSafe for URI<'uri>
Blanket Implementations
Mutably borrows from an owned value. Read more
fn fmt_binary(self) -> FmtBinary<Self> where
Self: Binary,
fn fmt_binary(self) -> FmtBinary<Self> where
Self: Binary,
Causes self
to use its Binary
implementation when Debug
-formatted.
fn fmt_display(self) -> FmtDisplay<Self> where
Self: Display,
fn fmt_display(self) -> FmtDisplay<Self> where
Self: Display,
Causes self
to use its Display
implementation when
Debug
-formatted. Read more
fn fmt_lower_exp(self) -> FmtLowerExp<Self> where
Self: LowerExp,
fn fmt_lower_exp(self) -> FmtLowerExp<Self> where
Self: LowerExp,
Causes self
to use its LowerExp
implementation when
Debug
-formatted. Read more
fn fmt_lower_hex(self) -> FmtLowerHex<Self> where
Self: LowerHex,
fn fmt_lower_hex(self) -> FmtLowerHex<Self> where
Self: LowerHex,
Causes self
to use its LowerHex
implementation when
Debug
-formatted. Read more
Causes self
to use its Octal
implementation when Debug
-formatted.
fn fmt_pointer(self) -> FmtPointer<Self> where
Self: Pointer,
fn fmt_pointer(self) -> FmtPointer<Self> where
Self: Pointer,
Causes self
to use its Pointer
implementation when
Debug
-formatted. Read more
fn fmt_upper_exp(self) -> FmtUpperExp<Self> where
Self: UpperExp,
fn fmt_upper_exp(self) -> FmtUpperExp<Self> where
Self: UpperExp,
Causes self
to use its UpperExp
implementation when
Debug
-formatted. Read more
fn fmt_upper_hex(self) -> FmtUpperHex<Self> where
Self: UpperHex,
fn fmt_upper_hex(self) -> FmtUpperHex<Self> where
Self: UpperHex,
Causes self
to use its UpperHex
implementation when
Debug
-formatted. Read more
impl<T> Pipe for T where
T: ?Sized,
impl<T> Pipe for T where
T: ?Sized,
Pipes by value. This is generally the method you want to use. Read more
Borrows self
and passes that borrow into the pipe function. Read more
fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> R where
R: 'a,
fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> R where
R: 'a,
Mutably borrows self
and passes that borrow into the pipe function. Read more
fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R where
Self: Borrow<B>,
B: 'a + ?Sized,
R: 'a,
fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R where
Self: Borrow<B>,
B: 'a + ?Sized,
R: 'a,
Borrows self
, then passes self.borrow()
into the pipe function. Read more
fn pipe_borrow_mut<'a, B, R>(
&'a mut self,
func: impl FnOnce(&'a mut B) -> R
) -> R where
Self: BorrowMut<B>,
B: 'a + ?Sized,
R: 'a,
fn pipe_borrow_mut<'a, B, R>(
&'a mut self,
func: impl FnOnce(&'a mut B) -> R
) -> R where
Self: BorrowMut<B>,
B: 'a + ?Sized,
R: 'a,
Mutably borrows self
, then passes self.borrow_mut()
into the pipe
function. Read more
fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R where
Self: AsRef<U>,
R: 'a,
U: 'a + ?Sized,
fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R where
Self: AsRef<U>,
R: 'a,
U: 'a + ?Sized,
Borrows self
, then passes self.as_ref()
into the pipe function.
fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R where
Self: AsMut<U>,
R: 'a,
U: 'a + ?Sized,
fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R where
Self: AsMut<U>,
R: 'a,
U: 'a + ?Sized,
Mutably borrows self
, then passes self.as_mut()
into the pipe
function. Read more
fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R where
Self: Deref<Target = T>,
T: 'a + ?Sized,
R: 'a,
fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R where
Self: Deref<Target = T>,
T: 'a + ?Sized,
R: 'a,
Borrows self
, then passes self.deref()
into the pipe function.
fn pipe_as_ref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R where
Self: AsRef<T>,
T: 'a,
R: 'a,
fn pipe_as_ref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R where
Self: AsRef<T>,
T: 'a,
R: 'a,
Pipes a trait borrow into a function that cannot normally be called in suffix position. Read more
fn pipe_as_mut<'a, T, R>(&'a mut self, func: impl FnOnce(&'a mut T) -> R) -> R where
Self: AsMut<T>,
T: 'a,
R: 'a,
fn pipe_as_mut<'a, T, R>(&'a mut self, func: impl FnOnce(&'a mut T) -> R) -> R where
Self: AsMut<T>,
T: 'a,
R: 'a,
Pipes a trait mutable borrow into a function that cannot normally be called in suffix position. Read more
fn pipe_borrow<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R where
Self: Borrow<T>,
T: 'a,
R: 'a,
fn pipe_borrow<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R where
Self: Borrow<T>,
T: 'a,
R: 'a,
Pipes a trait borrow into a function that cannot normally be called in suffix position. Read more
fn pipe_borrow_mut<'a, T, R>(
&'a mut self,
func: impl FnOnce(&'a mut T) -> R
) -> R where
Self: BorrowMut<T>,
T: 'a,
R: 'a,
fn pipe_borrow_mut<'a, T, R>(
&'a mut self,
func: impl FnOnce(&'a mut T) -> R
) -> R where
Self: BorrowMut<T>,
T: 'a,
R: 'a,
Pipes a trait mutable borrow into a function that cannot normally be called in suffix position. Read more
fn pipe_deref<'a, R>(&'a self, func: impl FnOnce(&'a Self::Target) -> R) -> R where
Self: Deref,
R: 'a,
fn pipe_deref<'a, R>(&'a self, func: impl FnOnce(&'a Self::Target) -> R) -> R where
Self: Deref,
R: 'a,
Pipes a dereference into a function that cannot normally be called in suffix position. Read more
fn pipe_deref_mut<'a, R>(
&'a mut self,
func: impl FnOnce(&'a mut Self::Target) -> R
) -> R where
Self: DerefMut,
R: 'a,
fn pipe_deref_mut<'a, R>(
&'a mut self,
func: impl FnOnce(&'a mut Self::Target) -> R
) -> R where
Self: DerefMut,
R: 'a,
Pipes a mutable dereference into a function that cannot normally be called in suffix position. Read more
Pipes a reference into a function that cannot ordinarily be called in suffix position. Read more
fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self where
Self: Borrow<B>,
B: ?Sized,
fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self where
Self: Borrow<B>,
B: ?Sized,
Immutable access to the Borrow<B>
of a value. Read more
fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self where
Self: BorrowMut<B>,
B: ?Sized,
fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self where
Self: BorrowMut<B>,
B: ?Sized,
Mutable access to the BorrowMut<B>
of a value. Read more
Immutable access to the AsRef<R>
view of a value. Read more
fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self where
Self: AsMut<R>,
R: ?Sized,
fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self where
Self: AsMut<R>,
R: ?Sized,
Mutable access to the AsMut<R>
view of a value. Read more
Immutable access to the Deref::Target
of a value. Read more
Mutable access to the Deref::Target
of a value. Read more
Calls .tap()
only in debug builds, and is erased in release builds.
fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
Calls .tap_mut()
only in debug builds, and is erased in release
builds. Read more
fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self where
Self: Borrow<B>,
B: ?Sized,
fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self where
Self: Borrow<B>,
B: ?Sized,
Calls .tap_borrow()
only in debug builds, and is erased in release
builds. Read more
fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self where
Self: BorrowMut<B>,
B: ?Sized,
fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self where
Self: BorrowMut<B>,
B: ?Sized,
Calls .tap_borrow_mut()
only in debug builds, and is erased in release
builds. Read more
fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self where
Self: AsRef<R>,
R: ?Sized,
fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self where
Self: AsRef<R>,
R: ?Sized,
Calls .tap_ref()
only in debug builds, and is erased in release
builds. Read more
fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self where
Self: AsMut<R>,
R: ?Sized,
fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self where
Self: AsMut<R>,
R: ?Sized,
Calls .tap_ref_mut()
only in debug builds, and is erased in release
builds. Read more
Provides immutable access for inspection. Read more
Calls tap
in debug builds, and does nothing in release builds.
Provides mutable access for modification. Read more
fn tap_mut_dbg<F, R>(self, func: F) -> Self where
F: FnOnce(&mut Self) -> R,
fn tap_mut_dbg<F, R>(self, func: F) -> Self where
F: FnOnce(&mut Self) -> R,
Calls tap_mut
in debug builds, and does nothing in release builds.
impl<T, U> TapAsRef<U> for T where
U: ?Sized,
impl<T, U> TapAsRef<U> for T where
U: ?Sized,
Provides immutable access to the reference for inspection.
fn tap_ref_dbg<F, R>(self, func: F) -> Self where
Self: AsRef<T>,
F: FnOnce(&T) -> R,
fn tap_ref_dbg<F, R>(self, func: F) -> Self where
Self: AsRef<T>,
F: FnOnce(&T) -> R,
Calls tap_ref
in debug builds, and does nothing in release builds.
fn tap_ref_mut<F, R>(self, func: F) -> Self where
Self: AsMut<T>,
F: FnOnce(&mut T) -> R,
fn tap_ref_mut<F, R>(self, func: F) -> Self where
Self: AsMut<T>,
F: FnOnce(&mut T) -> R,
Provides mutable access to the reference for modification.
fn tap_ref_mut_dbg<F, R>(self, func: F) -> Self where
Self: AsMut<T>,
F: FnOnce(&mut T) -> R,
fn tap_ref_mut_dbg<F, R>(self, func: F) -> Self where
Self: AsMut<T>,
F: FnOnce(&mut T) -> R,
Calls tap_ref_mut
in debug builds, and does nothing in release builds.
impl<T, U> TapBorrow<U> for T where
U: ?Sized,
impl<T, U> TapBorrow<U> for T where
U: ?Sized,
fn tap_borrow<F, R>(self, func: F) -> Self where
Self: Borrow<T>,
F: FnOnce(&T) -> R,
fn tap_borrow<F, R>(self, func: F) -> Self where
Self: Borrow<T>,
F: FnOnce(&T) -> R,
Provides immutable access to the borrow for inspection. Read more
fn tap_borrow_dbg<F, R>(self, func: F) -> Self where
Self: Borrow<T>,
F: FnOnce(&T) -> R,
fn tap_borrow_dbg<F, R>(self, func: F) -> Self where
Self: Borrow<T>,
F: FnOnce(&T) -> R,
Calls tap_borrow
in debug builds, and does nothing in release builds.
fn tap_borrow_mut<F, R>(self, func: F) -> Self where
Self: BorrowMut<T>,
F: FnOnce(&mut T) -> R,
fn tap_borrow_mut<F, R>(self, func: F) -> Self where
Self: BorrowMut<T>,
F: FnOnce(&mut T) -> R,
Provides mutable access to the borrow for modification.
fn tap_borrow_mut_dbg<F, R>(self, func: F) -> Self where
Self: BorrowMut<T>,
F: FnOnce(&mut T) -> R,
fn tap_borrow_mut_dbg<F, R>(self, func: F) -> Self where
Self: BorrowMut<T>,
F: FnOnce(&mut T) -> R,
Calls tap_borrow_mut
in debug builds, and does nothing in release
builds. Read more
Immutably dereferences self
for inspection.
fn tap_deref_dbg<F, R>(self, func: F) -> Self where
Self: Deref,
F: FnOnce(&Self::Target) -> R,
fn tap_deref_dbg<F, R>(self, func: F) -> Self where
Self: Deref,
F: FnOnce(&Self::Target) -> R,
Calls tap_deref
in debug builds, and does nothing in release builds.
fn tap_deref_mut<F, R>(self, func: F) -> Self where
Self: DerefMut,
F: FnOnce(&mut Self::Target) -> R,
fn tap_deref_mut<F, R>(self, func: F) -> Self where
Self: DerefMut,
F: FnOnce(&mut Self::Target) -> R,
Mutably dereferences self
for modification.
fn tap_deref_mut_dbg<F, R>(self, func: F) -> Self where
Self: DerefMut,
F: FnOnce(&mut Self::Target) -> R,
fn tap_deref_mut_dbg<F, R>(self, func: F) -> Self where
Self: DerefMut,
F: FnOnce(&mut Self::Target) -> R,
Calls tap_deref_mut
in debug builds, and does nothing in release
builds. Read more