Struct bones_framework::lib::prelude::RefMut

pub struct RefMut<'a, T>
where T: ?Sized,
{ /* private fields */ }
Expand description

Wrapper for mutably borrowed AtomicCell that will released lock on drop.

This type can be dereferenced to [&mut T].

Implements Borrow<T>, BorrowMut<T>, AsRef<T> and AsMut<T> for convenience.

Implements Debug, Display, PartialEq, PartialOrd and Hash by delegating to T.

Implementations§

§

impl<'a, T> RefMut<'a, T>
where T: ?Sized,

pub fn new(r: &'a mut T) -> RefMut<'a, T>

Wraps external reference into RefMut.

This function’s purpose is to satisfy type requirements where RefMut is required but reference does not live in AtomicCell.

§Examples
use atomicell::RefMut;

let mut value = 42;
let r = RefMut::new(&mut value);

pub fn with_borrow(r: &'a mut T, borrow: AtomicBorrowMut<'a>) -> RefMut<'a, T>

Wraps external reference into RefMut. And associates it with provided AtomicBorrowMut

This function is intended to be used by AtomicCell or other abstractions that use AtomicBorrow for locking.

§Examples
use core::sync::atomic::AtomicIsize;
use atomicell::{borrow::{AtomicBorrowMut, new_lock}, RefMut};
let counter = new_lock();
let borrow = AtomicBorrowMut::try_new(&counter).unwrap();

let mut value = 42;
let r = RefMut::with_borrow(&mut value, borrow);
assert_eq!(*r, 42);

pub fn into_split(r: RefMut<'a, T>) -> (NonNull<T>, AtomicBorrowMut<'a>)

Splits wrapper into two parts. One is reference to the value and the other is AtomicBorrowMut that guards it from being borrowed.

§Safety

User must ensure NonNull is not dereferenced after AtomicBorrowMut is dropped.

You must also treat the NonNull as invariant over T. This means that any custom wrapper types you make around the NonNull<T> must also be invariant over T. This can be done by adding a PhantomData<*mut T> field to the struct.

See the source definition of RefMut for an example.

§Examples
use atomicell::{AtomicCell, RefMut};

let cell = AtomicCell::new(42);
let r: RefMut<'_, i32> = cell.borrow_mut();

unsafe {
    let (r, borrow) = RefMut::into_split(r);
    assert_eq!(*r.as_ref(), 42);

    assert!(cell.try_borrow().is_none(), "Must not be able to borrow mutably yet");
    assert!(cell.try_borrow_mut().is_none(), "Must not be able to borrow mutably yet");
    drop(borrow);
    assert!(cell.try_borrow_mut().is_some(), "Must be able to borrow mutably now");
}

pub fn map<F, U>(r: RefMut<'a, T>, f: F) -> RefMut<'a, U>
where F: FnOnce(&mut T) -> &mut U, U: ?Sized,

Makes a new RefMut for a component of the borrowed data.

The AtomicCell is already mutably borrowed, so this cannot fail.

This is an associated function that needs to be used as RefMut::map(…). A method would interfere with methods of the same name on the contents of a AtomicCell used through Deref.

§Examples
use atomicell::{AtomicCell, RefMut};

let c = AtomicCell::new((5, 'b'));
let b1: RefMut<(u32, char)> = c.borrow_mut();
let b2: RefMut<u32> = RefMut::map(b1, |t| &mut t.0);
assert_eq!(*b2, 5)

pub fn filter_map<U, F>( r: RefMut<'a, T>, f: F, ) -> Result<RefMut<'a, U>, RefMut<'a, T>>
where F: FnOnce(&mut T) -> Option<&mut U>, U: ?Sized,

Makes a new RefMut for an optional component of the borrowed data. The original guard is returned as an Err(..) if the closure returns None.

The AtomicCell is already mutably borrowed, so this cannot fail.

This is an associated function that needs to be used as RefMut::filter_map(…). A method would interfere with methods of the same name on the contents of a AtomicCell used through Deref.

§Examples
use atomicell::{AtomicCell, RefMut};

let c = AtomicCell::new(vec![1, 2, 3]);

{
    let b1: RefMut<Vec<u32>> = c.borrow_mut();
    let mut b2: Result<RefMut<u32>, _> = RefMut::filter_map(b1, |v| v.get_mut(1));

    if let Ok(mut b2) = b2 {
        *b2 += 2;
    }
}

assert_eq!(*c.borrow(), vec![1, 4, 3]);

pub fn map_split<U, V, F>( r: RefMut<'a, T>, f: F, ) -> (RefMut<'a, U>, RefMut<'a, V>)
where F: FnOnce(&mut T) -> (&mut U, &mut V), U: ?Sized, V: ?Sized,

Splits a RefMut into multiple RefMuts for different components of the borrowed data.

The AtomicCell is already immutably borrowed, so this cannot fail.

This is an associated function that needs to be used as RefMut::map_split(...). A method would interfere with methods of the same name on the contents of a AtomicCell used through Deref.

§Examples
use atomicell::{RefMut, AtomicCell};

let cell = AtomicCell::new([1, 2, 3, 4]);
let borrow = cell.borrow_mut();
let (begin, end) = RefMut::map_split(borrow, |slice| slice.split_at_mut(2));
assert_eq!(*begin, [1, 2]);
assert_eq!(*end, [3, 4]);

pub fn leak(r: RefMut<'a, T>) -> &'a mut T

Convert into a reference to the underlying data.

The underlying AtomicCell can never be mutably borrowed from again and will always appear already immutably borrowed. It is not a good idea to leak more than a constant number of references. The AtomicCell can be immutably borrowed again if only a smaller number of leaks have occurred in total.

This is an associated function that needs to be used as RefMut::leak(…). A method would interfere with methods of the same name on the contents of a AtomicCell used through Deref.

§Examples
use atomicell::{AtomicCell, RefMut};
let cell = AtomicCell::new(0);

let value = RefMut::leak(cell.borrow_mut());
assert_eq!(*value, 0);
*value = 1;
assert_eq!(*value, 1);

assert!(cell.try_borrow().is_none());
assert!(cell.try_borrow_mut().is_none());

pub fn as_mut<U>(r: RefMut<'a, T>) -> RefMut<'a, U>
where T: AsMut<U>, U: ?Sized,

Converts reference and returns result wrapped in the RefMut.

The AtomicCell is already mutably borrowed, so this cannot fail.

This is an associated function that needs to be used as RefMut::map_split(...). A method would interfere with methods of the same name on the contents of a AtomicCell used through Deref.

§Examples
use atomicell::{AtomicCell, RefMut};

let c = AtomicCell::new(String::from("hello"));
let b1: RefMut<String> = c.borrow_mut();
let mut b2: RefMut<str> = RefMut::as_mut(b1);
b2.make_ascii_uppercase();
assert_eq!(*b2, *"HELLO")

pub fn as_deref_mut(r: RefMut<'a, T>) -> RefMut<'a, <T as Deref>::Target>
where T: DerefMut,

Dereferences and returns result wrapped in the RefMut.

The AtomicCell is already mutably borrowed, so this cannot fail.

This is an associated function that needs to be used as RefMut::map_split(...). A method would interfere with methods of the same name on the contents of a AtomicCell used through Deref.

§Examples
use atomicell::{AtomicCell, RefMut};

let c = AtomicCell::new(String::from("hello"));
let b1: RefMut<String> = c.borrow_mut();
let mut b2: RefMut<str> = RefMut::as_deref_mut(b1);
b2.make_ascii_uppercase();
assert_eq!(*b2, *"HELLO")
§

impl<'a, T> RefMut<'a, Option<T>>

pub fn transpose(r: RefMut<'a, Option<T>>) -> Option<RefMut<'a, T>>

Transposes a RefMut of an Option into an Option of a RefMut. Releases shared lock of AtomicCell if the value is None.

The AtomicCell is already mutably borrowed, so this cannot fail.

This is an associated function that needs to be used as RefMut::map_split(...). A method would interfere with methods of the same name on the contents of a AtomicCell used through Deref.

§Examples
use atomicell::{AtomicCell, RefMut};

let c = AtomicCell::new(Some(5));
let b1: RefMut<Option<i32>> = c.borrow_mut();
let b2: Option<RefMut<i32>> = RefMut::transpose(b1);
assert!(b2.is_some());

let c = AtomicCell::new(None);
let b1: RefMut<Option<i32>> = c.borrow_mut();
let b2: Option<RefMut<i32>> = RefMut::transpose(b1);
assert!(b2.is_none());
assert!(c.try_borrow_mut().is_some());
§

impl<'a, T> RefMut<'a, [T]>

pub fn slice<R>(r: RefMut<'a, [T]>, range: R) -> RefMut<'a, [T]>
where R: RangeBounds<usize>,

Makes a new RefMut for a sub-slice of the borrowed slice.

The AtomicCell is already mutably borrowed, so this cannot fail.

This is an associated function that needs to be used as RefMut::map(…). A method would interfere with methods of the same name on the contents of a AtomicCell used through Deref.

§Examples
use atomicell::{AtomicCell, RefMut};

let c: &AtomicCell<[i32]> = &AtomicCell::new([1, 2, 3, 4, 5]);
let b1: RefMut<[i32]> = RefMut::as_mut(c.borrow_mut());
let b2: RefMut<[i32]> = RefMut::slice(b1, 2..4);
assert_eq!(*b2, [3, 4])

Trait Implementations§

§

impl<'a, T, U> AsMut<U> for RefMut<'a, T>
where T: AsMut<U> + ?Sized,

§

fn as_mut(&mut self) -> &mut U

Converts this type into a mutable reference of the (usually inferred) input type.
§

impl<'a, T, U> AsRef<U> for RefMut<'a, T>
where T: AsRef<U> + ?Sized,

§

fn as_ref(&self) -> &U

Converts this type into a shared reference of the (usually inferred) input type.
§

impl<'a, T> Borrow<T> for RefMut<'a, T>
where T: ?Sized,

§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
§

impl<'a, T> BorrowMut<T> for RefMut<'a, T>
where T: ?Sized,

§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<'a, T> Debug for RefMut<'a, T>
where T: Debug,

§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
§

impl<'a, T> Deref for RefMut<'a, T>
where T: ?Sized,

§

type Target = T

The resulting type after dereferencing.
§

fn deref(&self) -> &T

Dereferences the value.
§

impl<'a, T> DerefMut for RefMut<'a, T>
where T: ?Sized,

§

fn deref_mut(&mut self) -> &mut T

Mutably dereferences the value.
§

impl<'a, T> Display for RefMut<'a, T>
where T: Display + ?Sized,

§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
§

impl<'a, T> Hash for RefMut<'a, T>
where T: Hash + ?Sized,

§

fn hash<H>(&self, state: &mut H)
where H: Hasher,

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
§

impl<'a, T, U> PartialEq<U> for RefMut<'a, T>
where T: PartialEq<U> + ?Sized,

§

fn eq(&self, other: &U) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
§

impl<'a, T, U> PartialOrd<U> for RefMut<'a, T>
where T: PartialOrd<U> + ?Sized,

§

fn partial_cmp(&self, other: &U) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

fn lt(&self, other: &Rhs) -> bool

This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · source§

fn le(&self, other: &Rhs) -> bool

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · source§

fn gt(&self, other: &Rhs) -> bool

This method tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

fn ge(&self, other: &Rhs) -> bool

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more
source§

impl<'a, 'q, T> QueryItem for &'a RefMut<'q, ComponentStore<T>>
where T: HasSchema,

§

type Iter = Map<UntypedComponentBitsetIterator<'a>, for<'b> fn(_: SchemaRef<'b>) -> &'b T>

The type of iterator this query item creates
source§

fn apply_bitset(&self, bitset: &mut BitSetVec)

Modify the iteration bitset
source§

fn get_single_with_bitset( self, bitset: Rc<BitSetVec>, ) -> Result<<<&'a RefMut<'q, ComponentStore<T>> as QueryItem>::Iter as Iterator>::Item, QuerySingleError>

Return the item that matches the query within the given bitset if there is exactly one entity that matches this query item.
source§

fn iter_with_bitset( self, bitset: Rc<BitSetVec>, ) -> <&'a RefMut<'q, ComponentStore<T>> as QueryItem>::Iter

Return an iterator over the provided bitset.
source§

impl<'a, 'q, T> QueryItem for &'a mut RefMut<'q, ComponentStore<T>>
where T: HasSchema,

§

type Iter = Map<UntypedComponentBitsetIteratorMut<'a>, for<'b> fn(_: SchemaRefMut<'b>) -> &'b mut T>

The type of iterator this query item creates
source§

fn apply_bitset(&self, bitset: &mut BitSetVec)

Modify the iteration bitset
source§

fn get_single_with_bitset( self, bitset: Rc<BitSetVec>, ) -> Result<<<&'a mut RefMut<'q, ComponentStore<T>> as QueryItem>::Iter as Iterator>::Item, QuerySingleError>

Return the item that matches the query within the given bitset if there is exactly one entity that matches this query item.
source§

fn iter_with_bitset( self, bitset: Rc<BitSetVec>, ) -> <&'a mut RefMut<'q, ComponentStore<T>> as QueryItem>::Iter

Return an iterator over the provided bitset.
source§

impl<'a, T> SystemParam for RefMut<'a, ComponentStore<T>>
where T: HasSchema,

§

type State = Arc<AtomicCell<ComponentStore<T>>>

The intermediate state for the parameter, that may be extracted from the world.
§

type Param<'p> = RefMut<'p, ComponentStore<T>>

The type of the parameter, ranging over the lifetime of the intermediate state. Read more
source§

fn get_state( world: &World, ) -> <RefMut<'a, ComponentStore<T>> as SystemParam>::State

This is called to produce the intermediate state of the system parameter. Read more
source§

fn borrow<'s>( _world: &'s World, state: &'s mut <RefMut<'a, ComponentStore<T>> as SystemParam>::State, ) -> <RefMut<'a, ComponentStore<T>> as SystemParam>::Param<'s>

This is used create an instance of the system parame, possibly borrowed from the intermediate parameter state.
§

impl<'b, T> Send for RefMut<'b, T>
where T: 'b + ?Sized, &'a mut T: for<'a> Send,

§

impl<'b, T> Sync for RefMut<'b, T>
where T: 'b + ?Sized, &'a mut T: for<'a> Sync,

Auto Trait Implementations§

§

impl<'a, T> Freeze for RefMut<'a, T>
where T: ?Sized,

§

impl<'a, T> RefUnwindSafe for RefMut<'a, T>
where T: RefUnwindSafe + ?Sized,

§

impl<'a, T> Unpin for RefMut<'a, T>
where T: ?Sized,

§

impl<'a, T> !UnwindSafe for RefMut<'a, T>

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> AnyEq for T
where T: Any + PartialEq,

§

fn equals(&self, other: &(dyn Any + 'static)) -> bool

§

fn as_any(&self) -> &(dyn Any + 'static)

§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where T: 'a,

§

fn implicit( self, class: Class, constructed: bool, tag: u32, ) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> Conv for T

§

fn conv<T>(self) -> T
where Self: Into<T>,

Converts self into T using Into<T>. Read more
§

impl<T> FmtForward for T

§

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,

Causes self to use its Display implementation when Debug-formatted.
§

fn fmt_lower_exp(self) -> FmtLowerExp<Self>
where Self: LowerExp,

Causes self to use its LowerExp implementation when Debug-formatted.
§

fn fmt_lower_hex(self) -> FmtLowerHex<Self>
where Self: LowerHex,

Causes self to use its LowerHex implementation when Debug-formatted.
§

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,

Causes self to use its Pointer implementation when Debug-formatted.
§

fn fmt_upper_exp(self) -> FmtUpperExp<Self>
where Self: UpperExp,

Causes self to use its UpperExp implementation when Debug-formatted.
§

fn fmt_upper_hex(self) -> FmtUpperHex<Self>
where Self: UpperHex,

Causes self to use its UpperHex implementation when Debug-formatted.
§

fn fmt_list(self) -> FmtList<Self>
where &'a Self: for<'a> IntoIterator,

Formats each item in a sequence. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<S> FromSample<S> for S

§

fn from_sample_(s: S) -> S

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

§

impl<F, T> IntoSample<T> for F
where T: FromSample<F>,

§

fn into_sample(self) -> T

§

impl<T> Pipe for T
where T: ?Sized,

§

fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> R
where Self: Sized,

Pipes 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,

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,

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,

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,

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>, U: 'a + ?Sized, R: 'a,

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>, U: 'a + ?Sized, R: 'a,

Mutably borrows self, then passes self.as_mut() into the pipe function.
§

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_deref_mut<'a, T, R>( &'a mut self, func: impl FnOnce(&'a mut T) -> R, ) -> R
where Self: DerefMut<Target = T> + Deref, T: 'a + ?Sized, R: 'a,

Mutably borrows self, then passes self.deref_mut() into the pipe function.
source§

impl<T> RawDrop for T

source§

unsafe fn raw_drop(ptr: *mut c_void)

Write the default value of the type to the pointer. Read more
source§

fn raw_drop_cb() -> Unsafe<&'static (dyn Fn(*mut c_void) + Send + Sync)>

Get a callback suitable for [SchemaData].
source§

impl<T> RawHash for T
where T: Hash,

source§

unsafe fn raw_hash(ptr: *const c_void) -> u64

Get the hash of the type. Read more
source§

fn raw_hash_cb() -> Unsafe<&'static (dyn Fn(*const c_void) -> u64 + Send + Sync)>

Get a callback suitable for [SchemaData].
source§

impl<T> Same for T

§

type Output = T

Should always be Self
§

impl<T> Tap for T

§

fn tap(self, func: impl FnOnce(&Self)) -> Self

Immutable access to a value. Read more
§

fn tap_mut(self, func: impl FnOnce(&mut Self)) -> Self

Mutable access to a value. Read more
§

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,

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,

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,

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,

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,

Mutable access to the Deref::Target of a value. Read more
§

fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self

Calls .tap() only in debug builds, and is erased in release builds.
§

fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self

Calls .tap_mut() only in debug builds, and is erased in release builds.
§

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.
§

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.
§

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.
§

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.
§

fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
where Self: Deref<Target = T>, T: ?Sized,

Calls .tap_deref() only in debug builds, and is erased in release builds.
§

fn tap_deref_mut_dbg<T>(self, func: impl FnOnce(&mut T)) -> Self
where Self: DerefMut<Target = T> + Deref, T: ?Sized,

Calls .tap_deref_mut() only in debug builds, and is erased in release builds.
§

impl<T, U> ToSample<U> for T
where U: FromSample<T>,

§

fn to_sample_(self) -> U

source§

impl<T> ToString for T
where T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
§

impl<T> TryConv for T

§

fn try_conv<T>(self) -> Result<T, Self::Error>
where Self: TryInto<T>,

Attempts to convert self into T using TryInto<T>. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

impl<S, T> Duplex<S> for T
where T: FromSample<S> + ToSample<S>,

§

impl<T> Formattable for T
where T: Deref, <T as Deref>::Target: Formattable,

§

impl<T> Parsable for T
where T: Deref, <T as Deref>::Target: Parsable,