pub struct Cell<T>where
T: ?Sized,{ /* private fields */ }
Expand description
A mutable memory location.
§Memory layout
Cell<T>
has the same memory layout and caveats as
UnsafeCell<T>
. In particular, this means that
Cell<T>
has the same in-memory representation as its inner type T
.
§Examples
In this example, you can see that Cell<T>
enables mutation inside an
immutable struct. In other words, it enables “interior mutability”.
use std::cell::Cell;
struct SomeStruct {
regular_field: u8,
special_field: Cell<u8>,
}
let my_struct = SomeStruct {
regular_field: 0,
special_field: Cell::new(1),
};
let new_value = 100;
// ERROR: `my_struct` is immutable
// my_struct.regular_field = new_value;
// WORKS: although `my_struct` is immutable, `special_field` is a `Cell`,
// which can always be mutated
my_struct.special_field.set(new_value);
assert_eq!(my_struct.special_field.get(), new_value);
See the module-level documentation for more.
Implementations§
source§impl<T> Cell<T>
impl<T> Cell<T>
1.17.0 · sourcepub fn swap(&self, other: &Cell<T>)
pub fn swap(&self, other: &Cell<T>)
Swaps the values of two Cell
s.
The difference with std::mem::swap
is that this function doesn’t
require a &mut
reference.
§Panics
This function will panic if self
and other
are different Cell
s that partially overlap.
(Using just standard library methods, it is impossible to create such partially overlapping Cell
s.
However, unsafe code is allowed to e.g. create two &Cell<[i32; 2]>
that partially overlap.)
§Examples
use std::cell::Cell;
let c1 = Cell::new(5i32);
let c2 = Cell::new(10i32);
c1.swap(&c2);
assert_eq!(10, c1.get());
assert_eq!(5, c2.get());
1.17.0 · sourcepub fn replace(&self, val: T) -> T
pub fn replace(&self, val: T) -> T
Replaces the contained value with val
, and returns the old contained value.
§Examples
use std::cell::Cell;
let cell = Cell::new(5);
assert_eq!(cell.get(), 5);
assert_eq!(cell.replace(10), 5);
assert_eq!(cell.get(), 10);
1.17.0 (const: unstable) · sourcepub fn into_inner(self) -> T
pub fn into_inner(self) -> T
Unwraps the value, consuming the cell.
§Examples
use std::cell::Cell;
let c = Cell::new(5);
let five = c.into_inner();
assert_eq!(five, 5);
source§impl<T> Cell<T>where
T: Copy,
impl<T> Cell<T>where
T: Copy,
1.0.0 · sourcepub fn get(&self) -> T
pub fn get(&self) -> T
Returns a copy of the contained value.
§Examples
use std::cell::Cell;
let c = Cell::new(5);
let five = c.get();
sourcepub fn update<F>(&self, f: F) -> Twhere
F: FnOnce(T) -> T,
🔬This is a nightly-only experimental API. (cell_update
)
pub fn update<F>(&self, f: F) -> Twhere
F: FnOnce(T) -> T,
cell_update
)Updates the contained value using a function and returns the new value.
§Examples
#![feature(cell_update)]
use std::cell::Cell;
let c = Cell::new(5);
let new = c.update(|x| x + 1);
assert_eq!(new, 6);
assert_eq!(c.get(), 6);
source§impl<T> Cell<T>where
T: ?Sized,
impl<T> Cell<T>where
T: ?Sized,
1.12.0 (const: 1.32.0) · sourcepub const fn as_ptr(&self) -> *mut T
pub const fn as_ptr(&self) -> *mut T
Returns a raw pointer to the underlying data in this cell.
§Examples
use std::cell::Cell;
let c = Cell::new(5);
let ptr = c.as_ptr();
1.11.0 · sourcepub fn get_mut(&mut self) -> &mut T
pub fn get_mut(&mut self) -> &mut T
Returns a mutable reference to the underlying data.
This call borrows Cell
mutably (at compile-time) which guarantees
that we possess the only reference.
However be cautious: this method expects self
to be mutable, which is
generally not the case when using a Cell
. If you require interior
mutability by reference, consider using RefCell
which provides
run-time checked mutable borrows through its borrow_mut
method.
§Examples
use std::cell::Cell;
let mut c = Cell::new(5);
*c.get_mut() += 1;
assert_eq!(c.get(), 6);
1.37.0 · sourcepub fn from_mut(t: &mut T) -> &Cell<T>
pub fn from_mut(t: &mut T) -> &Cell<T>
Returns a &Cell<T>
from a &mut T
§Examples
use std::cell::Cell;
let slice: &mut [i32] = &mut [1, 2, 3];
let cell_slice: &Cell<[i32]> = Cell::from_mut(slice);
let slice_cell: &[Cell<i32>] = cell_slice.as_slice_of_cells();
assert_eq!(slice_cell.len(), 3);
source§impl<T> Cell<[T]>
impl<T> Cell<[T]>
1.37.0 · sourcepub fn as_slice_of_cells(&self) -> &[Cell<T>]
pub fn as_slice_of_cells(&self) -> &[Cell<T>]
Returns a &[Cell<T>]
from a &Cell<[T]>
§Examples
use std::cell::Cell;
let slice: &mut [i32] = &mut [1, 2, 3];
let cell_slice: &Cell<[i32]> = Cell::from_mut(slice);
let slice_cell: &[Cell<i32>] = cell_slice.as_slice_of_cells();
assert_eq!(slice_cell.len(), 3);
source§impl<T, const N: usize> Cell<[T; N]>
impl<T, const N: usize> Cell<[T; N]>
sourcepub fn as_array_of_cells(&self) -> &[Cell<T>; N]
🔬This is a nightly-only experimental API. (as_array_of_cells
)
pub fn as_array_of_cells(&self) -> &[Cell<T>; N]
as_array_of_cells
)Returns a &[Cell<T>; N]
from a &Cell<[T; N]>
§Examples
#![feature(as_array_of_cells)]
use std::cell::Cell;
let mut array: [i32; 3] = [1, 2, 3];
let cell_array: &Cell<[i32; 3]> = Cell::from_mut(&mut array);
let array_cell: &[Cell<i32>; 3] = cell_array.as_array_of_cells();
Trait Implementations§
§impl BitStore for Cell<u16>
impl BitStore for Cell<u16>
§type Mem = u16
type Mem = u16
BitSlice
. It
is always one of the unsigned integer fundamentals.§type Access = Cell<u16>
type Access = Cell<u16>
Self::Mem
value between the processor and the memory system. Read more§type Alias = Cell<u16>
type Alias = Cell<u16>
BitStore
implementor that is known to be alias-safe. It is
used when a BitSlice
introduces multiple handles that view the same
memory location, and at least one of them has write capabilities to it.
It must have the same underlying memory type, and can only change access
patterns or public-facing usage.§type Unalias = Cell<u16>
type Unalias = Cell<u16>
::Alias
. It is used when a BitSlice
removes the
conditions that required a T -> T::Alias
transition.§fn new(value: <Cell<u16> as BitStore>::Mem) -> Cell<u16>
fn new(value: <Cell<u16> as BitStore>::Mem) -> Cell<u16>
BitStore
type.§fn load_value(&self) -> <Cell<u16> as BitStore>::Mem
fn load_value(&self) -> <Cell<u16> as BitStore>::Mem
::Access
rules. This may be called when the value is aliased by a write-capable
reference.§fn store_value(&mut self, value: <Cell<u16> as BitStore>::Mem)
fn store_value(&mut self, value: <Cell<u16> as BitStore>::Mem)
::Access
constraints.§const ALIGNED_TO_SIZE: [(); 1] = _
const ALIGNED_TO_SIZE: [(); 1] = _
§const ALIAS_WIDTH: [(); 1] = _
const ALIAS_WIDTH: [(); 1] = _
Self
and Self::Alias
be equal
in representation. This is true by fiat for all types except the
unsigned integers. Read more§impl BitStore for Cell<u32>
impl BitStore for Cell<u32>
§type Mem = u32
type Mem = u32
BitSlice
. It
is always one of the unsigned integer fundamentals.§type Access = Cell<u32>
type Access = Cell<u32>
Self::Mem
value between the processor and the memory system. Read more§type Alias = Cell<u32>
type Alias = Cell<u32>
BitStore
implementor that is known to be alias-safe. It is
used when a BitSlice
introduces multiple handles that view the same
memory location, and at least one of them has write capabilities to it.
It must have the same underlying memory type, and can only change access
patterns or public-facing usage.§type Unalias = Cell<u32>
type Unalias = Cell<u32>
::Alias
. It is used when a BitSlice
removes the
conditions that required a T -> T::Alias
transition.§fn new(value: <Cell<u32> as BitStore>::Mem) -> Cell<u32>
fn new(value: <Cell<u32> as BitStore>::Mem) -> Cell<u32>
BitStore
type.§fn load_value(&self) -> <Cell<u32> as BitStore>::Mem
fn load_value(&self) -> <Cell<u32> as BitStore>::Mem
::Access
rules. This may be called when the value is aliased by a write-capable
reference.§fn store_value(&mut self, value: <Cell<u32> as BitStore>::Mem)
fn store_value(&mut self, value: <Cell<u32> as BitStore>::Mem)
::Access
constraints.§const ALIGNED_TO_SIZE: [(); 1] = _
const ALIGNED_TO_SIZE: [(); 1] = _
§const ALIAS_WIDTH: [(); 1] = _
const ALIAS_WIDTH: [(); 1] = _
Self
and Self::Alias
be equal
in representation. This is true by fiat for all types except the
unsigned integers. Read more§impl BitStore for Cell<u64>
impl BitStore for Cell<u64>
§type Mem = u64
type Mem = u64
BitSlice
. It
is always one of the unsigned integer fundamentals.§type Access = Cell<u64>
type Access = Cell<u64>
Self::Mem
value between the processor and the memory system. Read more§type Alias = Cell<u64>
type Alias = Cell<u64>
BitStore
implementor that is known to be alias-safe. It is
used when a BitSlice
introduces multiple handles that view the same
memory location, and at least one of them has write capabilities to it.
It must have the same underlying memory type, and can only change access
patterns or public-facing usage.§type Unalias = Cell<u64>
type Unalias = Cell<u64>
::Alias
. It is used when a BitSlice
removes the
conditions that required a T -> T::Alias
transition.§fn new(value: <Cell<u64> as BitStore>::Mem) -> Cell<u64>
fn new(value: <Cell<u64> as BitStore>::Mem) -> Cell<u64>
BitStore
type.§fn load_value(&self) -> <Cell<u64> as BitStore>::Mem
fn load_value(&self) -> <Cell<u64> as BitStore>::Mem
::Access
rules. This may be called when the value is aliased by a write-capable
reference.§fn store_value(&mut self, value: <Cell<u64> as BitStore>::Mem)
fn store_value(&mut self, value: <Cell<u64> as BitStore>::Mem)
::Access
constraints.§const ALIGNED_TO_SIZE: [(); 1] = _
const ALIGNED_TO_SIZE: [(); 1] = _
§const ALIAS_WIDTH: [(); 1] = _
const ALIAS_WIDTH: [(); 1] = _
Self
and Self::Alias
be equal
in representation. This is true by fiat for all types except the
unsigned integers. Read more§impl BitStore for Cell<u8>
impl BitStore for Cell<u8>
§type Mem = u8
type Mem = u8
BitSlice
. It
is always one of the unsigned integer fundamentals.§type Access = Cell<u8>
type Access = Cell<u8>
Self::Mem
value between the processor and the memory system. Read more§type Alias = Cell<u8>
type Alias = Cell<u8>
BitStore
implementor that is known to be alias-safe. It is
used when a BitSlice
introduces multiple handles that view the same
memory location, and at least one of them has write capabilities to it.
It must have the same underlying memory type, and can only change access
patterns or public-facing usage.§type Unalias = Cell<u8>
type Unalias = Cell<u8>
::Alias
. It is used when a BitSlice
removes the
conditions that required a T -> T::Alias
transition.§fn load_value(&self) -> <Cell<u8> as BitStore>::Mem
fn load_value(&self) -> <Cell<u8> as BitStore>::Mem
::Access
rules. This may be called when the value is aliased by a write-capable
reference.§fn store_value(&mut self, value: <Cell<u8> as BitStore>::Mem)
fn store_value(&mut self, value: <Cell<u8> as BitStore>::Mem)
::Access
constraints.§const ALIGNED_TO_SIZE: [(); 1] = _
const ALIGNED_TO_SIZE: [(); 1] = _
§const ALIAS_WIDTH: [(); 1] = _
const ALIAS_WIDTH: [(); 1] = _
Self
and Self::Alias
be equal
in representation. This is true by fiat for all types except the
unsigned integers. Read more§impl BitStore for Cell<usize>
impl BitStore for Cell<usize>
§type Mem = usize
type Mem = usize
BitSlice
. It
is always one of the unsigned integer fundamentals.§type Access = Cell<usize>
type Access = Cell<usize>
Self::Mem
value between the processor and the memory system. Read more§type Alias = Cell<usize>
type Alias = Cell<usize>
BitStore
implementor that is known to be alias-safe. It is
used when a BitSlice
introduces multiple handles that view the same
memory location, and at least one of them has write capabilities to it.
It must have the same underlying memory type, and can only change access
patterns or public-facing usage.§type Unalias = Cell<usize>
type Unalias = Cell<usize>
::Alias
. It is used when a BitSlice
removes the
conditions that required a T -> T::Alias
transition.§fn new(value: <Cell<usize> as BitStore>::Mem) -> Cell<usize>
fn new(value: <Cell<usize> as BitStore>::Mem) -> Cell<usize>
BitStore
type.§fn load_value(&self) -> <Cell<usize> as BitStore>::Mem
fn load_value(&self) -> <Cell<usize> as BitStore>::Mem
::Access
rules. This may be called when the value is aliased by a write-capable
reference.§fn store_value(&mut self, value: <Cell<usize> as BitStore>::Mem)
fn store_value(&mut self, value: <Cell<usize> as BitStore>::Mem)
::Access
constraints.§const ALIGNED_TO_SIZE: [(); 1] = _
const ALIGNED_TO_SIZE: [(); 1] = _
§const ALIAS_WIDTH: [(); 1] = _
const ALIAS_WIDTH: [(); 1] = _
Self
and Self::Alias
be equal
in representation. This is true by fiat for all types except the
unsigned integers. Read moresource§impl<'de, T> Deserialize<'de> for Cell<T>where
T: Deserialize<'de> + Copy,
impl<'de, T> Deserialize<'de> for Cell<T>where
T: Deserialize<'de> + Copy,
source§fn deserialize<D>(
deserializer: D,
) -> Result<Cell<T>, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
fn deserialize<D>(
deserializer: D,
) -> Result<Cell<T>, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
1.10.0 · source§impl<T> Ord for Cell<T>
impl<T> Ord for Cell<T>
1.10.0 · source§impl<T> PartialOrd for Cell<T>where
T: PartialOrd + Copy,
impl<T> PartialOrd for Cell<T>where
T: PartialOrd + Copy,
§impl<T> Radium for Cell<*mut T>
impl<T> Radium for Cell<*mut T>
type Item = *mut T
§fn into_inner(self) -> *mut T
fn into_inner(self) -> *mut T
§fn swap(&self, value: *mut T, _: Ordering) -> *mut T
fn swap(&self, value: *mut T, _: Ordering) -> *mut T
§fn compare_and_swap(&self, current: *mut T, new: *mut T, _: Ordering) -> *mut T
fn compare_and_swap(&self, current: *mut T, new: *mut T, _: Ordering) -> *mut T
compare_exchange
or compare_exchange_weak
insteadcurrent
value. Read more§fn compare_exchange(
&self,
current: *mut T,
new: *mut T,
_: Ordering,
_: Ordering,
) -> Result<*mut T, *mut T>
fn compare_exchange( &self, current: *mut T, new: *mut T, _: Ordering, _: Ordering, ) -> Result<*mut T, *mut T>
current
value. Read more§impl Radium for Cell<bool>
impl Radium for Cell<bool>
type Item = bool
§fn into_inner(self) -> bool
fn into_inner(self) -> bool
§fn swap(&self, value: bool, _: Ordering) -> bool
fn swap(&self, value: bool, _: Ordering) -> bool
§fn compare_and_swap(&self, current: bool, new: bool, _: Ordering) -> bool
fn compare_and_swap(&self, current: bool, new: bool, _: Ordering) -> bool
compare_exchange
or compare_exchange_weak
insteadcurrent
value. Read more§fn compare_exchange(
&self,
current: bool,
new: bool,
_: Ordering,
_: Ordering,
) -> Result<bool, bool>
fn compare_exchange( &self, current: bool, new: bool, _: Ordering, _: Ordering, ) -> Result<bool, bool>
current
value. Read more§fn compare_exchange_weak(
&self,
current: bool,
new: bool,
success: Ordering,
failure: Ordering,
) -> Result<bool, bool>
fn compare_exchange_weak( &self, current: bool, new: bool, success: Ordering, failure: Ordering, ) -> Result<bool, bool>
current
value. Read more§fn fetch_update<F>(&self, _: Ordering, _: Ordering, f: F) -> Result<bool, bool>
fn fetch_update<F>(&self, _: Ordering, _: Ordering, f: F) -> Result<bool, bool>
§fn fetch_and(&self, value: bool, _: Ordering) -> bool
fn fetch_and(&self, value: bool, _: Ordering) -> bool
value
, and stores the result in self
. Read more§fn fetch_nand(&self, value: bool, _: Ordering) -> bool
fn fetch_nand(&self, value: bool, _: Ordering) -> bool
value
, and stores the result in self
. Read more§impl Radium for Cell<i16>
impl Radium for Cell<i16>
type Item = i16
§fn into_inner(self) -> i16
fn into_inner(self) -> i16
§fn compare_and_swap(&self, current: i16, new: i16, _: Ordering) -> i16
fn compare_and_swap(&self, current: i16, new: i16, _: Ordering) -> i16
compare_exchange
or compare_exchange_weak
insteadcurrent
value. Read more§fn compare_exchange(
&self,
current: i16,
new: i16,
_: Ordering,
_: Ordering,
) -> Result<i16, i16>
fn compare_exchange( &self, current: i16, new: i16, _: Ordering, _: Ordering, ) -> Result<i16, i16>
current
value. Read more§fn compare_exchange_weak(
&self,
current: i16,
new: i16,
success: Ordering,
failure: Ordering,
) -> Result<i16, i16>
fn compare_exchange_weak( &self, current: i16, new: i16, success: Ordering, failure: Ordering, ) -> Result<i16, i16>
current
value. Read more§fn fetch_update<F>(&self, _: Ordering, _: Ordering, f: F) -> Result<i16, i16>
fn fetch_update<F>(&self, _: Ordering, _: Ordering, f: F) -> Result<i16, i16>
§fn fetch_and(&self, value: i16, _: Ordering) -> i16
fn fetch_and(&self, value: i16, _: Ordering) -> i16
value
, and stores the result in self
. Read more§fn fetch_nand(&self, value: i16, _: Ordering) -> i16
fn fetch_nand(&self, value: i16, _: Ordering) -> i16
value
, and stores the result in self
. Read more§fn fetch_or(&self, value: i16, _: Ordering) -> i16
fn fetch_or(&self, value: i16, _: Ordering) -> i16
value
, and stores the result in self
. Read more§fn fetch_xor(&self, value: i16, _: Ordering) -> i16
fn fetch_xor(&self, value: i16, _: Ordering) -> i16
value
, and stores the result in self
. Read more§impl Radium for Cell<i32>
impl Radium for Cell<i32>
type Item = i32
§fn into_inner(self) -> i32
fn into_inner(self) -> i32
§fn compare_and_swap(&self, current: i32, new: i32, _: Ordering) -> i32
fn compare_and_swap(&self, current: i32, new: i32, _: Ordering) -> i32
compare_exchange
or compare_exchange_weak
insteadcurrent
value. Read more§fn compare_exchange(
&self,
current: i32,
new: i32,
_: Ordering,
_: Ordering,
) -> Result<i32, i32>
fn compare_exchange( &self, current: i32, new: i32, _: Ordering, _: Ordering, ) -> Result<i32, i32>
current
value. Read more§fn compare_exchange_weak(
&self,
current: i32,
new: i32,
success: Ordering,
failure: Ordering,
) -> Result<i32, i32>
fn compare_exchange_weak( &self, current: i32, new: i32, success: Ordering, failure: Ordering, ) -> Result<i32, i32>
current
value. Read more§fn fetch_update<F>(&self, _: Ordering, _: Ordering, f: F) -> Result<i32, i32>
fn fetch_update<F>(&self, _: Ordering, _: Ordering, f: F) -> Result<i32, i32>
§fn fetch_and(&self, value: i32, _: Ordering) -> i32
fn fetch_and(&self, value: i32, _: Ordering) -> i32
value
, and stores the result in self
. Read more§fn fetch_nand(&self, value: i32, _: Ordering) -> i32
fn fetch_nand(&self, value: i32, _: Ordering) -> i32
value
, and stores the result in self
. Read more§fn fetch_or(&self, value: i32, _: Ordering) -> i32
fn fetch_or(&self, value: i32, _: Ordering) -> i32
value
, and stores the result in self
. Read more§fn fetch_xor(&self, value: i32, _: Ordering) -> i32
fn fetch_xor(&self, value: i32, _: Ordering) -> i32
value
, and stores the result in self
. Read more§impl Radium for Cell<i64>
impl Radium for Cell<i64>
type Item = i64
§fn into_inner(self) -> i64
fn into_inner(self) -> i64
§fn compare_and_swap(&self, current: i64, new: i64, _: Ordering) -> i64
fn compare_and_swap(&self, current: i64, new: i64, _: Ordering) -> i64
compare_exchange
or compare_exchange_weak
insteadcurrent
value. Read more§fn compare_exchange(
&self,
current: i64,
new: i64,
_: Ordering,
_: Ordering,
) -> Result<i64, i64>
fn compare_exchange( &self, current: i64, new: i64, _: Ordering, _: Ordering, ) -> Result<i64, i64>
current
value. Read more§fn compare_exchange_weak(
&self,
current: i64,
new: i64,
success: Ordering,
failure: Ordering,
) -> Result<i64, i64>
fn compare_exchange_weak( &self, current: i64, new: i64, success: Ordering, failure: Ordering, ) -> Result<i64, i64>
current
value. Read more§fn fetch_update<F>(&self, _: Ordering, _: Ordering, f: F) -> Result<i64, i64>
fn fetch_update<F>(&self, _: Ordering, _: Ordering, f: F) -> Result<i64, i64>
§fn fetch_and(&self, value: i64, _: Ordering) -> i64
fn fetch_and(&self, value: i64, _: Ordering) -> i64
value
, and stores the result in self
. Read more§fn fetch_nand(&self, value: i64, _: Ordering) -> i64
fn fetch_nand(&self, value: i64, _: Ordering) -> i64
value
, and stores the result in self
. Read more§fn fetch_or(&self, value: i64, _: Ordering) -> i64
fn fetch_or(&self, value: i64, _: Ordering) -> i64
value
, and stores the result in self
. Read more§fn fetch_xor(&self, value: i64, _: Ordering) -> i64
fn fetch_xor(&self, value: i64, _: Ordering) -> i64
value
, and stores the result in self
. Read more§impl Radium for Cell<i8>
impl Radium for Cell<i8>
type Item = i8
§fn into_inner(self) -> i8
fn into_inner(self) -> i8
§fn compare_and_swap(&self, current: i8, new: i8, _: Ordering) -> i8
fn compare_and_swap(&self, current: i8, new: i8, _: Ordering) -> i8
compare_exchange
or compare_exchange_weak
insteadcurrent
value. Read more§fn compare_exchange(
&self,
current: i8,
new: i8,
_: Ordering,
_: Ordering,
) -> Result<i8, i8>
fn compare_exchange( &self, current: i8, new: i8, _: Ordering, _: Ordering, ) -> Result<i8, i8>
current
value. Read more§fn compare_exchange_weak(
&self,
current: i8,
new: i8,
success: Ordering,
failure: Ordering,
) -> Result<i8, i8>
fn compare_exchange_weak( &self, current: i8, new: i8, success: Ordering, failure: Ordering, ) -> Result<i8, i8>
current
value. Read more§fn fetch_update<F>(&self, _: Ordering, _: Ordering, f: F) -> Result<i8, i8>
fn fetch_update<F>(&self, _: Ordering, _: Ordering, f: F) -> Result<i8, i8>
§fn fetch_and(&self, value: i8, _: Ordering) -> i8
fn fetch_and(&self, value: i8, _: Ordering) -> i8
value
, and stores the result in self
. Read more§fn fetch_nand(&self, value: i8, _: Ordering) -> i8
fn fetch_nand(&self, value: i8, _: Ordering) -> i8
value
, and stores the result in self
. Read more§fn fetch_or(&self, value: i8, _: Ordering) -> i8
fn fetch_or(&self, value: i8, _: Ordering) -> i8
value
, and stores the result in self
. Read more§fn fetch_xor(&self, value: i8, _: Ordering) -> i8
fn fetch_xor(&self, value: i8, _: Ordering) -> i8
value
, and stores the result in self
. Read more§impl Radium for Cell<isize>
impl Radium for Cell<isize>
type Item = isize
§fn into_inner(self) -> isize
fn into_inner(self) -> isize
§fn swap(&self, value: isize, _: Ordering) -> isize
fn swap(&self, value: isize, _: Ordering) -> isize
§fn compare_and_swap(&self, current: isize, new: isize, _: Ordering) -> isize
fn compare_and_swap(&self, current: isize, new: isize, _: Ordering) -> isize
compare_exchange
or compare_exchange_weak
insteadcurrent
value. Read more§fn compare_exchange(
&self,
current: isize,
new: isize,
_: Ordering,
_: Ordering,
) -> Result<isize, isize>
fn compare_exchange( &self, current: isize, new: isize, _: Ordering, _: Ordering, ) -> Result<isize, isize>
current
value. Read more§fn compare_exchange_weak(
&self,
current: isize,
new: isize,
success: Ordering,
failure: Ordering,
) -> Result<isize, isize>
fn compare_exchange_weak( &self, current: isize, new: isize, success: Ordering, failure: Ordering, ) -> Result<isize, isize>
current
value. Read more§fn fetch_update<F>(
&self,
_: Ordering,
_: Ordering,
f: F,
) -> Result<isize, isize>
fn fetch_update<F>( &self, _: Ordering, _: Ordering, f: F, ) -> Result<isize, isize>
§fn fetch_and(&self, value: isize, _: Ordering) -> isize
fn fetch_and(&self, value: isize, _: Ordering) -> isize
value
, and stores the result in self
. Read more§fn fetch_nand(&self, value: isize, _: Ordering) -> isize
fn fetch_nand(&self, value: isize, _: Ordering) -> isize
value
, and stores the result in self
. Read more§fn fetch_or(&self, value: isize, _: Ordering) -> isize
fn fetch_or(&self, value: isize, _: Ordering) -> isize
value
, and stores the result in self
. Read more§fn fetch_xor(&self, value: isize, _: Ordering) -> isize
fn fetch_xor(&self, value: isize, _: Ordering) -> isize
value
, and stores the result in self
. Read more§impl Radium for Cell<u16>
impl Radium for Cell<u16>
type Item = u16
§fn into_inner(self) -> u16
fn into_inner(self) -> u16
§fn compare_and_swap(&self, current: u16, new: u16, _: Ordering) -> u16
fn compare_and_swap(&self, current: u16, new: u16, _: Ordering) -> u16
compare_exchange
or compare_exchange_weak
insteadcurrent
value. Read more§fn compare_exchange(
&self,
current: u16,
new: u16,
_: Ordering,
_: Ordering,
) -> Result<u16, u16>
fn compare_exchange( &self, current: u16, new: u16, _: Ordering, _: Ordering, ) -> Result<u16, u16>
current
value. Read more§fn compare_exchange_weak(
&self,
current: u16,
new: u16,
success: Ordering,
failure: Ordering,
) -> Result<u16, u16>
fn compare_exchange_weak( &self, current: u16, new: u16, success: Ordering, failure: Ordering, ) -> Result<u16, u16>
current
value. Read more§fn fetch_update<F>(&self, _: Ordering, _: Ordering, f: F) -> Result<u16, u16>
fn fetch_update<F>(&self, _: Ordering, _: Ordering, f: F) -> Result<u16, u16>
§fn fetch_and(&self, value: u16, _: Ordering) -> u16
fn fetch_and(&self, value: u16, _: Ordering) -> u16
value
, and stores the result in self
. Read more§fn fetch_nand(&self, value: u16, _: Ordering) -> u16
fn fetch_nand(&self, value: u16, _: Ordering) -> u16
value
, and stores the result in self
. Read more§fn fetch_or(&self, value: u16, _: Ordering) -> u16
fn fetch_or(&self, value: u16, _: Ordering) -> u16
value
, and stores the result in self
. Read more§fn fetch_xor(&self, value: u16, _: Ordering) -> u16
fn fetch_xor(&self, value: u16, _: Ordering) -> u16
value
, and stores the result in self
. Read more§impl Radium for Cell<u32>
impl Radium for Cell<u32>
type Item = u32
§fn into_inner(self) -> u32
fn into_inner(self) -> u32
§fn compare_and_swap(&self, current: u32, new: u32, _: Ordering) -> u32
fn compare_and_swap(&self, current: u32, new: u32, _: Ordering) -> u32
compare_exchange
or compare_exchange_weak
insteadcurrent
value. Read more§fn compare_exchange(
&self,
current: u32,
new: u32,
_: Ordering,
_: Ordering,
) -> Result<u32, u32>
fn compare_exchange( &self, current: u32, new: u32, _: Ordering, _: Ordering, ) -> Result<u32, u32>
current
value. Read more§fn compare_exchange_weak(
&self,
current: u32,
new: u32,
success: Ordering,
failure: Ordering,
) -> Result<u32, u32>
fn compare_exchange_weak( &self, current: u32, new: u32, success: Ordering, failure: Ordering, ) -> Result<u32, u32>
current
value. Read more§fn fetch_update<F>(&self, _: Ordering, _: Ordering, f: F) -> Result<u32, u32>
fn fetch_update<F>(&self, _: Ordering, _: Ordering, f: F) -> Result<u32, u32>
§fn fetch_and(&self, value: u32, _: Ordering) -> u32
fn fetch_and(&self, value: u32, _: Ordering) -> u32
value
, and stores the result in self
. Read more§fn fetch_nand(&self, value: u32, _: Ordering) -> u32
fn fetch_nand(&self, value: u32, _: Ordering) -> u32
value
, and stores the result in self
. Read more§fn fetch_or(&self, value: u32, _: Ordering) -> u32
fn fetch_or(&self, value: u32, _: Ordering) -> u32
value
, and stores the result in self
. Read more§fn fetch_xor(&self, value: u32, _: Ordering) -> u32
fn fetch_xor(&self, value: u32, _: Ordering) -> u32
value
, and stores the result in self
. Read more§impl Radium for Cell<u64>
impl Radium for Cell<u64>
type Item = u64
§fn into_inner(self) -> u64
fn into_inner(self) -> u64
§fn compare_and_swap(&self, current: u64, new: u64, _: Ordering) -> u64
fn compare_and_swap(&self, current: u64, new: u64, _: Ordering) -> u64
compare_exchange
or compare_exchange_weak
insteadcurrent
value. Read more§fn compare_exchange(
&self,
current: u64,
new: u64,
_: Ordering,
_: Ordering,
) -> Result<u64, u64>
fn compare_exchange( &self, current: u64, new: u64, _: Ordering, _: Ordering, ) -> Result<u64, u64>
current
value. Read more§fn compare_exchange_weak(
&self,
current: u64,
new: u64,
success: Ordering,
failure: Ordering,
) -> Result<u64, u64>
fn compare_exchange_weak( &self, current: u64, new: u64, success: Ordering, failure: Ordering, ) -> Result<u64, u64>
current
value. Read more§fn fetch_update<F>(&self, _: Ordering, _: Ordering, f: F) -> Result<u64, u64>
fn fetch_update<F>(&self, _: Ordering, _: Ordering, f: F) -> Result<u64, u64>
§fn fetch_and(&self, value: u64, _: Ordering) -> u64
fn fetch_and(&self, value: u64, _: Ordering) -> u64
value
, and stores the result in self
. Read more§fn fetch_nand(&self, value: u64, _: Ordering) -> u64
fn fetch_nand(&self, value: u64, _: Ordering) -> u64
value
, and stores the result in self
. Read more§fn fetch_or(&self, value: u64, _: Ordering) -> u64
fn fetch_or(&self, value: u64, _: Ordering) -> u64
value
, and stores the result in self
. Read more§fn fetch_xor(&self, value: u64, _: Ordering) -> u64
fn fetch_xor(&self, value: u64, _: Ordering) -> u64
value
, and stores the result in self
. Read more§impl Radium for Cell<u8>
impl Radium for Cell<u8>
type Item = u8
§fn into_inner(self) -> u8
fn into_inner(self) -> u8
§fn compare_and_swap(&self, current: u8, new: u8, _: Ordering) -> u8
fn compare_and_swap(&self, current: u8, new: u8, _: Ordering) -> u8
compare_exchange
or compare_exchange_weak
insteadcurrent
value. Read more§fn compare_exchange(
&self,
current: u8,
new: u8,
_: Ordering,
_: Ordering,
) -> Result<u8, u8>
fn compare_exchange( &self, current: u8, new: u8, _: Ordering, _: Ordering, ) -> Result<u8, u8>
current
value. Read more§fn compare_exchange_weak(
&self,
current: u8,
new: u8,
success: Ordering,
failure: Ordering,
) -> Result<u8, u8>
fn compare_exchange_weak( &self, current: u8, new: u8, success: Ordering, failure: Ordering, ) -> Result<u8, u8>
current
value. Read more§fn fetch_update<F>(&self, _: Ordering, _: Ordering, f: F) -> Result<u8, u8>
fn fetch_update<F>(&self, _: Ordering, _: Ordering, f: F) -> Result<u8, u8>
§fn fetch_and(&self, value: u8, _: Ordering) -> u8
fn fetch_and(&self, value: u8, _: Ordering) -> u8
value
, and stores the result in self
. Read more§fn fetch_nand(&self, value: u8, _: Ordering) -> u8
fn fetch_nand(&self, value: u8, _: Ordering) -> u8
value
, and stores the result in self
. Read more§fn fetch_or(&self, value: u8, _: Ordering) -> u8
fn fetch_or(&self, value: u8, _: Ordering) -> u8
value
, and stores the result in self
. Read more§fn fetch_xor(&self, value: u8, _: Ordering) -> u8
fn fetch_xor(&self, value: u8, _: Ordering) -> u8
value
, and stores the result in self
. Read more§impl Radium for Cell<usize>
impl Radium for Cell<usize>
type Item = usize
§fn into_inner(self) -> usize
fn into_inner(self) -> usize
§fn swap(&self, value: usize, _: Ordering) -> usize
fn swap(&self, value: usize, _: Ordering) -> usize
§fn compare_and_swap(&self, current: usize, new: usize, _: Ordering) -> usize
fn compare_and_swap(&self, current: usize, new: usize, _: Ordering) -> usize
compare_exchange
or compare_exchange_weak
insteadcurrent
value. Read more§fn compare_exchange(
&self,
current: usize,
new: usize,
_: Ordering,
_: Ordering,
) -> Result<usize, usize>
fn compare_exchange( &self, current: usize, new: usize, _: Ordering, _: Ordering, ) -> Result<usize, usize>
current
value. Read more§fn compare_exchange_weak(
&self,
current: usize,
new: usize,
success: Ordering,
failure: Ordering,
) -> Result<usize, usize>
fn compare_exchange_weak( &self, current: usize, new: usize, success: Ordering, failure: Ordering, ) -> Result<usize, usize>
current
value. Read more§fn fetch_update<F>(
&self,
_: Ordering,
_: Ordering,
f: F,
) -> Result<usize, usize>
fn fetch_update<F>( &self, _: Ordering, _: Ordering, f: F, ) -> Result<usize, usize>
§fn fetch_and(&self, value: usize, _: Ordering) -> usize
fn fetch_and(&self, value: usize, _: Ordering) -> usize
value
, and stores the result in self
. Read more§fn fetch_nand(&self, value: usize, _: Ordering) -> usize
fn fetch_nand(&self, value: usize, _: Ordering) -> usize
value
, and stores the result in self
. Read more§fn fetch_or(&self, value: usize, _: Ordering) -> usize
fn fetch_or(&self, value: usize, _: Ordering) -> usize
value
, and stores the result in self
. Read more§fn fetch_xor(&self, value: usize, _: Ordering) -> usize
fn fetch_xor(&self, value: usize, _: Ordering) -> usize
value
, and stores the result in self
. Read moresource§impl<T> Serialize for Cell<T>
impl<T> Serialize for Cell<T>
source§fn serialize<S>(
&self,
serializer: S,
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where
S: Serializer,
fn serialize<S>(
&self,
serializer: S,
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where
S: Serializer,
impl<T, U> CoerceUnsized<Cell<U>> for Cell<T>where
T: CoerceUnsized<U>,
impl<T, U> DispatchFromDyn<Cell<U>> for Cell<T>where
T: DispatchFromDyn<U>,
impl<T> Eq for Cell<T>
impl<T> Send for Cell<T>
impl<T> !Sync for Cell<T>where
T: ?Sized,
Auto Trait Implementations§
impl<T> !Freeze for Cell<T>
impl<T> !RefUnwindSafe for Cell<T>
impl<T> Unpin for Cell<T>
impl<T> UnwindSafe for Cell<T>where
T: UnwindSafe + ?Sized,
Blanket Implementations§
§impl<T> BitView for Twhere
T: BitStore,
impl<T> BitView for Twhere
T: BitStore,
§fn view_bits<O>(&self) -> &BitSlice<T, O> ⓘwhere
O: BitOrder,
fn view_bits<O>(&self) -> &BitSlice<T, O> ⓘwhere
O: BitOrder,
§fn try_view_bits<O>(&self) -> Result<&BitSlice<T, O>, BitSpanError<T>>where
O: BitOrder,
fn try_view_bits<O>(&self) -> Result<&BitSlice<T, O>, BitSpanError<T>>where
O: BitOrder,
§fn view_bits_mut<O>(&mut self) -> &mut BitSlice<T, O> ⓘwhere
O: BitOrder,
fn view_bits_mut<O>(&mut self) -> &mut BitSlice<T, O> ⓘwhere
O: BitOrder,
§fn try_view_bits_mut<O>(
&mut self,
) -> Result<&mut BitSlice<T, O>, BitSpanError<T>>where
O: BitOrder,
fn try_view_bits_mut<O>(
&mut self,
) -> Result<&mut BitSlice<T, O>, BitSpanError<T>>where
O: BitOrder,
§impl<T> BitViewSized for Twhere
T: BitStore,
impl<T> BitViewSized for Twhere
T: BitStore,
§fn as_raw_slice(&self) -> &[<T as BitView>::Store]
fn as_raw_slice(&self) -> &[<T as BitView>::Store]
§fn as_raw_mut_slice(&mut self) -> &mut [<T as BitView>::Store]
fn as_raw_mut_slice(&mut self) -> &mut [<T as BitView>::Store]
§fn into_bitarray<O>(self) -> BitArray<Self, O>where
O: BitOrder,
fn into_bitarray<O>(self) -> BitArray<Self, O>where
O: BitOrder,
self
in a BitArray
.source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<T> CheckedConversion for T
impl<T> CheckedConversion for T
§fn checked_from<T>(t: T) -> Option<Self>where
Self: TryFrom<T>,
fn checked_from<T>(t: T) -> Option<Self>where
Self: TryFrom<T>,
§fn checked_into<T>(self) -> Option<T>where
Self: TryInto<T>,
fn checked_into<T>(self) -> Option<T>where
Self: TryInto<T>,
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
§impl<T> Conv for T
impl<T> Conv for T
§impl<T1> DecodeUntypedSlice for T1where
T1: From<UntypedValue>,
impl<T1> DecodeUntypedSlice for T1where
T1: From<UntypedValue>,
§fn decode_untyped_slice(results: &[UntypedValue]) -> Result<T1, UntypedError>
fn decode_untyped_slice(results: &[UntypedValue]) -> Result<T1, UntypedError>
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
. Box<dyn Any>
can
then be further downcast
into Box<ConcreteType>
where ConcreteType
implements Trait
.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s.§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.§impl<T> FmtForward for T
impl<T> FmtForward for T
§fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
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,
self
to use its Display
implementation when
Debug
-formatted.§fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
self
to use its LowerExp
implementation when
Debug
-formatted.§fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
self
to use its LowerHex
implementation when
Debug
-formatted.§fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
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,
self
to use its Pointer
implementation when
Debug
-formatted.§fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
self
to use its UpperExp
implementation when
Debug
-formatted.§fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
self
to use its UpperHex
implementation when
Debug
-formatted.§fn fmt_list(self) -> FmtList<Self>where
&'a Self: for<'a> IntoIterator,
fn fmt_list(self) -> FmtList<Self>where
&'a Self: for<'a> IntoIterator,
§impl<T> FromBits<T> for T
impl<T> FromBits<T> for T
§impl<T> FromFd for T
impl<T> FromFd for T
§impl<T> FromFilelike for T
impl<T> FromFilelike for T
§fn from_filelike(owned: OwnedFd) -> T
fn from_filelike(owned: OwnedFd) -> T
Self
from the given filelike object. Read more§fn from_into_filelike<Owned>(owned: Owned) -> Twhere
Owned: IntoFilelike,
fn from_into_filelike<Owned>(owned: Owned) -> Twhere
Owned: IntoFilelike,
Self
from the given filelike object
converted from into_owned
. Read more§impl<T> FromSocketlike for T
impl<T> FromSocketlike for T
§fn from_socketlike(owned: OwnedFd) -> T
fn from_socketlike(owned: OwnedFd) -> T
Self
from the given socketlike object.§fn from_into_socketlike<Owned>(owned: Owned) -> Twhere
Owned: IntoSocketlike,
fn from_into_socketlike<Owned>(owned: Owned) -> Twhere
Owned: IntoSocketlike,
Self
from the given socketlike object
converted from into_owned
.§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more§impl<T, Outer> IsWrappedBy<Outer> for T
impl<T, Outer> IsWrappedBy<Outer> for T
§impl<T> Pipe for Twhere
T: ?Sized,
impl<T> Pipe for Twhere
T: ?Sized,
§fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
§fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
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) -> Rwhere
R: 'a,
fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
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
fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
§fn pipe_borrow_mut<'a, B, R>(
&'a mut self,
func: impl FnOnce(&'a mut B) -> R,
) -> R
fn pipe_borrow_mut<'a, B, R>( &'a mut self, func: impl FnOnce(&'a mut B) -> R, ) -> R
§fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
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
fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
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
fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
self
, then passes self.deref()
into the pipe function.§impl<T> SaturatedConversion for T
impl<T> SaturatedConversion for T
§fn saturated_from<T>(t: T) -> Selfwhere
Self: UniqueSaturatedFrom<T>,
fn saturated_from<T>(t: T) -> Selfwhere
Self: UniqueSaturatedFrom<T>,
§fn saturated_into<T>(self) -> Twhere
Self: UniqueSaturatedInto<T>,
fn saturated_into<T>(self) -> Twhere
Self: UniqueSaturatedInto<T>,
T
. Read more§impl<T> Tap for T
impl<T> Tap for T
§fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
Borrow<B>
of a value. Read more§fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
BorrowMut<B>
of a value. Read more§fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
AsRef<R>
view of a value. Read more§fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
AsMut<R>
view of a value. Read more§fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
Deref::Target
of a value. Read more§fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
Deref::Target
of a value. Read more§fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
.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
.tap_mut()
only in debug builds, and is erased in release
builds.§fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
.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
fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
.tap_borrow_mut()
only in debug builds, and is erased in release
builds.§fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
.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
fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
.tap_ref_mut()
only in debug builds, and is erased in release
builds.§fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
.tap_deref()
only in debug builds, and is erased in release
builds.§impl<T> TryConv for T
impl<T> TryConv for T
§impl<S, T> UncheckedInto<T> for Swhere
T: UncheckedFrom<S>,
impl<S, T> UncheckedInto<T> for Swhere
T: UncheckedFrom<S>,
§fn unchecked_into(self) -> T
fn unchecked_into(self) -> T
unchecked_from
.§impl<T, S> UniqueSaturatedInto<T> for S
impl<T, S> UniqueSaturatedInto<T> for S
§fn unique_saturated_into(self) -> T
fn unique_saturated_into(self) -> T
T
.