Struct vimwiki::vendor::uriparse::uri::URIBuilder [−]
pub struct URIBuilder<'uri> { /* fields omitted */ }
Expand description
A builder type for [URI]
.
You must use the URI::scheme
and URI::path
functions before building as URIs always
have a scheme and path. Everything else is optional.
Implementations
impl<'uri> URIBuilder<'uri>
impl<'uri> URIBuilder<'uri>
Sets the authority part of the URI.
It is optional to specify a authority.
Examples
use std::convert::TryFrom; use uriparse::{Authority, Path, Scheme, URIBuilder}; let mut builder = URIBuilder::new(); builder .scheme(Scheme::HTTP) .authority(Some(Authority::try_from("example.com").unwrap())) .path(Path::try_from("/my/path").unwrap()); let reference = builder.build().unwrap(); assert_eq!(reference.to_string(), "http://example.com/my/path");
Consumes the builder and tries to build a URI
.
This function will error in one of three situations:
- A scheme and path were not specified in the builder.
- While all individual components were valid, their combination as a URI was invalid.
Examples
First error type (scheme and/or path were not specified):
use std::convert::TryFrom; use uriparse::{Authority, Path, URIBuilder}; let result = URIBuilder::new() .with_authority(Some(Authority::try_from("example.com").unwrap())) .with_path(Path::try_from("/my/path").unwrap()) .build(); assert!(result.is_err());
Second error type (URI with no authority cannot have path starting with "//"
):
use std::convert::TryFrom; use uriparse::{Scheme, Path, URIBuilder}; let result = URIBuilder::new() .with_scheme(Scheme::URN) .with_path(Path::try_from("//path").unwrap()) .build(); assert!(result.is_err());
pub fn fragment(
&mut self,
fragment: Option<Fragment<'uri>>
) -> &mut URIBuilder<'uri>
pub fn fragment(
&mut self,
fragment: Option<Fragment<'uri>>
) -> &mut URIBuilder<'uri>
Sets the fragment part of the URI.
It is optional to specify a fragment.
Examples
use std::convert::TryFrom; use uriparse::{Fragment, Path, Scheme, URIBuilder}; let mut builder = URIBuilder::new(); builder .scheme(Scheme::URN) .path(Path::try_from("path").unwrap()) .fragment(Some(Fragment::try_from("fragment").unwrap())); let uri = builder.build().unwrap(); assert_eq!(uri.to_string(), "urn:path#fragment");
pub fn new() -> URIBuilder<'uri>
pub fn new() -> URIBuilder<'uri>
Constructs a new builder with nothing set.
pub fn path(&mut self, path: Path<'uri>) -> &mut URIBuilder<'uri>
pub fn path(&mut self, path: Path<'uri>) -> &mut URIBuilder<'uri>
Sets the path part of the URI.
It is required to specify a path. Not doing so will result in an error during the
URIBuilder::build
function.
Examples
use std::convert::TryFrom; use uriparse::{Path, Scheme, URIBuilder}; let mut builder = URIBuilder::new(); builder .scheme(Scheme::URN) .path(Path::try_from("path").unwrap()); let uri = builder.build().unwrap(); assert_eq!(uri.to_string(), "urn:path");
pub fn query(&mut self, query: Option<Query<'uri>>) -> &mut URIBuilder<'uri>
pub fn query(&mut self, query: Option<Query<'uri>>) -> &mut URIBuilder<'uri>
Sets the query part of the URI reference.
It is optional to specify a query.
Examples
use std::convert::TryFrom; use uriparse::{Path, Query, Scheme, URIBuilder}; let mut builder = URIBuilder::new(); builder .scheme(Scheme::URN) .path(Path::try_from("path").unwrap()) .query(Some(Query::try_from("query").unwrap())); let uri = builder.build().unwrap(); assert_eq!(uri.to_string(), "urn:path?query");
pub fn scheme(&mut self, scheme: Scheme<'uri>) -> &mut URIBuilder<'uri>
pub fn scheme(&mut self, scheme: Scheme<'uri>) -> &mut URIBuilder<'uri>
Sets the scheme part of the URI reference.
It is required to specify a scheme. Not doing so will result in an error during the
URIBuilder::build
function.
Examples
use std::convert::TryFrom; use uriparse::{Authority, Path, Scheme, URIBuilder}; let mut builder = URIBuilder::new(); builder .scheme(Scheme::HTTP) .authority(Some(Authority::try_from("example.com").unwrap())) .path(Path::try_from("/my/path").unwrap()); let uri = builder.build().unwrap(); assert_eq!(uri.to_string(), "http://example.com/my/path");
Sets the authority part of the URI.1
If the given authority is not a valid authority (i.e. the conversion fails), an error is
stored internally and checked during the URIBuilder::build
function. The error state
will be rewritten for any following calls to this function.
It is optional to specify an authority.
Examples
use uriparse::URIBuilder; let mut builder = URIBuilder::new(); builder .try_scheme("http") .unwrap() .try_authority(Some("example.com")) .unwrap() .try_path("/my/path") .unwrap(); let uri = builder.build().unwrap(); assert_eq!(uri.to_string(), "http://example.com/my/path");
pub fn try_fragment<TFragment, TFragmentError>(
&mut self,
fragment: Option<TFragment>
) -> Result<&mut URIBuilder<'uri>, FragmentError> where
Fragment<'uri>: TryFrom<TFragment>,
FragmentError: From<TFragmentError>,
<Fragment<'uri> as TryFrom<TFragment>>::Error == TFragmentError,
pub fn try_fragment<TFragment, TFragmentError>(
&mut self,
fragment: Option<TFragment>
) -> Result<&mut URIBuilder<'uri>, FragmentError> where
Fragment<'uri>: TryFrom<TFragment>,
FragmentError: From<TFragmentError>,
<Fragment<'uri> as TryFrom<TFragment>>::Error == TFragmentError,
Sets the fragment part of the URI.
If the given fragment is not a valid fragment (i.e. the conversion fails), an error is
stored internally and checked during the URIBuilder::build
function. The error state
will be rewritten for any following calls to this function.
It is optional to specify a fragment.
Examples
use uriparse::URIBuilder; let mut builder = URIBuilder::new(); builder .try_scheme("urn") .unwrap() .try_path("path") .unwrap() .try_fragment(Some("fragment")) .unwrap(); let uri = builder.build().unwrap(); assert_eq!(uri.to_string(), "urn:path#fragment");
Sets the path part of the URI.
If the given path is not a valid path (i.e. the conversion fails), an error is stored
internally and checked during the URIBuilder::build
function. The error state will be
rewritten for any following calls to this function.
It is required to specify a path.
Examples
use uriparse::URIBuilder; let mut builder = URIBuilder::new(); builder .try_scheme("urn") .unwrap() .try_path("path") .unwrap(); let uri = builder.build().unwrap(); assert_eq!(uri.to_string(), "urn:path");
pub fn try_query<TQuery, TQueryError>(
&mut self,
query: Option<TQuery>
) -> Result<&mut URIBuilder<'uri>, QueryError> where
Query<'uri>: TryFrom<TQuery>,
QueryError: From<TQueryError>,
<Query<'uri> as TryFrom<TQuery>>::Error == TQueryError,
pub fn try_query<TQuery, TQueryError>(
&mut self,
query: Option<TQuery>
) -> Result<&mut URIBuilder<'uri>, QueryError> where
Query<'uri>: TryFrom<TQuery>,
QueryError: From<TQueryError>,
<Query<'uri> as TryFrom<TQuery>>::Error == TQueryError,
Sets the query part of the URI.
If the given query is not a valid query (i.e. the conversion fails), an error is stored
internally and checked during the URIBuilder::build
function. The error state will be
rewritten for any following calls to this function.
It is optional to specify a query.
Examples
use uriparse::URIBuilder; let mut builder = URIBuilder::new(); builder .try_scheme("urn") .unwrap() .try_path("path") .unwrap() .try_query(Some("query")) .unwrap(); let uri = builder.build().unwrap(); assert_eq!(uri.to_string(), "urn:path?query");
pub fn try_scheme<TScheme, TSchemeError>(
&mut self,
scheme: TScheme
) -> Result<&mut URIBuilder<'uri>, SchemeError> where
Scheme<'uri>: TryFrom<TScheme>,
SchemeError: From<TSchemeError>,
<Scheme<'uri> as TryFrom<TScheme>>::Error == TSchemeError,
pub fn try_scheme<TScheme, TSchemeError>(
&mut self,
scheme: TScheme
) -> Result<&mut URIBuilder<'uri>, SchemeError> where
Scheme<'uri>: TryFrom<TScheme>,
SchemeError: From<TSchemeError>,
<Scheme<'uri> as TryFrom<TScheme>>::Error == TSchemeError,
Sets the scheme part of the URI.
If the given scheme is not a valid scheme (i.e. the conversion fails), an error is stored
internally and checked during the URIBuilder::build
function. The error state will be
rewritten for any following calls to this function.
It is required to specify a scheme. Not doing so will result in an error during the
URIBuilder::build
function.
Examples
use std::convert::TryFrom; use uriparse::{Path, Scheme, URIBuilder}; let mut builder = URIBuilder::new(); builder .try_scheme("urn") .unwrap() .try_path("path") .unwrap(); let uri = builder.build().unwrap(); assert_eq!(uri.to_string(), "urn:path");
Consumes the builder and sets the authority part of the URI.
It is optional to specify an authority.
Examples
use std::convert::TryFrom; use uriparse::{Authority, Path, Scheme, URIBuilder}; let uri = URIBuilder::new() .with_scheme(Scheme::HTTP) .with_authority(Some(Authority::try_from("example.com").unwrap())) .with_path(Path::try_from("/").unwrap()) .build() .unwrap(); assert_eq!(uri.to_string(), "http://example.com/")
pub fn with_fragment(self, fragment: Option<Fragment<'uri>>) -> URIBuilder<'uri>
pub fn with_fragment(self, fragment: Option<Fragment<'uri>>) -> URIBuilder<'uri>
Consumes the builder and sets the fragment part of the URI.
It is optional to specify a fragment.
Examples
use std::convert::TryFrom; use uriparse::{Fragment, Path, Scheme, URIBuilder}; let uri = URIBuilder::new() .with_scheme(Scheme::URN) .with_path(Path::try_from("").unwrap()) .with_fragment(Some(Fragment::try_from("fragment").unwrap())) .build() .unwrap(); assert_eq!(uri.to_string(), "urn:#fragment")
pub fn with_path(self, path: Path<'uri>) -> URIBuilder<'uri>
pub fn with_path(self, path: Path<'uri>) -> URIBuilder<'uri>
Consumes the builder and sets the path part of the URI.
It is required to specify a path. Not doing so will result in an error during the
URIBuilder::build
function.
Examples
use std::convert::TryFrom; use uriparse::{Authority, Path, Scheme, URIBuilder}; let reference = URIBuilder::new() .with_scheme(Scheme::HTTP) .with_authority(Some(Authority::try_from("example.com").unwrap())) .with_path(Path::try_from("/").unwrap()) .build() .unwrap(); assert_eq!(reference.to_string(), "http://example.com/")
pub fn with_query(self, query: Option<Query<'uri>>) -> URIBuilder<'uri>
pub fn with_query(self, query: Option<Query<'uri>>) -> URIBuilder<'uri>
Consumes the builder and sets the query part of the URI.
It is optional to specify a query.
Examples
use std::convert::TryFrom; use uriparse::{Path, Query, Scheme, URIBuilder}; let uri = URIBuilder::new() .with_scheme(Scheme::URN) .with_path(Path::try_from("").unwrap()) .with_query(Some(Query::try_from("query").unwrap())) .build() .unwrap(); assert_eq!(uri.to_string(), "urn:?query")
pub fn with_scheme(self, scheme: Scheme<'uri>) -> URIBuilder<'uri>
pub fn with_scheme(self, scheme: Scheme<'uri>) -> URIBuilder<'uri>
Consumes the builder and sets the scheme part of the URI.
It is required to specify a scheme. Not doing so will result in an error during the
URIBuilder::build
function.
Examples
use std::convert::TryFrom; use uriparse::{Authority, Path, Scheme, URIBuilder}; let reference = URIBuilder::new() .with_scheme(Scheme::HTTP) .with_authority(Some(Authority::try_from("example.com").unwrap())) .with_path(Path::try_from("/").unwrap()) .build() .unwrap(); assert_eq!(reference.to_string(), "http://example.com/")
Trait Implementations
impl<'uri> Clone for URIBuilder<'uri>
impl<'uri> Clone for URIBuilder<'uri>
pub fn clone(&self) -> URIBuilder<'uri>
pub fn clone(&self) -> URIBuilder<'uri>
Returns a copy of the value. Read more
Performs copy-assignment from source
. Read more
impl<'uri> Debug for URIBuilder<'uri>
impl<'uri> Debug for URIBuilder<'uri>
impl<'uri> Default for URIBuilder<'uri>
impl<'uri> Default for URIBuilder<'uri>
pub fn default() -> URIBuilder<'uri>
pub fn default() -> URIBuilder<'uri>
Returns the “default value” for a type. Read more
impl<'uri> PartialEq<URIBuilder<'uri>> for URIBuilder<'uri>
impl<'uri> PartialEq<URIBuilder<'uri>> for URIBuilder<'uri>
pub fn eq(&self, other: &URIBuilder<'uri>) -> bool
pub fn eq(&self, other: &URIBuilder<'uri>) -> bool
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
pub fn ne(&self, other: &URIBuilder<'uri>) -> bool
pub fn ne(&self, other: &URIBuilder<'uri>) -> bool
This method tests for !=
.
impl<'uri> Eq for URIBuilder<'uri>
impl<'uri> StructuralEq for URIBuilder<'uri>
impl<'uri> StructuralPartialEq for URIBuilder<'uri>
Auto Trait Implementations
impl<'uri> RefUnwindSafe for URIBuilder<'uri>
impl<'uri> Send for URIBuilder<'uri>
impl<'uri> Sync for URIBuilder<'uri>
impl<'uri> Unpin for URIBuilder<'uri>
impl<'uri> UnwindSafe for URIBuilder<'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