Enum tract_pulse::internal::Cow 1.0.0[−][src]
pub enum Cow<'a, B> where
B: 'a + ToOwned + ?Sized, { Borrowed(&'a B), Owned(<B as ToOwned>::Owned), }
Expand description
A clone-on-write smart pointer.
The type Cow is a smart pointer providing clone-on-write functionality: it
can enclose and provide immutable access to borrowed data, and clone the
data lazily when mutation or ownership is required. The type is designed to
work with general borrowed data via the Borrow trait.
Cow implements Deref, which means that you can call
non-mutating methods directly on the data it encloses. If mutation
is desired, to_mut will obtain a mutable reference to an owned
value, cloning if necessary.
If you need reference-counting pointers, note that
Rc::make_mut and
Arc::make_mut can provide clone-on-write
functionality as well.
Examples
use std::borrow::Cow; fn abs_all(input: &mut Cow<[i32]>) { for i in 0..input.len() { let v = input[i]; if v < 0 { // Clones into a vector if not already owned. input.to_mut()[i] = -v; } } } // No clone occurs because `input` doesn't need to be mutated. let slice = [0, 1, 2]; let mut input = Cow::from(&slice[..]); abs_all(&mut input); // Clone occurs because `input` needs to be mutated. let slice = [-1, 0, 1]; let mut input = Cow::from(&slice[..]); abs_all(&mut input); // No clone occurs because `input` is already owned. let mut input = Cow::from(vec![-1, 0, 1]); abs_all(&mut input);
Another example showing how to keep Cow in a struct:
use std::borrow::Cow; struct Items<'a, X: 'a> where [X]: ToOwned<Owned = Vec<X>> { values: Cow<'a, [X]>, } impl<'a, X: Clone + 'a> Items<'a, X> where [X]: ToOwned<Owned = Vec<X>> { fn new(v: Cow<'a, [X]>) -> Self { Items { values: v } } } // Creates a container from borrowed values of a slice let readonly = [1, 2]; let borrowed = Items::new((&readonly[..]).into()); match borrowed { Items { values: Cow::Borrowed(b) } => println!("borrowed {:?}", b), _ => panic!("expect borrowed value"), } let mut clone_on_write = borrowed; // Mutates the data from slice into owned vec and pushes a new value on top clone_on_write.values.to_mut().push(3); println!("clone_on_write = {:?}", clone_on_write.values); // The data was mutated. Let check it out. match clone_on_write { Items { values: Cow::Owned(_) } => println!("clone_on_write contains owned data"), _ => panic!("expect owned data"), }
Variants
Borrowed(&'a B)Borrowed data.
Owned data.
Implementations
impl<'_, B> Cow<'_, B> where
B: ToOwned + ?Sized, [src]
impl<'_, B> Cow<'_, B> where
B: ToOwned + ?Sized, [src]pub const fn is_borrowed(&self) -> bool[src]
🔬 This is a nightly-only experimental API. (cow_is_borrowed)
pub const fn is_borrowed(&self) -> bool[src]cow_is_borrowed)Returns true if the data is borrowed, i.e. if to_mut would require additional work.
Examples
#![feature(cow_is_borrowed)] use std::borrow::Cow; let cow = Cow::Borrowed("moo"); assert!(cow.is_borrowed()); let bull: Cow<'_, str> = Cow::Owned("...moo?".to_string()); assert!(!bull.is_borrowed());
pub const fn is_owned(&self) -> bool[src]
🔬 This is a nightly-only experimental API. (cow_is_borrowed)
pub const fn is_owned(&self) -> bool[src]cow_is_borrowed)Returns true if the data is owned, i.e. if to_mut would be a no-op.
Examples
#![feature(cow_is_borrowed)] use std::borrow::Cow; let cow: Cow<'_, str> = Cow::Owned("moo".to_string()); assert!(cow.is_owned()); let bull = Cow::Borrowed("...moo?"); assert!(!bull.is_owned());
pub fn to_mut(&mut self) -> &mut <B as ToOwned>::Owned[src]
pub fn to_mut(&mut self) -> &mut <B as ToOwned>::Owned[src]Acquires a mutable reference to the owned form of the data.
Clones the data if it is not already owned.
Examples
use std::borrow::Cow; let mut cow = Cow::Borrowed("foo"); cow.to_mut().make_ascii_uppercase(); assert_eq!( cow, Cow::Owned(String::from("FOO")) as Cow<str> );
pub fn into_owned(self) -> <B as ToOwned>::Owned[src]
pub fn into_owned(self) -> <B as ToOwned>::Owned[src]Extracts the owned data.
Clones the data if it is not already owned.
Examples
Calling into_owned on a Cow::Borrowed clones the underlying data
and becomes a Cow::Owned:
use std::borrow::Cow; let s = "Hello world!"; let cow = Cow::Borrowed(s); assert_eq!( cow.into_owned(), String::from(s) );
Calling into_owned on a Cow::Owned is a no-op:
use std::borrow::Cow; let s = "Hello world!"; let cow: Cow<str> = Cow::Owned(String::from(s)); assert_eq!( cow.into_owned(), String::from(s) );
Trait Implementations
impl<'a> AddAssign<&'a str> for Cow<'a, str>1.14.0[src]
impl<'a> AddAssign<&'a str> for Cow<'a, str>1.14.0[src]pub fn add_assign(&mut self, rhs: &'a str)[src]
pub fn add_assign(&mut self, rhs: &'a str)[src]Performs the += operation. Read more
impl<'a> AddAssign<Cow<'a, str>> for Cow<'a, str>1.14.0[src]
impl<'a> AddAssign<Cow<'a, str>> for Cow<'a, str>1.14.0[src]pub fn add_assign(&mut self, rhs: Cow<'a, str>)[src]
pub fn add_assign(&mut self, rhs: Cow<'a, str>)[src]Performs the += operation. Read more
impl<'_, B> Debug for Cow<'_, B> where
B: Debug + ToOwned + ?Sized,
<B as ToOwned>::Owned: Debug, [src]
impl<'_, B> Debug for Cow<'_, B> where
B: Debug + ToOwned + ?Sized,
<B as ToOwned>::Owned: Debug, [src]impl<'_, B> Default for Cow<'_, B> where
B: ToOwned + ?Sized,
<B as ToOwned>::Owned: Default, 1.11.0[src]
impl<'_, B> Default for Cow<'_, B> where
B: ToOwned + ?Sized,
<B as ToOwned>::Owned: Default, 1.11.0[src]impl<'_, B> Display for Cow<'_, B> where
B: Display + ToOwned + ?Sized,
<B as ToOwned>::Owned: Display, [src]
impl<'_, B> Display for Cow<'_, B> where
B: Display + ToOwned + ?Sized,
<B as ToOwned>::Owned: Display, [src]impl<'a> Extend<Cow<'a, OsStr>> for OsString1.52.0[src]
impl<'a> Extend<Cow<'a, OsStr>> for OsString1.52.0[src]pub fn extend<T>(&mut self, iter: T) where
T: IntoIterator<Item = Cow<'a, OsStr>>, [src]
pub fn extend<T>(&mut self, iter: T) where
T: IntoIterator<Item = Cow<'a, OsStr>>, [src]Extends a collection with the contents of an iterator. Read more
fn extend_one(&mut self, item: A)[src]
fn extend_one(&mut self, item: A)[src]extend_one)Extends a collection with exactly one element.
fn extend_reserve(&mut self, additional: usize)[src]
fn extend_reserve(&mut self, additional: usize)[src]extend_one)Reserves capacity in a collection for the given number of additional elements. Read more
impl<'a> Extend<Cow<'a, str>> for String1.19.0[src]
impl<'a> Extend<Cow<'a, str>> for String1.19.0[src]pub fn extend<I>(&mut self, iter: I) where
I: IntoIterator<Item = Cow<'a, str>>, [src]
pub fn extend<I>(&mut self, iter: I) where
I: IntoIterator<Item = Cow<'a, str>>, [src]Extends a collection with the contents of an iterator. Read more
pub fn extend_one(&mut self, s: Cow<'a, str>)[src]
pub fn extend_one(&mut self, s: Cow<'a, str>)[src]extend_one)Extends a collection with exactly one element.
fn extend_reserve(&mut self, additional: usize)[src]
fn extend_reserve(&mut self, additional: usize)[src]extend_one)Reserves capacity in a collection for the given number of additional elements. Read more
impl<'_, T> From<Cow<'_, [T]>> for Box<[T], Global> where
T: Copy, 1.45.0[src]
impl<'_, T> From<Cow<'_, [T]>> for Box<[T], Global> where
T: Copy, 1.45.0[src]pub fn from(cow: Cow<'_, [T]>) -> Box<[T], Global>ⓘNotable traits for Box<W, Global>
impl<W> Write for Box<W, Global> where
W: Write + ?Sized, impl<R> Read for Box<R, Global> where
R: Read + ?Sized, impl<F, A> Future for Box<F, A> where
A: Allocator + 'static,
F: Future + Unpin + ?Sized, type Output = <F as Future>::Output;impl<I, A> Iterator for Box<I, A> where
A: Allocator,
I: Iterator + ?Sized, type Item = <I as Iterator>::Item;[src]
pub fn from(cow: Cow<'_, [T]>) -> Box<[T], Global>ⓘNotable traits for Box<W, Global>
impl<W> Write for Box<W, Global> where
W: Write + ?Sized, impl<R> Read for Box<R, Global> where
R: Read + ?Sized, impl<F, A> Future for Box<F, A> where
A: Allocator + 'static,
F: Future + Unpin + ?Sized, type Output = <F as Future>::Output;impl<I, A> Iterator for Box<I, A> where
A: Allocator,
I: Iterator + ?Sized, type Item = <I as Iterator>::Item;[src]Performs the conversion.
impl<'_> From<Cow<'_, CStr>> for Box<CStr, Global>1.45.0[src]
impl<'_> From<Cow<'_, CStr>> for Box<CStr, Global>1.45.0[src]pub fn from(cow: Cow<'_, CStr>) -> Box<CStr, Global>ⓘNotable traits for Box<W, Global>
impl<W> Write for Box<W, Global> where
W: Write + ?Sized, impl<R> Read for Box<R, Global> where
R: Read + ?Sized, impl<F, A> Future for Box<F, A> where
A: Allocator + 'static,
F: Future + Unpin + ?Sized, type Output = <F as Future>::Output;impl<I, A> Iterator for Box<I, A> where
A: Allocator,
I: Iterator + ?Sized, type Item = <I as Iterator>::Item;[src]
pub fn from(cow: Cow<'_, CStr>) -> Box<CStr, Global>ⓘNotable traits for Box<W, Global>
impl<W> Write for Box<W, Global> where
W: Write + ?Sized, impl<R> Read for Box<R, Global> where
R: Read + ?Sized, impl<F, A> Future for Box<F, A> where
A: Allocator + 'static,
F: Future + Unpin + ?Sized, type Output = <F as Future>::Output;impl<I, A> Iterator for Box<I, A> where
A: Allocator,
I: Iterator + ?Sized, type Item = <I as Iterator>::Item;[src]Performs the conversion.
impl<'_> From<Cow<'_, OsStr>> for Box<OsStr, Global>1.45.0[src]
impl<'_> From<Cow<'_, OsStr>> for Box<OsStr, Global>1.45.0[src]pub fn from(cow: Cow<'_, OsStr>) -> Box<OsStr, Global>ⓘNotable traits for Box<W, Global>
impl<W> Write for Box<W, Global> where
W: Write + ?Sized, impl<R> Read for Box<R, Global> where
R: Read + ?Sized, impl<F, A> Future for Box<F, A> where
A: Allocator + 'static,
F: Future + Unpin + ?Sized, type Output = <F as Future>::Output;impl<I, A> Iterator for Box<I, A> where
A: Allocator,
I: Iterator + ?Sized, type Item = <I as Iterator>::Item;[src]
pub fn from(cow: Cow<'_, OsStr>) -> Box<OsStr, Global>ⓘNotable traits for Box<W, Global>
impl<W> Write for Box<W, Global> where
W: Write + ?Sized, impl<R> Read for Box<R, Global> where
R: Read + ?Sized, impl<F, A> Future for Box<F, A> where
A: Allocator + 'static,
F: Future + Unpin + ?Sized, type Output = <F as Future>::Output;impl<I, A> Iterator for Box<I, A> where
A: Allocator,
I: Iterator + ?Sized, type Item = <I as Iterator>::Item;[src]Performs the conversion.
impl<'_> From<Cow<'_, Path>> for Box<Path, Global>1.45.0[src]
impl<'_> From<Cow<'_, Path>> for Box<Path, Global>1.45.0[src]pub fn from(cow: Cow<'_, Path>) -> Box<Path, Global>ⓘNotable traits for Box<W, Global>
impl<W> Write for Box<W, Global> where
W: Write + ?Sized, impl<R> Read for Box<R, Global> where
R: Read + ?Sized, impl<F, A> Future for Box<F, A> where
A: Allocator + 'static,
F: Future + Unpin + ?Sized, type Output = <F as Future>::Output;impl<I, A> Iterator for Box<I, A> where
A: Allocator,
I: Iterator + ?Sized, type Item = <I as Iterator>::Item;[src]
pub fn from(cow: Cow<'_, Path>) -> Box<Path, Global>ⓘNotable traits for Box<W, Global>
impl<W> Write for Box<W, Global> where
W: Write + ?Sized, impl<R> Read for Box<R, Global> where
R: Read + ?Sized, impl<F, A> Future for Box<F, A> where
A: Allocator + 'static,
F: Future + Unpin + ?Sized, type Output = <F as Future>::Output;impl<I, A> Iterator for Box<I, A> where
A: Allocator,
I: Iterator + ?Sized, type Item = <I as Iterator>::Item;[src]Performs the conversion.
impl<'_> From<Cow<'_, str>> for Box<str, Global>1.45.0[src]
impl<'_> From<Cow<'_, str>> for Box<str, Global>1.45.0[src]pub fn from(cow: Cow<'_, str>) -> Box<str, Global>ⓘNotable traits for Box<W, Global>
impl<W> Write for Box<W, Global> where
W: Write + ?Sized, impl<R> Read for Box<R, Global> where
R: Read + ?Sized, impl<F, A> Future for Box<F, A> where
A: Allocator + 'static,
F: Future + Unpin + ?Sized, type Output = <F as Future>::Output;impl<I, A> Iterator for Box<I, A> where
A: Allocator,
I: Iterator + ?Sized, type Item = <I as Iterator>::Item;[src]
pub fn from(cow: Cow<'_, str>) -> Box<str, Global>ⓘNotable traits for Box<W, Global>
impl<W> Write for Box<W, Global> where
W: Write + ?Sized, impl<R> Read for Box<R, Global> where
R: Read + ?Sized, impl<F, A> Future for Box<F, A> where
A: Allocator + 'static,
F: Future + Unpin + ?Sized, type Output = <F as Future>::Output;impl<I, A> Iterator for Box<I, A> where
A: Allocator,
I: Iterator + ?Sized, type Item = <I as Iterator>::Item;[src]Performs the conversion.
impl<'a, T> From<Cow<'a, [T]>> for Vec<T, Global> where
[T]: ToOwned,
<[T] as ToOwned>::Owned == Vec<T, Global>, 1.14.0[src]
impl<'a, T> From<Cow<'a, [T]>> for Vec<T, Global> where
[T]: ToOwned,
<[T] as ToOwned>::Owned == Vec<T, Global>, 1.14.0[src]pub fn from(s: Cow<'a, [T]>) -> Vec<T, Global>ⓘ[src]
pub fn from(s: Cow<'a, [T]>) -> Vec<T, Global>ⓘ[src]Convert a clone-on-write slice into a vector.
If s already owns a Vec<T>, it will be returned directly.
If s is borrowing a slice, a new Vec<T> will be allocated and
filled by cloning s’s items into it.
Examples
let o: Cow<[i32]> = Cow::Owned(vec![1, 2, 3]); let b: Cow<[i32]> = Cow::Borrowed(&[1, 2, 3]); assert_eq!(Vec::from(o), Vec::from(b));
impl<'a, B> From<Cow<'a, B>> for Rc<B> where
B: ToOwned + ?Sized,
Rc<B>: From<&'a B>,
Rc<B>: From<<B as ToOwned>::Owned>, 1.45.0[src]
impl<'a, B> From<Cow<'a, B>> for Rc<B> where
B: ToOwned + ?Sized,
Rc<B>: From<&'a B>,
Rc<B>: From<<B as ToOwned>::Owned>, 1.45.0[src]impl<'a, B> From<Cow<'a, B>> for Arc<B> where
B: ToOwned + ?Sized,
Arc<B>: From<&'a B>,
Arc<B>: From<<B as ToOwned>::Owned>, 1.45.0[src]
impl<'a, B> From<Cow<'a, B>> for Arc<B> where
B: ToOwned + ?Sized,
Arc<B>: From<&'a B>,
Arc<B>: From<<B as ToOwned>::Owned>, 1.45.0[src]impl<'a> From<Cow<'a, str>> for Box<dyn Error + 'static, Global>1.22.0[src]
impl<'a> From<Cow<'a, str>> for Box<dyn Error + 'static, Global>1.22.0[src]pub fn from(err: Cow<'a, str>) -> Box<dyn Error + 'static, Global>ⓘNotable traits for Box<W, Global>
impl<W> Write for Box<W, Global> where
W: Write + ?Sized, impl<R> Read for Box<R, Global> where
R: Read + ?Sized, impl<F, A> Future for Box<F, A> where
A: Allocator + 'static,
F: Future + Unpin + ?Sized, type Output = <F as Future>::Output;impl<I, A> Iterator for Box<I, A> where
A: Allocator,
I: Iterator + ?Sized, type Item = <I as Iterator>::Item;[src]
pub fn from(err: Cow<'a, str>) -> Box<dyn Error + 'static, Global>ⓘNotable traits for Box<W, Global>
impl<W> Write for Box<W, Global> where
W: Write + ?Sized, impl<R> Read for Box<R, Global> where
R: Read + ?Sized, impl<F, A> Future for Box<F, A> where
A: Allocator + 'static,
F: Future + Unpin + ?Sized, type Output = <F as Future>::Output;impl<I, A> Iterator for Box<I, A> where
A: Allocator,
I: Iterator + ?Sized, type Item = <I as Iterator>::Item;[src]impl<'a, 'b> From<Cow<'b, str>> for Box<dyn Error + 'a + Sync + Send, Global>1.22.0[src]
impl<'a, 'b> From<Cow<'b, str>> for Box<dyn Error + 'a + Sync + Send, Global>1.22.0[src]pub fn from(err: Cow<'b, str>) -> Box<dyn Error + 'a + Sync + Send, Global>ⓘNotable traits for Box<W, Global>
impl<W> Write for Box<W, Global> where
W: Write + ?Sized, impl<R> Read for Box<R, Global> where
R: Read + ?Sized, impl<F, A> Future for Box<F, A> where
A: Allocator + 'static,
F: Future + Unpin + ?Sized, type Output = <F as Future>::Output;impl<I, A> Iterator for Box<I, A> where
A: Allocator,
I: Iterator + ?Sized, type Item = <I as Iterator>::Item;[src]
pub fn from(err: Cow<'b, str>) -> Box<dyn Error + 'a + Sync + Send, Global>ⓘNotable traits for Box<W, Global>
impl<W> Write for Box<W, Global> where
W: Write + ?Sized, impl<R> Read for Box<R, Global> where
R: Read + ?Sized, impl<F, A> Future for Box<F, A> where
A: Allocator + 'static,
F: Future + Unpin + ?Sized, type Output = <F as Future>::Output;impl<I, A> Iterator for Box<I, A> where
A: Allocator,
I: Iterator + ?Sized, type Item = <I as Iterator>::Item;[src]Converts a Cow into a box of dyn Error + Send + Sync.
Examples
use std::error::Error; use std::mem; use std::borrow::Cow; let a_cow_str_error = Cow::from("a str error"); let a_boxed_error = Box::<dyn Error + Send + Sync>::from(a_cow_str_error); assert!( mem::size_of::<Box<dyn Error + Send + Sync>>() == mem::size_of_val(&a_boxed_error))
impl<'a, 'b> FromIterator<&'b str> for Cow<'a, str>1.12.0[src]
impl<'a, 'b> FromIterator<&'b str> for Cow<'a, str>1.12.0[src]impl<'a> FromIterator<Cow<'a, OsStr>> for OsString1.52.0[src]
impl<'a> FromIterator<Cow<'a, OsStr>> for OsString1.52.0[src]impl<'a> FromIterator<Cow<'a, str>> for String1.19.0[src]
impl<'a> FromIterator<Cow<'a, str>> for String1.19.0[src]impl<'a> FromIterator<String> for Cow<'a, str>1.12.0[src]
impl<'a> FromIterator<String> for Cow<'a, str>1.12.0[src]impl<'a> FromIterator<char> for Cow<'a, str>1.12.0[src]
impl<'a> FromIterator<char> for Cow<'a, str>1.12.0[src]impl<'_, B> Ord for Cow<'_, B> where
B: Ord + ToOwned + ?Sized, [src]
impl<'_, B> Ord for Cow<'_, B> where
B: Ord + ToOwned + ?Sized, [src]impl<'a, 'b, B, C> PartialEq<Cow<'b, C>> for Cow<'a, B> where
C: ToOwned + ?Sized,
B: PartialEq<C> + ToOwned + ?Sized, [src]
impl<'a, 'b, B, C> PartialEq<Cow<'b, C>> for Cow<'a, B> where
C: ToOwned + ?Sized,
B: PartialEq<C> + ToOwned + ?Sized, [src]impl<'_, T, U, A> PartialEq<Vec<U, A>> for Cow<'_, [T]> where
T: PartialEq<U> + Clone,
A: Allocator, [src]
impl<'_, T, U, A> PartialEq<Vec<U, A>> for Cow<'_, [T]> where
T: PartialEq<U> + Clone,
A: Allocator, [src]impl<'a, 'b> PartialOrd<&'a Path> for Cow<'b, OsStr>1.8.0[src]
impl<'a, 'b> PartialOrd<&'a Path> for Cow<'b, OsStr>1.8.0[src]pub fn partial_cmp(&self, other: &&'a Path) -> Option<Ordering>[src]
pub fn partial_cmp(&self, other: &&'a Path) -> Option<Ordering>[src]This method returns an ordering between self and other values if one exists. Read more
#[must_use]fn lt(&self, other: &Rhs) -> bool[src]
#[must_use]fn lt(&self, other: &Rhs) -> bool[src]This method tests less than (for self and other) and is used by the < operator. Read more
#[must_use]fn le(&self, other: &Rhs) -> bool[src]
#[must_use]fn le(&self, other: &Rhs) -> bool[src]This method tests less than or equal to (for self and other) and is used by the <=
operator. Read more
impl<'a, 'b> PartialOrd<&'b OsStr> for Cow<'a, OsStr>1.8.0[src]
impl<'a, 'b> PartialOrd<&'b OsStr> for Cow<'a, OsStr>1.8.0[src]pub fn partial_cmp(&self, other: &&'b OsStr) -> Option<Ordering>[src]
pub fn partial_cmp(&self, other: &&'b OsStr) -> Option<Ordering>[src]This method returns an ordering between self and other values if one exists. Read more
#[must_use]fn lt(&self, other: &Rhs) -> bool[src]
#[must_use]fn lt(&self, other: &Rhs) -> bool[src]This method tests less than (for self and other) and is used by the < operator. Read more
#[must_use]fn le(&self, other: &Rhs) -> bool[src]
#[must_use]fn le(&self, other: &Rhs) -> bool[src]This method tests less than or equal to (for self and other) and is used by the <=
operator. Read more
impl<'a, 'b> PartialOrd<&'b OsStr> for Cow<'a, Path>1.8.0[src]
impl<'a, 'b> PartialOrd<&'b OsStr> for Cow<'a, Path>1.8.0[src]pub fn partial_cmp(&self, other: &&'b OsStr) -> Option<Ordering>[src]
pub fn partial_cmp(&self, other: &&'b OsStr) -> Option<Ordering>[src]This method returns an ordering between self and other values if one exists. Read more
#[must_use]fn lt(&self, other: &Rhs) -> bool[src]
#[must_use]fn lt(&self, other: &Rhs) -> bool[src]This method tests less than (for self and other) and is used by the < operator. Read more
#[must_use]fn le(&self, other: &Rhs) -> bool[src]
#[must_use]fn le(&self, other: &Rhs) -> bool[src]This method tests less than or equal to (for self and other) and is used by the <=
operator. Read more
impl<'a, 'b> PartialOrd<&'b Path> for Cow<'a, Path>1.8.0[src]
impl<'a, 'b> PartialOrd<&'b Path> for Cow<'a, Path>1.8.0[src]pub fn partial_cmp(&self, other: &&'b Path) -> Option<Ordering>[src]
pub fn partial_cmp(&self, other: &&'b Path) -> Option<Ordering>[src]This method returns an ordering between self and other values if one exists. Read more
#[must_use]fn lt(&self, other: &Rhs) -> bool[src]
#[must_use]fn lt(&self, other: &Rhs) -> bool[src]This method tests less than (for self and other) and is used by the < operator. Read more
#[must_use]fn le(&self, other: &Rhs) -> bool[src]
#[must_use]fn le(&self, other: &Rhs) -> bool[src]This method tests less than or equal to (for self and other) and is used by the <=
operator. Read more
impl<'a, B> PartialOrd<Cow<'a, B>> for Cow<'a, B> where
B: PartialOrd<B> + ToOwned + ?Sized, [src]
impl<'a, B> PartialOrd<Cow<'a, B>> for Cow<'a, B> where
B: PartialOrd<B> + ToOwned + ?Sized, [src]pub fn partial_cmp(&self, other: &Cow<'a, B>) -> Option<Ordering>[src]
pub fn partial_cmp(&self, other: &Cow<'a, B>) -> Option<Ordering>[src]This method returns an ordering between self and other values if one exists. Read more
#[must_use]fn lt(&self, other: &Rhs) -> bool[src]
#[must_use]fn lt(&self, other: &Rhs) -> bool[src]This method tests less than (for self and other) and is used by the < operator. Read more
#[must_use]fn le(&self, other: &Rhs) -> bool[src]
#[must_use]fn le(&self, other: &Rhs) -> bool[src]This method tests less than or equal to (for self and other) and is used by the <=
operator. Read more
impl<'a, 'b> PartialOrd<Cow<'a, OsStr>> for OsStr1.8.0[src]
impl<'a, 'b> PartialOrd<Cow<'a, OsStr>> for OsStr1.8.0[src]pub fn partial_cmp(&self, other: &Cow<'a, OsStr>) -> Option<Ordering>[src]
pub fn partial_cmp(&self, other: &Cow<'a, OsStr>) -> Option<Ordering>[src]This method returns an ordering between self and other values if one exists. Read more
#[must_use]fn lt(&self, other: &Rhs) -> bool[src]
#[must_use]fn lt(&self, other: &Rhs) -> bool[src]This method tests less than (for self and other) and is used by the < operator. Read more
#[must_use]fn le(&self, other: &Rhs) -> bool[src]
#[must_use]fn le(&self, other: &Rhs) -> bool[src]This method tests less than or equal to (for self and other) and is used by the <=
operator. Read more
impl<'a, 'b> PartialOrd<Cow<'a, OsStr>> for Path1.8.0[src]
impl<'a, 'b> PartialOrd<Cow<'a, OsStr>> for Path1.8.0[src]pub fn partial_cmp(&self, other: &Cow<'a, OsStr>) -> Option<Ordering>[src]
pub fn partial_cmp(&self, other: &Cow<'a, OsStr>) -> Option<Ordering>[src]This method returns an ordering between self and other values if one exists. Read more
#[must_use]fn lt(&self, other: &Rhs) -> bool[src]
#[must_use]fn lt(&self, other: &Rhs) -> bool[src]This method tests less than (for self and other) and is used by the < operator. Read more
#[must_use]fn le(&self, other: &Rhs) -> bool[src]
#[must_use]fn le(&self, other: &Rhs) -> bool[src]This method tests less than or equal to (for self and other) and is used by the <=
operator. Read more
impl<'a, 'b> PartialOrd<Cow<'a, OsStr>> for OsString1.8.0[src]
impl<'a, 'b> PartialOrd<Cow<'a, OsStr>> for OsString1.8.0[src]pub fn partial_cmp(&self, other: &Cow<'a, OsStr>) -> Option<Ordering>[src]
pub fn partial_cmp(&self, other: &Cow<'a, OsStr>) -> Option<Ordering>[src]This method returns an ordering between self and other values if one exists. Read more
#[must_use]fn lt(&self, other: &Rhs) -> bool[src]
#[must_use]fn lt(&self, other: &Rhs) -> bool[src]This method tests less than (for self and other) and is used by the < operator. Read more
#[must_use]fn le(&self, other: &Rhs) -> bool[src]
#[must_use]fn le(&self, other: &Rhs) -> bool[src]This method tests less than or equal to (for self and other) and is used by the <=
operator. Read more
impl<'a, 'b> PartialOrd<Cow<'a, OsStr>> for &'b OsStr1.8.0[src]
impl<'a, 'b> PartialOrd<Cow<'a, OsStr>> for &'b OsStr1.8.0[src]pub fn partial_cmp(&self, other: &Cow<'a, OsStr>) -> Option<Ordering>[src]
pub fn partial_cmp(&self, other: &Cow<'a, OsStr>) -> Option<Ordering>[src]This method returns an ordering between self and other values if one exists. Read more
#[must_use]fn lt(&self, other: &Rhs) -> bool[src]
#[must_use]fn lt(&self, other: &Rhs) -> bool[src]This method tests less than (for self and other) and is used by the < operator. Read more
#[must_use]fn le(&self, other: &Rhs) -> bool[src]
#[must_use]fn le(&self, other: &Rhs) -> bool[src]This method tests less than or equal to (for self and other) and is used by the <=
operator. Read more
impl<'a, 'b> PartialOrd<Cow<'a, OsStr>> for PathBuf1.8.0[src]
impl<'a, 'b> PartialOrd<Cow<'a, OsStr>> for PathBuf1.8.0[src]pub fn partial_cmp(&self, other: &Cow<'a, OsStr>) -> Option<Ordering>[src]
pub fn partial_cmp(&self, other: &Cow<'a, OsStr>) -> Option<Ordering>[src]This method returns an ordering between self and other values if one exists. Read more
#[must_use]fn lt(&self, other: &Rhs) -> bool[src]
#[must_use]fn lt(&self, other: &Rhs) -> bool[src]This method tests less than (for self and other) and is used by the < operator. Read more
#[must_use]fn le(&self, other: &Rhs) -> bool[src]
#[must_use]fn le(&self, other: &Rhs) -> bool[src]This method tests less than or equal to (for self and other) and is used by the <=
operator. Read more
impl<'a, 'b> PartialOrd<Cow<'a, Path>> for OsStr1.8.0[src]
impl<'a, 'b> PartialOrd<Cow<'a, Path>> for OsStr1.8.0[src]pub fn partial_cmp(&self, other: &Cow<'a, Path>) -> Option<Ordering>[src]
pub fn partial_cmp(&self, other: &Cow<'a, Path>) -> Option<Ordering>[src]This method returns an ordering between self and other values if one exists. Read more
#[must_use]fn lt(&self, other: &Rhs) -> bool[src]
#[must_use]fn lt(&self, other: &Rhs) -> bool[src]This method tests less than (for self and other) and is used by the < operator. Read more
#[must_use]fn le(&self, other: &Rhs) -> bool[src]
#[must_use]fn le(&self, other: &Rhs) -> bool[src]This method tests less than or equal to (for self and other) and is used by the <=
operator. Read more
impl<'a, 'b> PartialOrd<Cow<'a, Path>> for Path1.8.0[src]
impl<'a, 'b> PartialOrd<Cow<'a, Path>> for Path1.8.0[src]pub fn partial_cmp(&self, other: &Cow<'a, Path>) -> Option<Ordering>[src]
pub fn partial_cmp(&self, other: &Cow<'a, Path>) -> Option<Ordering>[src]This method returns an ordering between self and other values if one exists. Read more
#[must_use]fn lt(&self, other: &Rhs) -> bool[src]
#[must_use]fn lt(&self, other: &Rhs) -> bool[src]This method tests less than (for self and other) and is used by the < operator. Read more
#[must_use]fn le(&self, other: &Rhs) -> bool[src]
#[must_use]fn le(&self, other: &Rhs) -> bool[src]This method tests less than or equal to (for self and other) and is used by the <=
operator. Read more
impl<'a, 'b> PartialOrd<Cow<'a, Path>> for &'b OsStr1.8.0[src]
impl<'a, 'b> PartialOrd<Cow<'a, Path>> for &'b OsStr1.8.0[src]pub fn partial_cmp(&self, other: &Cow<'a, Path>) -> Option<Ordering>[src]
pub fn partial_cmp(&self, other: &Cow<'a, Path>) -> Option<Ordering>[src]This method returns an ordering between self and other values if one exists. Read more
#[must_use]fn lt(&self, other: &Rhs) -> bool[src]
#[must_use]fn lt(&self, other: &Rhs) -> bool[src]This method tests less than (for self and other) and is used by the < operator. Read more
#[must_use]fn le(&self, other: &Rhs) -> bool[src]
#[must_use]fn le(&self, other: &Rhs) -> bool[src]This method tests less than or equal to (for self and other) and is used by the <=
operator. Read more
impl<'a, 'b> PartialOrd<Cow<'a, Path>> for OsString1.8.0[src]
impl<'a, 'b> PartialOrd<Cow<'a, Path>> for OsString1.8.0[src]pub fn partial_cmp(&self, other: &Cow<'a, Path>) -> Option<Ordering>[src]
pub fn partial_cmp(&self, other: &Cow<'a, Path>) -> Option<Ordering>[src]This method returns an ordering between self and other values if one exists. Read more
#[must_use]fn lt(&self, other: &Rhs) -> bool[src]
#[must_use]fn lt(&self, other: &Rhs) -> bool[src]This method tests less than (for self and other) and is used by the < operator. Read more
#[must_use]fn le(&self, other: &Rhs) -> bool[src]
#[must_use]fn le(&self, other: &Rhs) -> bool[src]This method tests less than or equal to (for self and other) and is used by the <=
operator. Read more
impl<'a, 'b> PartialOrd<Cow<'a, Path>> for &'b Path1.8.0[src]
impl<'a, 'b> PartialOrd<Cow<'a, Path>> for &'b Path1.8.0[src]pub fn partial_cmp(&self, other: &Cow<'a, Path>) -> Option<Ordering>[src]
pub fn partial_cmp(&self, other: &Cow<'a, Path>) -> Option<Ordering>[src]This method returns an ordering between self and other values if one exists. Read more
#[must_use]fn lt(&self, other: &Rhs) -> bool[src]
#[must_use]fn lt(&self, other: &Rhs) -> bool[src]This method tests less than (for self and other) and is used by the < operator. Read more
#[must_use]fn le(&self, other: &Rhs) -> bool[src]
#[must_use]fn le(&self, other: &Rhs) -> bool[src]This method tests less than or equal to (for self and other) and is used by the <=
operator. Read more
impl<'a, 'b> PartialOrd<Cow<'a, Path>> for PathBuf1.8.0[src]
impl<'a, 'b> PartialOrd<Cow<'a, Path>> for PathBuf1.8.0[src]pub fn partial_cmp(&self, other: &Cow<'a, Path>) -> Option<Ordering>[src]
pub fn partial_cmp(&self, other: &Cow<'a, Path>) -> Option<Ordering>[src]This method returns an ordering between self and other values if one exists. Read more
#[must_use]fn lt(&self, other: &Rhs) -> bool[src]
#[must_use]fn lt(&self, other: &Rhs) -> bool[src]This method tests less than (for self and other) and is used by the < operator. Read more
#[must_use]fn le(&self, other: &Rhs) -> bool[src]
#[must_use]fn le(&self, other: &Rhs) -> bool[src]This method tests less than or equal to (for self and other) and is used by the <=
operator. Read more
impl<'a, 'b> PartialOrd<Cow<'b, OsStr>> for &'a Path1.8.0[src]
impl<'a, 'b> PartialOrd<Cow<'b, OsStr>> for &'a Path1.8.0[src]pub fn partial_cmp(&self, other: &Cow<'b, OsStr>) -> Option<Ordering>[src]
pub fn partial_cmp(&self, other: &Cow<'b, OsStr>) -> Option<Ordering>[src]This method returns an ordering between self and other values if one exists. Read more
#[must_use]fn lt(&self, other: &Rhs) -> bool[src]
#[must_use]fn lt(&self, other: &Rhs) -> bool[src]This method tests less than (for self and other) and is used by the < operator. Read more
#[must_use]fn le(&self, other: &Rhs) -> bool[src]
#[must_use]fn le(&self, other: &Rhs) -> bool[src]This method tests less than or equal to (for self and other) and is used by the <=
operator. Read more
impl<'a, 'b> PartialOrd<OsStr> for Cow<'a, OsStr>1.8.0[src]
impl<'a, 'b> PartialOrd<OsStr> for Cow<'a, OsStr>1.8.0[src]pub fn partial_cmp(&self, other: &OsStr) -> Option<Ordering>[src]
pub fn partial_cmp(&self, other: &OsStr) -> Option<Ordering>[src]This method returns an ordering between self and other values if one exists. Read more
#[must_use]fn lt(&self, other: &Rhs) -> bool[src]
#[must_use]fn lt(&self, other: &Rhs) -> bool[src]This method tests less than (for self and other) and is used by the < operator. Read more
#[must_use]fn le(&self, other: &Rhs) -> bool[src]
#[must_use]fn le(&self, other: &Rhs) -> bool[src]This method tests less than or equal to (for self and other) and is used by the <=
operator. Read more
impl<'a, 'b> PartialOrd<OsStr> for Cow<'a, Path>1.8.0[src]
impl<'a, 'b> PartialOrd<OsStr> for Cow<'a, Path>1.8.0[src]pub fn partial_cmp(&self, other: &OsStr) -> Option<Ordering>[src]
pub fn partial_cmp(&self, other: &OsStr) -> Option<Ordering>[src]This method returns an ordering between self and other values if one exists. Read more
#[must_use]fn lt(&self, other: &Rhs) -> bool[src]
#[must_use]fn lt(&self, other: &Rhs) -> bool[src]This method tests less than (for self and other) and is used by the < operator. Read more
#[must_use]fn le(&self, other: &Rhs) -> bool[src]
#[must_use]fn le(&self, other: &Rhs) -> bool[src]This method tests less than or equal to (for self and other) and is used by the <=
operator. Read more
impl<'a, 'b> PartialOrd<OsString> for Cow<'a, OsStr>1.8.0[src]
impl<'a, 'b> PartialOrd<OsString> for Cow<'a, OsStr>1.8.0[src]pub fn partial_cmp(&self, other: &OsString) -> Option<Ordering>[src]
pub fn partial_cmp(&self, other: &OsString) -> Option<Ordering>[src]This method returns an ordering between self and other values if one exists. Read more
#[must_use]fn lt(&self, other: &Rhs) -> bool[src]
#[must_use]fn lt(&self, other: &Rhs) -> bool[src]This method tests less than (for self and other) and is used by the < operator. Read more
#[must_use]fn le(&self, other: &Rhs) -> bool[src]
#[must_use]fn le(&self, other: &Rhs) -> bool[src]This method tests less than or equal to (for self and other) and is used by the <=
operator. Read more
impl<'a, 'b> PartialOrd<OsString> for Cow<'a, Path>1.8.0[src]
impl<'a, 'b> PartialOrd<OsString> for Cow<'a, Path>1.8.0[src]pub fn partial_cmp(&self, other: &OsString) -> Option<Ordering>[src]
pub fn partial_cmp(&self, other: &OsString) -> Option<Ordering>[src]This method returns an ordering between self and other values if one exists. Read more
#[must_use]fn lt(&self, other: &Rhs) -> bool[src]
#[must_use]fn lt(&self, other: &Rhs) -> bool[src]This method tests less than (for self and other) and is used by the < operator. Read more
#[must_use]fn le(&self, other: &Rhs) -> bool[src]
#[must_use]fn le(&self, other: &Rhs) -> bool[src]This method tests less than or equal to (for self and other) and is used by the <=
operator. Read more
impl<'a, 'b> PartialOrd<Path> for Cow<'a, Path>1.8.0[src]
impl<'a, 'b> PartialOrd<Path> for Cow<'a, Path>1.8.0[src]pub fn partial_cmp(&self, other: &Path) -> Option<Ordering>[src]
pub fn partial_cmp(&self, other: &Path) -> Option<Ordering>[src]This method returns an ordering between self and other values if one exists. Read more
#[must_use]fn lt(&self, other: &Rhs) -> bool[src]
#[must_use]fn lt(&self, other: &Rhs) -> bool[src]This method tests less than (for self and other) and is used by the < operator. Read more
#[must_use]fn le(&self, other: &Rhs) -> bool[src]
#[must_use]fn le(&self, other: &Rhs) -> bool[src]This method tests less than or equal to (for self and other) and is used by the <=
operator. Read more
impl<'a, 'b> PartialOrd<Path> for Cow<'a, OsStr>1.8.0[src]
impl<'a, 'b> PartialOrd<Path> for Cow<'a, OsStr>1.8.0[src]pub fn partial_cmp(&self, other: &Path) -> Option<Ordering>[src]
pub fn partial_cmp(&self, other: &Path) -> Option<Ordering>[src]This method returns an ordering between self and other values if one exists. Read more
#[must_use]fn lt(&self, other: &Rhs) -> bool[src]
#[must_use]fn lt(&self, other: &Rhs) -> bool[src]This method tests less than (for self and other) and is used by the < operator. Read more
#[must_use]fn le(&self, other: &Rhs) -> bool[src]
#[must_use]fn le(&self, other: &Rhs) -> bool[src]This method tests less than or equal to (for self and other) and is used by the <=
operator. Read more
impl<'a, 'b> PartialOrd<PathBuf> for Cow<'a, OsStr>1.8.0[src]
impl<'a, 'b> PartialOrd<PathBuf> for Cow<'a, OsStr>1.8.0[src]pub fn partial_cmp(&self, other: &PathBuf) -> Option<Ordering>[src]
pub fn partial_cmp(&self, other: &PathBuf) -> Option<Ordering>[src]This method returns an ordering between self and other values if one exists. Read more
#[must_use]fn lt(&self, other: &Rhs) -> bool[src]
#[must_use]fn lt(&self, other: &Rhs) -> bool[src]This method tests less than (for self and other) and is used by the < operator. Read more
#[must_use]fn le(&self, other: &Rhs) -> bool[src]
#[must_use]fn le(&self, other: &Rhs) -> bool[src]This method tests less than or equal to (for self and other) and is used by the <=
operator. Read more
impl<'a, 'b> PartialOrd<PathBuf> for Cow<'a, Path>1.8.0[src]
impl<'a, 'b> PartialOrd<PathBuf> for Cow<'a, Path>1.8.0[src]pub fn partial_cmp(&self, other: &PathBuf) -> Option<Ordering>[src]
pub fn partial_cmp(&self, other: &PathBuf) -> Option<Ordering>[src]This method returns an ordering between self and other values if one exists. Read more
#[must_use]fn lt(&self, other: &Rhs) -> bool[src]
#[must_use]fn lt(&self, other: &Rhs) -> bool[src]This method tests less than (for self and other) and is used by the < operator. Read more
#[must_use]fn le(&self, other: &Rhs) -> bool[src]
#[must_use]fn le(&self, other: &Rhs) -> bool[src]This method tests less than or equal to (for self and other) and is used by the <=
operator. Read more
impl<'_, B> Eq for Cow<'_, B> where
B: Eq + ToOwned + ?Sized, [src]
B: Eq + ToOwned + ?Sized,
Auto Trait Implementations
impl<'a, B: ?Sized> RefUnwindSafe for Cow<'a, B> where
B: RefUnwindSafe,
<B as ToOwned>::Owned: RefUnwindSafe,
B: RefUnwindSafe,
<B as ToOwned>::Owned: RefUnwindSafe,
impl<'a, B: ?Sized> Send for Cow<'a, B> where
B: Sync,
<B as ToOwned>::Owned: Send,
B: Sync,
<B as ToOwned>::Owned: Send,
impl<'a, B: ?Sized> Sync for Cow<'a, B> where
B: Sync,
<B as ToOwned>::Owned: Sync,
B: Sync,
<B as ToOwned>::Owned: Sync,
impl<'a, B: ?Sized> Unpin for Cow<'a, B> where
<B as ToOwned>::Owned: Unpin,
<B as ToOwned>::Owned: Unpin,
impl<'a, B: ?Sized> UnwindSafe for Cow<'a, B> where
B: RefUnwindSafe,
<B as ToOwned>::Owned: UnwindSafe,
B: RefUnwindSafe,
<B as ToOwned>::Owned: UnwindSafe,
Blanket Implementations
impl<A, T> AsBits<T> for A where
T: BitStore + BitRegister,
A: AsRef<[T]>,
impl<A, T> AsBits<T> for A where
T: BitStore + BitRegister,
A: AsRef<[T]>, impl<T> BorrowMut<T> for T where
T: ?Sized, [src]
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]pub fn borrow_mut(&mut self) -> &mut T[src]
pub fn borrow_mut(&mut self) -> &mut T[src]Mutably borrows from an owned value. Read more
impl<T> Downcast for T where
T: Any, [src]
impl<T> Downcast for T where
T: Any, [src]pub fn into_any(self: Box<T, Global>) -> Box<dyn Any + 'static, Global>ⓘNotable traits for Box<W, Global>
impl<W> Write for Box<W, Global> where
W: Write + ?Sized, impl<R> Read for Box<R, Global> where
R: Read + ?Sized, impl<F, A> Future for Box<F, A> where
A: Allocator + 'static,
F: Future + Unpin + ?Sized, type Output = <F as Future>::Output;impl<I, A> Iterator for Box<I, A> where
A: Allocator,
I: Iterator + ?Sized, type Item = <I as Iterator>::Item;[src]
pub fn into_any(self: Box<T, Global>) -> Box<dyn Any + 'static, Global>ⓘNotable traits for Box<W, Global>
impl<W> Write for Box<W, Global> where
W: Write + ?Sized, impl<R> Read for Box<R, Global> where
R: Read + ?Sized, impl<F, A> Future for Box<F, A> where
A: Allocator + 'static,
F: Future + Unpin + ?Sized, type Output = <F as Future>::Output;impl<I, A> Iterator for Box<I, A> where
A: Allocator,
I: Iterator + ?Sized, type Item = <I as Iterator>::Item;[src]Convert Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait. Read more
pub fn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>[src]
pub fn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>[src]Convert Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait. Read more
pub fn as_any(&self) -> &(dyn Any + 'static)[src]
pub fn as_any(&self) -> &(dyn Any + 'static)[src]Convert &Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s. Read more
pub fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)[src]
pub fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)[src]Convert &mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s. Read more
impl<T> DowncastSync for T where
T: Any + Send + Sync, [src]
impl<T> DowncastSync for T where
T: Any + Send + Sync, [src]impl<T> FmtForward for T
impl<T> FmtForward for Tfn 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
fn fmt_octal(self) -> FmtOctal<Self> where
Self: Octal,
fn fmt_octal(self) -> FmtOctal<Self> where
Self: Octal, 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, fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> R
fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> RPipes by value. This is generally the method you want to use. Read more
fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> R where
R: 'a,
fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> R where
R: 'a, 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.
impl<T> PipeAsRef for T
impl<T> PipeAsRef for Tfn 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
impl<T> PipeBorrow for T
impl<T> PipeBorrow for Tfn 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
impl<T> PipeDeref for T
impl<T> PipeDeref for Tfn 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
impl<T> PipeRef for T
impl<T> PipeRef for Timpl<T> Tap for T
impl<T> Tap for Tfn 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
fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self where
Self: AsRef<R>,
R: ?Sized,
fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self where
Self: AsRef<R>,
R: ?Sized, 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
fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self where
Self: Deref<Target = T>,
T: ?Sized,
fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self where
Self: Deref<Target = T>,
T: ?Sized, Immutable access to the Deref::Target of a value. Read more
fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self where
Self: DerefMut<Target = T> + Deref,
T: ?Sized,
fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self where
Self: DerefMut<Target = T> + Deref,
T: ?Sized, Mutable access to the Deref::Target of a value. Read more
fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
fn tap_dbg(self, func: impl FnOnce(&Self)) -> SelfCalls .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)) -> SelfCalls .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
impl<T> Tap for T
impl<T> Tap for Tfn tap<F, R>(self, func: F) -> Self where
F: FnOnce(&Self) -> R,
fn tap<F, R>(self, func: F) -> Self where
F: FnOnce(&Self) -> R, Provides immutable access for inspection. Read more
fn tap_dbg<F, R>(self, func: F) -> Self where
F: FnOnce(&Self) -> R,
fn tap_dbg<F, R>(self, func: F) -> Self where
F: FnOnce(&Self) -> R, Calls tap in debug builds, and does nothing in release builds.
fn tap_mut<F, R>(self, func: F) -> Self where
F: FnOnce(&mut Self) -> R,
fn tap_mut<F, R>(self, func: F) -> Self where
F: FnOnce(&mut Self) -> R, 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, fn tap_ref<F, R>(self, func: F) -> Self where
Self: AsRef<T>,
F: FnOnce(&T) -> R,
fn tap_ref<F, R>(self, func: F) -> Self where
Self: AsRef<T>,
F: FnOnce(&T) -> R, 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
impl<T> TapDeref for T
impl<T> TapDeref for Tfn tap_deref<F, R>(self, func: F) -> Self where
Self: Deref,
F: FnOnce(&Self::Target) -> R,
fn tap_deref<F, R>(self, func: F) -> Self where
Self: Deref,
F: FnOnce(&Self::Target) -> R, 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
impl<T> ToOwned for T where
T: Clone, [src]
impl<T> ToOwned for T where
T: Clone, [src]type Owned = T
type Owned = TThe resulting type after obtaining ownership.
pub fn to_owned(&self) -> T[src]
pub fn to_owned(&self) -> T[src]Creates owned data from borrowed data, usually by cloning. Read more
pub fn clone_into(&self, target: &mut T)[src]
pub fn clone_into(&self, target: &mut T)[src]🔬 This is a nightly-only experimental API. (toowned_clone_into)
recently added
Uses borrowed data to replace owned data, usually by cloning. Read more