Struct tract_nnef::internal::tract_downcast_rs::__std::cell::Cell 1.0.0[−][src]
#[repr(transparent)]pub struct Cell<T> where
T: ?Sized, { /* fields omitted */ }
A mutable memory location.
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
impl<T> Cell<T>
[src]
pub const fn new(value: T) -> Cell<T>
1.0.0 (const: 1.24.0)[src]
pub fn set(&self, val: T)
[src]
pub fn swap(&self, other: &Cell<T>)
1.17.0[src]
Swaps the values of two Cells.
Difference with std::mem::swap
is that this function doesn’t require &mut
reference.
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());
pub fn replace(&self, val: T) -> T
1.17.0[src]
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);
pub const fn into_inner(self) -> T
1.17.0[src]
Unwraps the value.
Examples
use std::cell::Cell; let c = Cell::new(5); let five = c.into_inner(); assert_eq!(five, 5);
impl<T> Cell<T> where
T: Copy,
[src]
T: Copy,
pub fn get(&self) -> T
[src]
Returns a copy of the contained value.
Examples
use std::cell::Cell; let c = Cell::new(5); let five = c.get();
pub fn update<F>(&self, f: F) -> T where
F: FnOnce(T) -> T,
[src]
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);
impl<T> Cell<T> where
T: ?Sized,
[src]
T: ?Sized,
pub const fn as_ptr(&self) -> *mut T
1.12.0 (const: 1.32.0)[src]
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();
pub fn get_mut(&mut self) -> &mut TⓘNotable traits for &'_ mut R
impl<'_, R> Read for &'_ mut R where
R: Read + ?Sized, impl<'_, W> Write for &'_ mut W where
W: Write + ?Sized, impl<'_, I> Iterator for &'_ mut I where
I: Iterator + ?Sized, type Item = <I as Iterator>::Item;impl<'_, F> Future for &'_ mut F where
F: Future + Unpin + ?Sized, type Output = <F as Future>::Output;
1.11.0[src]
Notable traits for &'_ mut R
impl<'_, R> Read for &'_ mut R where
R: Read + ?Sized, impl<'_, W> Write for &'_ mut W where
W: Write + ?Sized, impl<'_, I> Iterator for &'_ mut I where
I: Iterator + ?Sized, type Item = <I as Iterator>::Item;impl<'_, F> Future for &'_ mut F where
F: Future + Unpin + ?Sized, type Output = <F as Future>::Output;
Returns a mutable reference to the underlying data.
This call borrows Cell
mutably (at compile-time) which guarantees
that we possess the only reference.
Examples
use std::cell::Cell; let mut c = Cell::new(5); *c.get_mut() += 1; assert_eq!(c.get(), 6);
pub fn from_mut(t: &mut T) -> &Cell<T>
1.37.0[src]
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);
impl<T> Cell<T> where
T: Default,
[src]
T: Default,
pub fn take(&self) -> T
1.17.0[src]
Takes the value of the cell, leaving Default::default()
in its place.
Examples
use std::cell::Cell; let c = Cell::new(5); let five = c.take(); assert_eq!(five, 5); assert_eq!(c.into_inner(), 0);
impl<T> Cell<[T]>
[src]
pub fn as_slice_of_cells(&self) -> &[Cell<T>]ⓘ
1.37.0[src]
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);
Trait Implementations
impl<'a, T> AssignElem<T> for &'a Cell<T>
[src]
Assignable element, simply self.set(input)
.
pub fn assign_elem(self, input: T)
[src]
impl<R> BitStore for Cell<R> where
R: BitRegister,
Cell<R>: Radium,
<Cell<R> as Radium>::Item == R,
R: BitRegister,
Cell<R>: Radium,
<Cell<R> as Radium>::Item == R,
type Access = Cell<R>
The modifier type over Self::Mem
used to perform memory access.
type Alias = Cell<R>
A sibling BitStore
implementor that performs alias-aware memory
access. Read more
type Mem = R
The register type that the implementor describes.
pub fn load_value(&self) -> <Cell<R> as BitStore>::Mem
pub fn get_bit<O>(&self, index: BitIdx<Self::Mem>) -> bool where
O: BitOrder,
O: BitOrder,
pub fn get_bits(&self, mask: BitMask<Self::Mem>) -> Self::Mem
impl<T> Clone for Cell<T> where
T: Copy,
[src]
T: Copy,
impl<T, U> CoerceUnsized<Cell<U>> for Cell<T> where
T: CoerceUnsized<U>,
[src]
T: CoerceUnsized<U>,
impl<T> Debug for Cell<T> where
T: Copy + Debug,
[src]
T: Copy + Debug,
impl<T> Default for Cell<T> where
T: Default,
[src]
T: Default,
impl<T> Eq for Cell<T> where
T: Eq + Copy,
1.2.0[src]
T: Eq + Copy,
impl<T> From<T> for Cell<T>
1.12.0[src]
impl<T> Ord for Cell<T> where
T: Ord + Copy,
1.10.0[src]
T: Ord + Copy,
pub fn cmp(&self, other: &Cell<T>) -> Ordering
[src]
#[must_use]pub fn max(self, other: Self) -> Self
1.21.0[src]
#[must_use]pub fn min(self, other: Self) -> Self
1.21.0[src]
#[must_use]pub fn clamp(self, min: Self, max: Self) -> Self
1.50.0[src]
impl<T> PartialEq<Cell<T>> for Cell<T> where
T: PartialEq<T> + Copy,
[src]
T: PartialEq<T> + Copy,
impl<T> PartialOrd<Cell<T>> for Cell<T> where
T: PartialOrd<T> + Copy,
1.10.0[src]
T: PartialOrd<T> + Copy,
pub fn partial_cmp(&self, other: &Cell<T>) -> Option<Ordering>
[src]
pub fn lt(&self, other: &Cell<T>) -> bool
[src]
pub fn le(&self, other: &Cell<T>) -> bool
[src]
pub fn gt(&self, other: &Cell<T>) -> bool
[src]
pub fn ge(&self, other: &Cell<T>) -> bool
[src]
impl Radium for Cell<bool>
type Item = bool
pub fn new(value: bool) -> Cell<bool>
pub fn fence(Ordering)
pub fn get_mut(&mut self) -> &mut bool
pub fn into_inner(self) -> bool
pub fn load(&self, Ordering) -> bool
pub fn store(&self, value: bool, Ordering)
pub fn swap(&self, value: bool, Ordering) -> bool
pub fn compare_and_swap(&self, current: bool, new: bool, Ordering) -> bool
pub fn compare_exchange(
&self,
current: bool,
new: bool,
Ordering,
Ordering
) -> Result<bool, bool>
&self,
current: bool,
new: bool,
Ordering,
Ordering
) -> Result<bool, bool>
pub fn compare_exchange_weak(
&self,
current: bool,
new: bool,
success: Ordering,
failure: Ordering
) -> Result<bool, bool>
&self,
current: bool,
new: bool,
success: Ordering,
failure: Ordering
) -> Result<bool, bool>
pub fn fetch_and(&self, value: bool, Ordering) -> bool
pub fn fetch_nand(&self, value: bool, Ordering) -> bool
pub fn fetch_or(&self, value: bool, Ordering) -> bool
pub fn fetch_xor(&self, value: bool, Ordering) -> bool
pub fn fetch_add(&self, value: Self::Item, order: Ordering) -> Self::Item where
Self::Item: NumericOps,
Self::Item: NumericOps,
pub fn fetch_sub(&self, value: Self::Item, order: Ordering) -> Self::Item where
Self::Item: NumericOps,
Self::Item: NumericOps,
impl Radium for Cell<i8>
type Item = i8
pub fn new(value: i8) -> Cell<i8>
pub fn fence(Ordering)
pub fn get_mut(&mut self) -> &mut i8
pub fn into_inner(self) -> i8
pub fn load(&self, Ordering) -> i8
pub fn store(&self, value: i8, Ordering)
pub fn swap(&self, value: i8, Ordering) -> i8
pub fn compare_and_swap(&self, current: i8, new: i8, Ordering) -> i8
pub fn compare_exchange(
&self,
current: i8,
new: i8,
Ordering,
Ordering
) -> Result<i8, i8>
&self,
current: i8,
new: i8,
Ordering,
Ordering
) -> Result<i8, i8>
pub fn compare_exchange_weak(
&self,
current: i8,
new: i8,
success: Ordering,
failure: Ordering
) -> Result<i8, i8>
&self,
current: i8,
new: i8,
success: Ordering,
failure: Ordering
) -> Result<i8, i8>
pub fn fetch_and(&self, value: i8, Ordering) -> i8
pub fn fetch_nand(&self, value: i8, Ordering) -> i8
pub fn fetch_or(&self, value: i8, Ordering) -> i8
pub fn fetch_xor(&self, value: i8, Ordering) -> i8
pub fn fetch_add(&self, value: i8, Ordering) -> i8
pub fn fetch_sub(&self, value: i8, Ordering) -> i8
impl Radium for Cell<isize>
type Item = isize
pub fn new(value: isize) -> Cell<isize>
pub fn fence(Ordering)
pub fn get_mut(&mut self) -> &mut isize
pub fn into_inner(self) -> isize
pub fn load(&self, Ordering) -> isize
pub fn store(&self, value: isize, Ordering)
pub fn swap(&self, value: isize, Ordering) -> isize
pub fn compare_and_swap(&self, current: isize, new: isize, Ordering) -> isize
pub fn compare_exchange(
&self,
current: isize,
new: isize,
Ordering,
Ordering
) -> Result<isize, isize>
&self,
current: isize,
new: isize,
Ordering,
Ordering
) -> Result<isize, isize>
pub fn compare_exchange_weak(
&self,
current: isize,
new: isize,
success: Ordering,
failure: Ordering
) -> Result<isize, isize>
&self,
current: isize,
new: isize,
success: Ordering,
failure: Ordering
) -> Result<isize, isize>
pub fn fetch_and(&self, value: isize, Ordering) -> isize
pub fn fetch_nand(&self, value: isize, Ordering) -> isize
pub fn fetch_or(&self, value: isize, Ordering) -> isize
pub fn fetch_xor(&self, value: isize, Ordering) -> isize
pub fn fetch_add(&self, value: isize, Ordering) -> isize
pub fn fetch_sub(&self, value: isize, Ordering) -> isize
impl Radium for Cell<i64>
type Item = i64
pub fn new(value: i64) -> Cell<i64>
pub fn fence(Ordering)
pub fn get_mut(&mut self) -> &mut i64
pub fn into_inner(self) -> i64
pub fn load(&self, Ordering) -> i64
pub fn store(&self, value: i64, Ordering)
pub fn swap(&self, value: i64, Ordering) -> i64
pub fn compare_and_swap(&self, current: i64, new: i64, Ordering) -> i64
pub fn compare_exchange(
&self,
current: i64,
new: i64,
Ordering,
Ordering
) -> Result<i64, i64>
&self,
current: i64,
new: i64,
Ordering,
Ordering
) -> Result<i64, i64>
pub fn compare_exchange_weak(
&self,
current: i64,
new: i64,
success: Ordering,
failure: Ordering
) -> Result<i64, i64>
&self,
current: i64,
new: i64,
success: Ordering,
failure: Ordering
) -> Result<i64, i64>
pub fn fetch_and(&self, value: i64, Ordering) -> i64
pub fn fetch_nand(&self, value: i64, Ordering) -> i64
pub fn fetch_or(&self, value: i64, Ordering) -> i64
pub fn fetch_xor(&self, value: i64, Ordering) -> i64
pub fn fetch_add(&self, value: i64, Ordering) -> i64
pub fn fetch_sub(&self, value: i64, Ordering) -> i64
impl Radium for Cell<u8>
type Item = u8
pub fn new(value: u8) -> Cell<u8>
pub fn fence(Ordering)
pub fn get_mut(&mut self) -> &mut u8
pub fn into_inner(self) -> u8
pub fn load(&self, Ordering) -> u8
pub fn store(&self, value: u8, Ordering)
pub fn swap(&self, value: u8, Ordering) -> u8
pub fn compare_and_swap(&self, current: u8, new: u8, Ordering) -> u8
pub fn compare_exchange(
&self,
current: u8,
new: u8,
Ordering,
Ordering
) -> Result<u8, u8>
&self,
current: u8,
new: u8,
Ordering,
Ordering
) -> Result<u8, u8>
pub fn compare_exchange_weak(
&self,
current: u8,
new: u8,
success: Ordering,
failure: Ordering
) -> Result<u8, u8>
&self,
current: u8,
new: u8,
success: Ordering,
failure: Ordering
) -> Result<u8, u8>
pub fn fetch_and(&self, value: u8, Ordering) -> u8
pub fn fetch_nand(&self, value: u8, Ordering) -> u8
pub fn fetch_or(&self, value: u8, Ordering) -> u8
pub fn fetch_xor(&self, value: u8, Ordering) -> u8
pub fn fetch_add(&self, value: u8, Ordering) -> u8
pub fn fetch_sub(&self, value: u8, Ordering) -> u8
impl Radium for Cell<i32>
type Item = i32
pub fn new(value: i32) -> Cell<i32>
pub fn fence(Ordering)
pub fn get_mut(&mut self) -> &mut i32
pub fn into_inner(self) -> i32
pub fn load(&self, Ordering) -> i32
pub fn store(&self, value: i32, Ordering)
pub fn swap(&self, value: i32, Ordering) -> i32
pub fn compare_and_swap(&self, current: i32, new: i32, Ordering) -> i32
pub fn compare_exchange(
&self,
current: i32,
new: i32,
Ordering,
Ordering
) -> Result<i32, i32>
&self,
current: i32,
new: i32,
Ordering,
Ordering
) -> Result<i32, i32>
pub fn compare_exchange_weak(
&self,
current: i32,
new: i32,
success: Ordering,
failure: Ordering
) -> Result<i32, i32>
&self,
current: i32,
new: i32,
success: Ordering,
failure: Ordering
) -> Result<i32, i32>
pub fn fetch_and(&self, value: i32, Ordering) -> i32
pub fn fetch_nand(&self, value: i32, Ordering) -> i32
pub fn fetch_or(&self, value: i32, Ordering) -> i32
pub fn fetch_xor(&self, value: i32, Ordering) -> i32
pub fn fetch_add(&self, value: i32, Ordering) -> i32
pub fn fetch_sub(&self, value: i32, Ordering) -> i32
impl Radium for Cell<u16>
type Item = u16
pub fn new(value: u16) -> Cell<u16>
pub fn fence(Ordering)
pub fn get_mut(&mut self) -> &mut u16
pub fn into_inner(self) -> u16
pub fn load(&self, Ordering) -> u16
pub fn store(&self, value: u16, Ordering)
pub fn swap(&self, value: u16, Ordering) -> u16
pub fn compare_and_swap(&self, current: u16, new: u16, Ordering) -> u16
pub fn compare_exchange(
&self,
current: u16,
new: u16,
Ordering,
Ordering
) -> Result<u16, u16>
&self,
current: u16,
new: u16,
Ordering,
Ordering
) -> Result<u16, u16>
pub fn compare_exchange_weak(
&self,
current: u16,
new: u16,
success: Ordering,
failure: Ordering
) -> Result<u16, u16>
&self,
current: u16,
new: u16,
success: Ordering,
failure: Ordering
) -> Result<u16, u16>
pub fn fetch_and(&self, value: u16, Ordering) -> u16
pub fn fetch_nand(&self, value: u16, Ordering) -> u16
pub fn fetch_or(&self, value: u16, Ordering) -> u16
pub fn fetch_xor(&self, value: u16, Ordering) -> u16
pub fn fetch_add(&self, value: u16, Ordering) -> u16
pub fn fetch_sub(&self, value: u16, Ordering) -> u16
impl Radium for Cell<u32>
type Item = u32
pub fn new(value: u32) -> Cell<u32>
pub fn fence(Ordering)
pub fn get_mut(&mut self) -> &mut u32
pub fn into_inner(self) -> u32
pub fn load(&self, Ordering) -> u32
pub fn store(&self, value: u32, Ordering)
pub fn swap(&self, value: u32, Ordering) -> u32
pub fn compare_and_swap(&self, current: u32, new: u32, Ordering) -> u32
pub fn compare_exchange(
&self,
current: u32,
new: u32,
Ordering,
Ordering
) -> Result<u32, u32>
&self,
current: u32,
new: u32,
Ordering,
Ordering
) -> Result<u32, u32>
pub fn compare_exchange_weak(
&self,
current: u32,
new: u32,
success: Ordering,
failure: Ordering
) -> Result<u32, u32>
&self,
current: u32,
new: u32,
success: Ordering,
failure: Ordering
) -> Result<u32, u32>
pub fn fetch_and(&self, value: u32, Ordering) -> u32
pub fn fetch_nand(&self, value: u32, Ordering) -> u32
pub fn fetch_or(&self, value: u32, Ordering) -> u32
pub fn fetch_xor(&self, value: u32, Ordering) -> u32
pub fn fetch_add(&self, value: u32, Ordering) -> u32
pub fn fetch_sub(&self, value: u32, Ordering) -> u32
impl<T> Radium for Cell<*mut T>
type Item = *mut T
pub fn new(value: *mut T) -> Cell<*mut T>
pub fn fence(Ordering)
pub fn get_mut(&mut self) -> &mut *mut T
pub fn into_inner(self) -> *mut T
pub fn load(&self, Ordering) -> *mut T
pub fn store(&self, value: *mut T, Ordering)
pub fn swap(&self, value: *mut T, Ordering) -> *mut T
pub fn compare_and_swap(&self, current: *mut T, new: *mut T, Ordering) -> *mut T
pub fn compare_exchange(
&self,
current: *mut T,
new: *mut T,
Ordering,
Ordering
) -> Result<*mut T, *mut T>
&self,
current: *mut T,
new: *mut T,
Ordering,
Ordering
) -> Result<*mut T, *mut T>
pub fn compare_exchange_weak(
&self,
current: *mut T,
new: *mut T,
success: Ordering,
failure: Ordering
) -> Result<*mut T, *mut T>
&self,
current: *mut T,
new: *mut T,
success: Ordering,
failure: Ordering
) -> Result<*mut T, *mut T>
pub fn fetch_and(&self, value: Self::Item, order: Ordering) -> Self::Item where
Self::Item: BitOps,
Self::Item: BitOps,
pub fn fetch_nand(&self, value: Self::Item, order: Ordering) -> Self::Item where
Self::Item: BitOps,
Self::Item: BitOps,
pub fn fetch_or(&self, value: Self::Item, order: Ordering) -> Self::Item where
Self::Item: BitOps,
Self::Item: BitOps,
pub fn fetch_xor(&self, value: Self::Item, order: Ordering) -> Self::Item where
Self::Item: BitOps,
Self::Item: BitOps,
pub fn fetch_add(&self, value: Self::Item, order: Ordering) -> Self::Item where
Self::Item: NumericOps,
Self::Item: NumericOps,
pub fn fetch_sub(&self, value: Self::Item, order: Ordering) -> Self::Item where
Self::Item: NumericOps,
Self::Item: NumericOps,
impl Radium for Cell<u64>
type Item = u64
pub fn new(value: u64) -> Cell<u64>
pub fn fence(Ordering)
pub fn get_mut(&mut self) -> &mut u64
pub fn into_inner(self) -> u64
pub fn load(&self, Ordering) -> u64
pub fn store(&self, value: u64, Ordering)
pub fn swap(&self, value: u64, Ordering) -> u64
pub fn compare_and_swap(&self, current: u64, new: u64, Ordering) -> u64
pub fn compare_exchange(
&self,
current: u64,
new: u64,
Ordering,
Ordering
) -> Result<u64, u64>
&self,
current: u64,
new: u64,
Ordering,
Ordering
) -> Result<u64, u64>
pub fn compare_exchange_weak(
&self,
current: u64,
new: u64,
success: Ordering,
failure: Ordering
) -> Result<u64, u64>
&self,
current: u64,
new: u64,
success: Ordering,
failure: Ordering
) -> Result<u64, u64>
pub fn fetch_and(&self, value: u64, Ordering) -> u64
pub fn fetch_nand(&self, value: u64, Ordering) -> u64
pub fn fetch_or(&self, value: u64, Ordering) -> u64
pub fn fetch_xor(&self, value: u64, Ordering) -> u64
pub fn fetch_add(&self, value: u64, Ordering) -> u64
pub fn fetch_sub(&self, value: u64, Ordering) -> u64
impl Radium for Cell<usize>
type Item = usize
pub fn new(value: usize) -> Cell<usize>
pub fn fence(Ordering)
pub fn get_mut(&mut self) -> &mut usize
pub fn into_inner(self) -> usize
pub fn load(&self, Ordering) -> usize
pub fn store(&self, value: usize, Ordering)
pub fn swap(&self, value: usize, Ordering) -> usize
pub fn compare_and_swap(&self, current: usize, new: usize, Ordering) -> usize
pub fn compare_exchange(
&self,
current: usize,
new: usize,
Ordering,
Ordering
) -> Result<usize, usize>
&self,
current: usize,
new: usize,
Ordering,
Ordering
) -> Result<usize, usize>
pub fn compare_exchange_weak(
&self,
current: usize,
new: usize,
success: Ordering,
failure: Ordering
) -> Result<usize, usize>
&self,
current: usize,
new: usize,
success: Ordering,
failure: Ordering
) -> Result<usize, usize>
pub fn fetch_and(&self, value: usize, Ordering) -> usize
pub fn fetch_nand(&self, value: usize, Ordering) -> usize
pub fn fetch_or(&self, value: usize, Ordering) -> usize
pub fn fetch_xor(&self, value: usize, Ordering) -> usize
pub fn fetch_add(&self, value: usize, Ordering) -> usize
pub fn fetch_sub(&self, value: usize, Ordering) -> usize
impl Radium for Cell<i16>
type Item = i16
pub fn new(value: i16) -> Cell<i16>
pub fn fence(Ordering)
pub fn get_mut(&mut self) -> &mut i16
pub fn into_inner(self) -> i16
pub fn load(&self, Ordering) -> i16
pub fn store(&self, value: i16, Ordering)
pub fn swap(&self, value: i16, Ordering) -> i16
pub fn compare_and_swap(&self, current: i16, new: i16, Ordering) -> i16
pub fn compare_exchange(
&self,
current: i16,
new: i16,
Ordering,
Ordering
) -> Result<i16, i16>
&self,
current: i16,
new: i16,
Ordering,
Ordering
) -> Result<i16, i16>
pub fn compare_exchange_weak(
&self,
current: i16,
new: i16,
success: Ordering,
failure: Ordering
) -> Result<i16, i16>
&self,
current: i16,
new: i16,
success: Ordering,
failure: Ordering
) -> Result<i16, i16>
pub fn fetch_and(&self, value: i16, Ordering) -> i16
pub fn fetch_nand(&self, value: i16, Ordering) -> i16
pub fn fetch_or(&self, value: i16, Ordering) -> i16
pub fn fetch_xor(&self, value: i16, Ordering) -> i16
pub fn fetch_add(&self, value: i16, Ordering) -> i16
pub fn fetch_sub(&self, value: i16, Ordering) -> i16
impl<T> Send for Cell<T> where
T: Send + ?Sized,
[src]
T: Send + ?Sized,
impl<T> !Sync for Cell<T> where
T: ?Sized,
[src]
T: ?Sized,
Auto Trait Implementations
impl<T> !RefUnwindSafe for Cell<T>
impl<T: ?Sized> Unpin for Cell<T> where
T: Unpin,
T: Unpin,
impl<T: ?Sized> UnwindSafe for Cell<T> where
T: UnwindSafe,
T: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow(&self) -> &TⓘNotable traits for &'_ mut R
impl<'_, R> Read for &'_ mut R where
R: Read + ?Sized, impl<'_, W> Write for &'_ mut W where
W: Write + ?Sized, impl<'_, I> Iterator for &'_ mut I where
I: Iterator + ?Sized, type Item = <I as Iterator>::Item;impl<'_, F> Future for &'_ mut F where
F: Future + Unpin + ?Sized, type Output = <F as Future>::Output;
[src]
Notable traits for &'_ mut R
impl<'_, R> Read for &'_ mut R where
R: Read + ?Sized, impl<'_, W> Write for &'_ mut W where
W: Write + ?Sized, impl<'_, I> Iterator for &'_ mut I where
I: Iterator + ?Sized, type Item = <I as Iterator>::Item;impl<'_, F> Future for &'_ mut F where
F: Future + Unpin + ?Sized, type Output = <F as Future>::Output;
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut TⓘNotable traits for &'_ mut R
impl<'_, R> Read for &'_ mut R where
R: Read + ?Sized, impl<'_, W> Write for &'_ mut W where
W: Write + ?Sized, impl<'_, I> Iterator for &'_ mut I where
I: Iterator + ?Sized, type Item = <I as Iterator>::Item;impl<'_, F> Future for &'_ mut F where
F: Future + Unpin + ?Sized, type Output = <F as Future>::Output;
[src]
Notable traits for &'_ mut R
impl<'_, R> Read for &'_ mut R where
R: Read + ?Sized, impl<'_, W> Write for &'_ mut W where
W: Write + ?Sized, impl<'_, I> Iterator for &'_ mut I where
I: Iterator + ?Sized, type Item = <I as Iterator>::Item;impl<'_, F> Future for &'_ mut F where
F: Future + Unpin + ?Sized, type Output = <F as Future>::Output;
impl<T> Conv for T
impl<T> Conv for T
impl<T> Downcast for T where
T: Any,
T: Any,
pub fn into_any(self: Box<T, Global>) -> Box<dyn Any + 'static, Global>ⓘNotable traits for Box<R, Global>
impl<R> Read for Box<R, Global> where
R: Read + ?Sized, impl<W> Write for Box<W, Global> where
W: Write + ?Sized, impl<I, A> Iterator for Box<I, A> where
A: Allocator,
I: Iterator + ?Sized, type Item = <I as Iterator>::Item;impl<F, A> Future for Box<F, A> where
F: Future + Unpin + ?Sized,
A: Allocator + 'static, type Output = <F as Future>::Output;
Notable traits for Box<R, Global>
impl<R> Read for Box<R, Global> where
R: Read + ?Sized, impl<W> Write for Box<W, Global> where
W: Write + ?Sized, impl<I, A> Iterator for Box<I, A> where
A: Allocator,
I: Iterator + ?Sized, type Item = <I as Iterator>::Item;impl<F, A> Future for Box<F, A> where
F: Future + Unpin + ?Sized,
A: Allocator + 'static, type Output = <F as Future>::Output;
pub fn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
pub fn as_any(&self) -> &(dyn Any + 'static)
pub fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
impl<T> DynClone for T where
T: Clone,
[src]
T: Clone,
pub fn __clone_box(&self, Private) -> *mut ()
[src]
impl<T> FmtForward for T
pub fn fmt_binary(self) -> FmtBinary<Self> where
Self: Binary,
Self: Binary,
pub fn fmt_display(self) -> FmtDisplay<Self> where
Self: Display,
Self: Display,
pub fn fmt_lower_exp(self) -> FmtLowerExp<Self> where
Self: LowerExp,
Self: LowerExp,
pub fn fmt_lower_hex(self) -> FmtLowerHex<Self> where
Self: LowerHex,
Self: LowerHex,
pub fn fmt_octal(self) -> FmtOctal<Self> where
Self: Octal,
Self: Octal,
pub fn fmt_pointer(self) -> FmtPointer<Self> where
Self: Pointer,
Self: Pointer,
pub fn fmt_upper_exp(self) -> FmtUpperExp<Self> where
Self: UpperExp,
Self: UpperExp,
pub fn fmt_upper_hex(self) -> FmtUpperHex<Self> where
Self: UpperHex,
Self: UpperHex,
impl<T> From<!> for T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Pipe for T where
T: ?Sized,
T: ?Sized,
pub fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> R
pub fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> R where
R: 'a,
R: 'a,
pub fn pipe_ref_mut<'a, R>(
&'a mut self,
func: impl FnOnce(&'a mut Self) -> R
) -> R where
R: 'a,
&'a mut self,
func: impl FnOnce(&'a mut Self) -> R
) -> R where
R: 'a,
pub fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R where
Self: Borrow<B>,
R: 'a,
B: 'a + ?Sized,
Self: Borrow<B>,
R: 'a,
B: 'a + ?Sized,
pub fn pipe_borrow_mut<'a, B, R>(
&'a mut self,
func: impl FnOnce(&'a mut B) -> R
) -> R where
Self: BorrowMut<B>,
R: 'a,
B: 'a + ?Sized,
&'a mut self,
func: impl FnOnce(&'a mut B) -> R
) -> R where
Self: BorrowMut<B>,
R: 'a,
B: 'a + ?Sized,
pub 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,
Self: AsRef<U>,
R: 'a,
U: 'a + ?Sized,
pub 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,
&'a mut self,
func: impl FnOnce(&'a mut U) -> R
) -> R where
Self: AsMut<U>,
R: 'a,
U: 'a + ?Sized,
pub 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,
Self: Deref<Target = T>,
T: 'a + ?Sized,
R: 'a,
pub 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,
&'a mut self,
func: impl FnOnce(&'a mut T) -> R
) -> R where
Self: DerefMut<Target = T> + Deref,
T: 'a + ?Sized,
R: 'a,
impl<T> Pipe for T
impl<T> PipeAsRef for T
pub fn pipe_as_ref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R where
Self: AsRef<T>,
T: 'a,
R: 'a,
Self: AsRef<T>,
T: 'a,
R: 'a,
pub 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,
&'a mut self,
func: impl FnOnce(&'a mut T) -> R
) -> R where
Self: AsMut<T>,
T: 'a,
R: 'a,
impl<T> PipeBorrow for T
pub fn pipe_borrow<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R where
Self: Borrow<T>,
T: 'a,
R: 'a,
Self: Borrow<T>,
T: 'a,
R: 'a,
pub 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,
&'a mut self,
func: impl FnOnce(&'a mut T) -> R
) -> R where
Self: BorrowMut<T>,
T: 'a,
R: 'a,
impl<T> PipeDeref for T
pub fn pipe_deref<'a, R>(
&'a self,
func: impl FnOnce(&'a Self::Target) -> R
) -> R where
Self: Deref,
R: 'a,
&'a self,
func: impl FnOnce(&'a Self::Target) -> R
) -> R where
Self: Deref,
R: 'a,
pub fn pipe_deref_mut<'a, R>(
&'a mut self,
func: impl FnOnce(&'a mut Self::Target) -> R
) -> R where
Self: DerefMut,
R: 'a,
&'a mut self,
func: impl FnOnce(&'a mut Self::Target) -> R
) -> R where
Self: DerefMut,
R: 'a,
impl<T> PipeRef for T
pub fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> R where
R: 'a,
R: 'a,
pub fn pipe_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> R where
R: 'a,
R: 'a,
impl<T> Tap for T
pub fn tap(self, func: impl FnOnce(&Self)) -> Self
pub fn tap_mut(self, func: impl FnOnce(&mut Self)) -> Self
pub fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self where
Self: Borrow<B>,
B: ?Sized,
Self: Borrow<B>,
B: ?Sized,
pub fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self where
Self: BorrowMut<B>,
B: ?Sized,
Self: BorrowMut<B>,
B: ?Sized,
pub fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self where
Self: AsRef<R>,
R: ?Sized,
Self: AsRef<R>,
R: ?Sized,
pub fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self where
Self: AsMut<R>,
R: ?Sized,
Self: AsMut<R>,
R: ?Sized,
pub fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self where
Self: Deref<Target = T>,
T: ?Sized,
Self: Deref<Target = T>,
T: ?Sized,
pub fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self where
Self: DerefMut<Target = T> + Deref,
T: ?Sized,
Self: DerefMut<Target = T> + Deref,
T: ?Sized,
pub fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
pub fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
pub fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self where
Self: Borrow<B>,
B: ?Sized,
Self: Borrow<B>,
B: ?Sized,
pub fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self where
Self: BorrowMut<B>,
B: ?Sized,
Self: BorrowMut<B>,
B: ?Sized,
pub fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self where
Self: AsRef<R>,
R: ?Sized,
Self: AsRef<R>,
R: ?Sized,
pub fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self where
Self: AsMut<R>,
R: ?Sized,
Self: AsMut<R>,
R: ?Sized,
pub fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self where
Self: Deref<Target = T>,
T: ?Sized,
Self: Deref<Target = T>,
T: ?Sized,
pub fn tap_deref_mut_dbg<T>(self, func: impl FnOnce(&mut T)) -> Self where
Self: DerefMut<Target = T> + Deref,
T: ?Sized,
Self: DerefMut<Target = T> + Deref,
T: ?Sized,
impl<T> Tap for T
pub fn tap<F, R>(self, func: F) -> Self where
F: FnOnce(&Self) -> R,
F: FnOnce(&Self) -> R,
pub fn tap_dbg<F, R>(self, func: F) -> Self where
F: FnOnce(&Self) -> R,
F: FnOnce(&Self) -> R,
pub fn tap_mut<F, R>(self, func: F) -> Self where
F: FnOnce(&mut Self) -> R,
F: FnOnce(&mut Self) -> R,
pub fn tap_mut_dbg<F, R>(self, func: F) -> Self where
F: FnOnce(&mut Self) -> R,
F: FnOnce(&mut Self) -> R,
impl<T, U> TapAsRef<U> for T where
U: ?Sized,
U: ?Sized,
pub fn tap_ref<F, R>(self, func: F) -> Self where
Self: AsRef<T>,
F: FnOnce(&T) -> R,
Self: AsRef<T>,
F: FnOnce(&T) -> R,
pub fn tap_ref_dbg<F, R>(self, func: F) -> Self where
Self: AsRef<T>,
F: FnOnce(&T) -> R,
Self: AsRef<T>,
F: FnOnce(&T) -> R,
pub fn tap_ref_mut<F, R>(self, func: F) -> Self where
Self: AsMut<T>,
F: FnOnce(&mut T) -> R,
Self: AsMut<T>,
F: FnOnce(&mut T) -> R,
pub fn tap_ref_mut_dbg<F, R>(self, func: F) -> Self where
Self: AsMut<T>,
F: FnOnce(&mut T) -> R,
Self: AsMut<T>,
F: FnOnce(&mut T) -> R,
impl<T, U> TapBorrow<U> for T where
U: ?Sized,
U: ?Sized,
pub fn tap_borrow<F, R>(self, func: F) -> Self where
Self: Borrow<T>,
F: FnOnce(&T) -> R,
Self: Borrow<T>,
F: FnOnce(&T) -> R,
pub fn tap_borrow_dbg<F, R>(self, func: F) -> Self where
Self: Borrow<T>,
F: FnOnce(&T) -> R,
Self: Borrow<T>,
F: FnOnce(&T) -> R,
pub fn tap_borrow_mut<F, R>(self, func: F) -> Self where
Self: BorrowMut<T>,
F: FnOnce(&mut T) -> R,
Self: BorrowMut<T>,
F: FnOnce(&mut T) -> R,
pub fn tap_borrow_mut_dbg<F, R>(self, func: F) -> Self where
Self: BorrowMut<T>,
F: FnOnce(&mut T) -> R,
Self: BorrowMut<T>,
F: FnOnce(&mut T) -> R,
impl<T> TapDeref for T
pub fn tap_deref<F, R>(self, func: F) -> Self where
Self: Deref,
F: FnOnce(&Self::Target) -> R,
Self: Deref,
F: FnOnce(&Self::Target) -> R,
pub fn tap_deref_dbg<F, R>(self, func: F) -> Self where
Self: Deref,
F: FnOnce(&Self::Target) -> R,
Self: Deref,
F: FnOnce(&Self::Target) -> R,
pub fn tap_deref_mut<F, R>(self, func: F) -> Self where
Self: DerefMut,
F: FnOnce(&mut Self::Target) -> R,
Self: DerefMut,
F: FnOnce(&mut Self::Target) -> R,
pub fn tap_deref_mut_dbg<F, R>(self, func: F) -> Self where
Self: DerefMut,
F: FnOnce(&mut Self::Target) -> R,
Self: DerefMut,
F: FnOnce(&mut Self::Target) -> R,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T> TryConv for T
impl<T> TryConv for T
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,