cairo_vm::with_std::cell

Struct Cell

1.0.0 · Source
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>

1.0.0 (const: 1.24.0) · Source

pub const fn new(value: T) -> Cell<T>

Creates a new Cell containing the given value.

§Examples
use std::cell::Cell;

let c = Cell::new(5);
1.0.0 · Source

pub fn set(&self, val: T)

Sets the contained value.

§Examples
use std::cell::Cell;

let c = Cell::new(5);

c.set(10);
1.17.0 · Source

pub fn swap(&self, other: &Cell<T>)

Swaps the values of two Cells.

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 Cells that partially overlap. (Using just standard library methods, it is impossible to create such partially overlapping Cells. 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 (const: unstable) · Source

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: 1.83.0) · Source

pub const 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,

1.0.0 (const: unstable) · Source

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();
Source

pub fn update<F>(&self, f: F) -> T
where F: FnOnce(T) -> T,

🔬This is a nightly-only experimental API. (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,

1.12.0 (const: 1.32.0) · Source

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 (const: unstable) · Source

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 (const: unstable) · Source

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>
where T: Default,

1.17.0 · Source

pub fn take(&self) -> T

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);
Source§

impl<T> Cell<[T]>

1.37.0 (const: unstable) · Source

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]>

Source

pub const fn as_array_of_cells(&self) -> &[Cell<T>; N]

🔬This is a nightly-only experimental API. (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§

Source§

impl BitStore for Cell<u16>

Source§

const ZERO: Cell<u16> = _

The zero constant.
Source§

const ALIGNED_TO_SIZE: [(); 1] = _

All implementors are required to have their alignment match their size. Read more
Source§

const ALIAS_WIDTH: [(); 1] = _

All implementors are required to have Self and Self::Alias be equal in representation. This is true by fiat for all types except the unsigned integers. Read more
Source§

type Mem = u16

The element type used in the memory region underlying a BitSlice. It is always one of the unsigned integer fundamentals.
Source§

type Access = Cell<u16>

A type that selects the appropriate load/store instructions when accessing the memory bus. It determines what instructions are used when moving a Self::Mem value between the processor and the memory system. Read more
Source§

type Alias = Cell<u16>

A sibling 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.
Source§

type Unalias = Cell<u16>

The inverse of ::Alias. It is used when a BitSlice removes the conditions that required a T -> T::Alias transition.
Source§

fn new(value: <Cell<u16> as BitStore>::Mem) -> Cell<u16>

Wraps a raw memory value as a BitStore type.
Source§

fn load_value(&self) -> <Cell<u16> as BitStore>::Mem

Loads a value out of the memory system according to the ::Access rules. This may be called when the value is aliased by a write-capable reference.
Source§

fn store_value(&mut self, value: <Cell<u16> as BitStore>::Mem)

Stores a value into the memory system. This is only called when there are no other handles to the value, and it may bypass ::Access constraints.
Source§

fn get_bit<O>(&self, index: BitIdx<Self::Mem>) -> bool
where O: BitOrder,

Reads a single bit out of the memory system according to the ::Access rules. This is lifted from BitAccess so that it can be used elsewhere without additional casts. Read more
Source§

impl BitStore for Cell<u32>

Source§

const ZERO: Cell<u32> = _

The zero constant.
Source§

const ALIGNED_TO_SIZE: [(); 1] = _

All implementors are required to have their alignment match their size. Read more
Source§

const ALIAS_WIDTH: [(); 1] = _

All implementors are required to have Self and Self::Alias be equal in representation. This is true by fiat for all types except the unsigned integers. Read more
Source§

type Mem = u32

The element type used in the memory region underlying a BitSlice. It is always one of the unsigned integer fundamentals.
Source§

type Access = Cell<u32>

A type that selects the appropriate load/store instructions when accessing the memory bus. It determines what instructions are used when moving a Self::Mem value between the processor and the memory system. Read more
Source§

type Alias = Cell<u32>

A sibling 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.
Source§

type Unalias = Cell<u32>

The inverse of ::Alias. It is used when a BitSlice removes the conditions that required a T -> T::Alias transition.
Source§

fn new(value: <Cell<u32> as BitStore>::Mem) -> Cell<u32>

Wraps a raw memory value as a BitStore type.
Source§

fn load_value(&self) -> <Cell<u32> as BitStore>::Mem

Loads a value out of the memory system according to the ::Access rules. This may be called when the value is aliased by a write-capable reference.
Source§

fn store_value(&mut self, value: <Cell<u32> as BitStore>::Mem)

Stores a value into the memory system. This is only called when there are no other handles to the value, and it may bypass ::Access constraints.
Source§

fn get_bit<O>(&self, index: BitIdx<Self::Mem>) -> bool
where O: BitOrder,

Reads a single bit out of the memory system according to the ::Access rules. This is lifted from BitAccess so that it can be used elsewhere without additional casts. Read more
Source§

impl BitStore for Cell<u64>

Source§

const ZERO: Cell<u64> = _

The zero constant.
Source§

const ALIGNED_TO_SIZE: [(); 1] = _

All implementors are required to have their alignment match their size. Read more
Source§

const ALIAS_WIDTH: [(); 1] = _

All implementors are required to have Self and Self::Alias be equal in representation. This is true by fiat for all types except the unsigned integers. Read more
Source§

type Mem = u64

The element type used in the memory region underlying a BitSlice. It is always one of the unsigned integer fundamentals.
Source§

type Access = Cell<u64>

A type that selects the appropriate load/store instructions when accessing the memory bus. It determines what instructions are used when moving a Self::Mem value between the processor and the memory system. Read more
Source§

type Alias = Cell<u64>

A sibling 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.
Source§

type Unalias = Cell<u64>

The inverse of ::Alias. It is used when a BitSlice removes the conditions that required a T -> T::Alias transition.
Source§

fn new(value: <Cell<u64> as BitStore>::Mem) -> Cell<u64>

Wraps a raw memory value as a BitStore type.
Source§

fn load_value(&self) -> <Cell<u64> as BitStore>::Mem

Loads a value out of the memory system according to the ::Access rules. This may be called when the value is aliased by a write-capable reference.
Source§

fn store_value(&mut self, value: <Cell<u64> as BitStore>::Mem)

Stores a value into the memory system. This is only called when there are no other handles to the value, and it may bypass ::Access constraints.
Source§

fn get_bit<O>(&self, index: BitIdx<Self::Mem>) -> bool
where O: BitOrder,

Reads a single bit out of the memory system according to the ::Access rules. This is lifted from BitAccess so that it can be used elsewhere without additional casts. Read more
Source§

impl BitStore for Cell<u8>

Source§

const ZERO: Cell<u8> = _

The zero constant.
Source§

const ALIGNED_TO_SIZE: [(); 1] = _

All implementors are required to have their alignment match their size. Read more
Source§

const ALIAS_WIDTH: [(); 1] = _

All implementors are required to have Self and Self::Alias be equal in representation. This is true by fiat for all types except the unsigned integers. Read more
Source§

type Mem = u8

The element type used in the memory region underlying a BitSlice. It is always one of the unsigned integer fundamentals.
Source§

type Access = Cell<u8>

A type that selects the appropriate load/store instructions when accessing the memory bus. It determines what instructions are used when moving a Self::Mem value between the processor and the memory system. Read more
Source§

type Alias = Cell<u8>

A sibling 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.
Source§

type Unalias = Cell<u8>

The inverse of ::Alias. It is used when a BitSlice removes the conditions that required a T -> T::Alias transition.
Source§

fn new(value: <Cell<u8> as BitStore>::Mem) -> Cell<u8>

Wraps a raw memory value as a BitStore type.
Source§

fn load_value(&self) -> <Cell<u8> as BitStore>::Mem

Loads a value out of the memory system according to the ::Access rules. This may be called when the value is aliased by a write-capable reference.
Source§

fn store_value(&mut self, value: <Cell<u8> as BitStore>::Mem)

Stores a value into the memory system. This is only called when there are no other handles to the value, and it may bypass ::Access constraints.
Source§

fn get_bit<O>(&self, index: BitIdx<Self::Mem>) -> bool
where O: BitOrder,

Reads a single bit out of the memory system according to the ::Access rules. This is lifted from BitAccess so that it can be used elsewhere without additional casts. Read more
Source§

impl BitStore for Cell<usize>

Source§

const ZERO: Cell<usize> = _

The zero constant.
Source§

const ALIGNED_TO_SIZE: [(); 1] = _

All implementors are required to have their alignment match their size. Read more
Source§

const ALIAS_WIDTH: [(); 1] = _

All implementors are required to have Self and Self::Alias be equal in representation. This is true by fiat for all types except the unsigned integers. Read more
Source§

type Mem = usize

The element type used in the memory region underlying a BitSlice. It is always one of the unsigned integer fundamentals.
Source§

type Access = Cell<usize>

A type that selects the appropriate load/store instructions when accessing the memory bus. It determines what instructions are used when moving a Self::Mem value between the processor and the memory system. Read more
Source§

type Alias = Cell<usize>

A sibling 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.
Source§

type Unalias = Cell<usize>

The inverse of ::Alias. It is used when a BitSlice removes the conditions that required a T -> T::Alias transition.
Source§

fn new(value: <Cell<usize> as BitStore>::Mem) -> Cell<usize>

Wraps a raw memory value as a BitStore type.
Source§

fn load_value(&self) -> <Cell<usize> as BitStore>::Mem

Loads a value out of the memory system according to the ::Access rules. This may be called when the value is aliased by a write-capable reference.
Source§

fn store_value(&mut self, value: <Cell<usize> as BitStore>::Mem)

Stores a value into the memory system. This is only called when there are no other handles to the value, and it may bypass ::Access constraints.
Source§

fn get_bit<O>(&self, index: BitIdx<Self::Mem>) -> bool
where O: BitOrder,

Reads a single bit out of the memory system according to the ::Access rules. This is lifted from BitAccess so that it can be used elsewhere without additional casts. Read more
Source§

impl<'de, T> BorrowDecode<'de> for Cell<T>
where T: BorrowDecode<'de>,

Source§

fn borrow_decode<D>(decoder: &mut D) -> Result<Cell<T>, DecodeError>
where D: BorrowDecoder<'de>,

Attempt to decode this type with the given BorrowDecode.
1.0.0 · Source§

impl<T> Clone for Cell<T>
where T: Copy,

Source§

fn clone(&self) -> Cell<T>

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
1.0.0 · Source§

impl<T> Debug for Cell<T>
where T: Copy + Debug,

Source§

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

Formats the value using the given formatter. Read more
Source§

impl<T> Decode for Cell<T>
where T: Decode,

Source§

fn decode<D>(decoder: &mut D) -> Result<Cell<T>, DecodeError>
where D: Decoder,

Attempt to decode this type with the given Decode.
1.0.0 · Source§

impl<T> Default for Cell<T>
where T: Default,

Source§

fn default() -> Cell<T>

Creates a Cell<T>, with the Default value for T.

Source§

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

Deserialize this value from the given Serde deserializer. Read more
Source§

impl<T> Encode for Cell<T>
where T: Encode + Copy,

Source§

fn encode<E>(&self, encoder: &mut E) -> Result<(), EncodeError>
where E: Encoder,

Encode a given type.
1.12.0 · Source§

impl<T> From<T> for Cell<T>

Source§

fn from(t: T) -> Cell<T>

Creates a new Cell<T> containing the given value.

1.10.0 · Source§

impl<T> Ord for Cell<T>
where T: Ord + Copy,

Source§

fn cmp(&self, other: &Cell<T>) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · Source§

fn max(self, other: Self) -> Self
where Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · Source§

fn min(self, other: Self) -> Self
where Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · Source§

fn clamp(self, min: Self, max: Self) -> Self
where Self: Sized,

Restrict a value to a certain interval. Read more
1.0.0 · Source§

impl<T> PartialEq for Cell<T>
where T: PartialEq + Copy,

Source§

fn eq(&self, other: &Cell<T>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
1.10.0 · Source§

impl<T> PartialOrd for Cell<T>
where T: PartialOrd + Copy,

Source§

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

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

fn lt(&self, other: &Cell<T>) -> bool

Tests less than (for self and other) and is used by the < operator. Read more
Source§

fn le(&self, other: &Cell<T>) -> bool

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
Source§

fn gt(&self, other: &Cell<T>) -> bool

Tests greater than (for self and other) and is used by the > operator. Read more
Source§

fn ge(&self, other: &Cell<T>) -> bool

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
Source§

impl<T> Radium for Cell<*mut T>

Source§

type Item = *mut T

Source§

fn new(value: *mut T) -> Cell<*mut T>

Creates a new value of this type.
Source§

fn fence(_: Ordering)

If the underlying value is atomic, calls fence with the given Ordering. Otherwise, does nothing.
Source§

fn get_mut(&mut self) -> &mut *mut T

Returns a mutable reference to the underlying value. Read more
Source§

fn into_inner(self) -> *mut T

Consumes the wrapper and returns the contained value. Read more
Source§

fn load(&self, _: Ordering) -> *mut T

Load a value from this object. Read more
Source§

fn store(&self, value: *mut T, _: Ordering)

Store a value in this object. Read more
Source§

fn swap(&self, value: *mut T, _: Ordering) -> *mut T

Swap with the value stored in this object. Read more
Source§

fn compare_and_swap(&self, current: *mut T, new: *mut T, _: Ordering) -> *mut T

👎Deprecated: Use compare_exchange or compare_exchange_weak instead
Stores a value into this object if the currently-stored value is the same as the current value. Read more
Source§

fn compare_exchange( &self, current: *mut T, new: *mut T, _: Ordering, _: Ordering, ) -> Result<*mut T, *mut T>

Stores a value into this object if the currently-stored value is the same as the current value. Read more
Source§

fn compare_exchange_weak( &self, current: *mut T, new: *mut T, success: Ordering, failure: Ordering, ) -> Result<*mut T, *mut T>

Stores a value into this object if the currently-stored value is the same as the current value. Read more
Source§

fn fetch_update<F>( &self, _: Ordering, _: Ordering, f: F, ) -> Result<*mut T, *mut T>
where F: FnMut(*mut T) -> Option<*mut T>,

Fetches the value, and applies a function to it that returns an optional new value. Read more
Source§

fn fetch_and(&self, value: Self::Item, order: Ordering) -> Self::Item
where Self::Item: BitOps,

Performs a bitwise “and” on the currently-stored value and the argument value, and stores the result in self. Read more
Source§

fn fetch_nand(&self, value: Self::Item, order: Ordering) -> Self::Item
where Self::Item: BitOps,

Performs a bitwise “nand” on the currently-stored value and the argument value, and stores the result in self. Read more
Source§

fn fetch_or(&self, value: Self::Item, order: Ordering) -> Self::Item
where Self::Item: BitOps,

Performs a bitwise “or” on the currently-stored value and the argument value, and stores the result in self. Read more
Source§

fn fetch_xor(&self, value: Self::Item, order: Ordering) -> Self::Item
where Self::Item: BitOps,

Performs a bitwise “xor” on the currently-stored value and the argument value, and stores the result in self. Read more
Source§

fn fetch_add(&self, value: Self::Item, order: Ordering) -> Self::Item
where Self::Item: NumericOps,

Adds value to the currently-stored value, wrapping on overflow, and stores the result in self. Read more
Source§

fn fetch_sub(&self, value: Self::Item, order: Ordering) -> Self::Item
where Self::Item: NumericOps,

Subtracts value from the currently-stored value, wrapping on underflow, and stores the result in self. Read more
Source§

impl Radium for Cell<bool>

Source§

type Item = bool

Source§

fn new(value: bool) -> Cell<bool>

Creates a new value of this type.
Source§

fn fence(_: Ordering)

If the underlying value is atomic, calls fence with the given Ordering. Otherwise, does nothing.
Source§

fn get_mut(&mut self) -> &mut bool

Returns a mutable reference to the underlying value. Read more
Source§

fn into_inner(self) -> bool

Consumes the wrapper and returns the contained value. Read more
Source§

fn load(&self, _: Ordering) -> bool

Load a value from this object. Read more
Source§

fn store(&self, value: bool, _: Ordering)

Store a value in this object. Read more
Source§

fn swap(&self, value: bool, _: Ordering) -> bool

Swap with the value stored in this object. Read more
Source§

fn compare_and_swap(&self, current: bool, new: bool, _: Ordering) -> bool

👎Deprecated: Use compare_exchange or compare_exchange_weak instead
Stores a value into this object if the currently-stored value is the same as the current value. Read more
Source§

fn compare_exchange( &self, current: bool, new: bool, _: Ordering, _: Ordering, ) -> Result<bool, bool>

Stores a value into this object if the currently-stored value is the same as the current value. Read more
Source§

fn compare_exchange_weak( &self, current: bool, new: bool, success: Ordering, failure: Ordering, ) -> Result<bool, bool>

Stores a value into this object if the currently-stored value is the same as the current value. Read more
Source§

fn fetch_update<F>(&self, _: Ordering, _: Ordering, f: F) -> Result<bool, bool>
where F: FnMut(bool) -> Option<bool>,

Fetches the value, and applies a function to it that returns an optional new value. Read more
Source§

fn fetch_and(&self, value: bool, _: Ordering) -> bool

Performs a bitwise “and” on the currently-stored value and the argument value, and stores the result in self. Read more
Source§

fn fetch_nand(&self, value: bool, _: Ordering) -> bool

Performs a bitwise “nand” on the currently-stored value and the argument value, and stores the result in self. Read more
Source§

fn fetch_or(&self, value: bool, _: Ordering) -> bool

Performs a bitwise “or” on the currently-stored value and the argument value, and stores the result in self. Read more
Source§

fn fetch_xor(&self, value: bool, _: Ordering) -> bool

Performs a bitwise “xor” on the currently-stored value and the argument value, and stores the result in self. Read more
Source§

fn fetch_add(&self, value: Self::Item, order: Ordering) -> Self::Item
where Self::Item: NumericOps,

Adds value to the currently-stored value, wrapping on overflow, and stores the result in self. Read more
Source§

fn fetch_sub(&self, value: Self::Item, order: Ordering) -> Self::Item
where Self::Item: NumericOps,

Subtracts value from the currently-stored value, wrapping on underflow, and stores the result in self. Read more
Source§

impl Radium for Cell<i16>

Source§

type Item = i16

Source§

fn new(value: i16) -> Cell<i16>

Creates a new value of this type.
Source§

fn fence(_: Ordering)

If the underlying value is atomic, calls fence with the given Ordering. Otherwise, does nothing.
Source§

fn get_mut(&mut self) -> &mut i16

Returns a mutable reference to the underlying value. Read more
Source§

fn into_inner(self) -> i16

Consumes the wrapper and returns the contained value. Read more
Source§

fn load(&self, _: Ordering) -> i16

Load a value from this object. Read more
Source§

fn store(&self, value: i16, _: Ordering)

Store a value in this object. Read more
Source§

fn swap(&self, value: i16, _: Ordering) -> i16

Swap with the value stored in this object. Read more
Source§

fn compare_and_swap(&self, current: i16, new: i16, _: Ordering) -> i16

👎Deprecated: Use compare_exchange or compare_exchange_weak instead
Stores a value into this object if the currently-stored value is the same as the current value. Read more
Source§

fn compare_exchange( &self, current: i16, new: i16, _: Ordering, _: Ordering, ) -> Result<i16, i16>

Stores a value into this object if the currently-stored value is the same as the current value. Read more
Source§

fn compare_exchange_weak( &self, current: i16, new: i16, success: Ordering, failure: Ordering, ) -> Result<i16, i16>

Stores a value into this object if the currently-stored value is the same as the current value. Read more
Source§

fn fetch_update<F>(&self, _: Ordering, _: Ordering, f: F) -> Result<i16, i16>
where F: FnMut(i16) -> Option<i16>,

Fetches the value, and applies a function to it that returns an optional new value. Read more
Source§

fn fetch_and(&self, value: i16, _: Ordering) -> i16

Performs a bitwise “and” on the currently-stored value and the argument value, and stores the result in self. Read more
Source§

fn fetch_nand(&self, value: i16, _: Ordering) -> i16

Performs a bitwise “nand” on the currently-stored value and the argument value, and stores the result in self. Read more
Source§

fn fetch_or(&self, value: i16, _: Ordering) -> i16

Performs a bitwise “or” on the currently-stored value and the argument value, and stores the result in self. Read more
Source§

fn fetch_xor(&self, value: i16, _: Ordering) -> i16

Performs a bitwise “xor” on the currently-stored value and the argument value, and stores the result in self. Read more
Source§

fn fetch_add(&self, value: i16, _: Ordering) -> i16

Adds value to the currently-stored value, wrapping on overflow, and stores the result in self. Read more
Source§

fn fetch_sub(&self, value: i16, _: Ordering) -> i16

Subtracts value from the currently-stored value, wrapping on underflow, and stores the result in self. Read more
Source§

impl Radium for Cell<i32>

Source§

type Item = i32

Source§

fn new(value: i32) -> Cell<i32>

Creates a new value of this type.
Source§

fn fence(_: Ordering)

If the underlying value is atomic, calls fence with the given Ordering. Otherwise, does nothing.
Source§

fn get_mut(&mut self) -> &mut i32

Returns a mutable reference to the underlying value. Read more
Source§

fn into_inner(self) -> i32

Consumes the wrapper and returns the contained value. Read more
Source§

fn load(&self, _: Ordering) -> i32

Load a value from this object. Read more
Source§

fn store(&self, value: i32, _: Ordering)

Store a value in this object. Read more
Source§

fn swap(&self, value: i32, _: Ordering) -> i32

Swap with the value stored in this object. Read more
Source§

fn compare_and_swap(&self, current: i32, new: i32, _: Ordering) -> i32

👎Deprecated: Use compare_exchange or compare_exchange_weak instead
Stores a value into this object if the currently-stored value is the same as the current value. Read more
Source§

fn compare_exchange( &self, current: i32, new: i32, _: Ordering, _: Ordering, ) -> Result<i32, i32>

Stores a value into this object if the currently-stored value is the same as the current value. Read more
Source§

fn compare_exchange_weak( &self, current: i32, new: i32, success: Ordering, failure: Ordering, ) -> Result<i32, i32>

Stores a value into this object if the currently-stored value is the same as the current value. Read more
Source§

fn fetch_update<F>(&self, _: Ordering, _: Ordering, f: F) -> Result<i32, i32>
where F: FnMut(i32) -> Option<i32>,

Fetches the value, and applies a function to it that returns an optional new value. Read more
Source§

fn fetch_and(&self, value: i32, _: Ordering) -> i32

Performs a bitwise “and” on the currently-stored value and the argument value, and stores the result in self. Read more
Source§

fn fetch_nand(&self, value: i32, _: Ordering) -> i32

Performs a bitwise “nand” on the currently-stored value and the argument value, and stores the result in self. Read more
Source§

fn fetch_or(&self, value: i32, _: Ordering) -> i32

Performs a bitwise “or” on the currently-stored value and the argument value, and stores the result in self. Read more
Source§

fn fetch_xor(&self, value: i32, _: Ordering) -> i32

Performs a bitwise “xor” on the currently-stored value and the argument value, and stores the result in self. Read more
Source§

fn fetch_add(&self, value: i32, _: Ordering) -> i32

Adds value to the currently-stored value, wrapping on overflow, and stores the result in self. Read more
Source§

fn fetch_sub(&self, value: i32, _: Ordering) -> i32

Subtracts value from the currently-stored value, wrapping on underflow, and stores the result in self. Read more
Source§

impl Radium for Cell<i64>

Source§

type Item = i64

Source§

fn new(value: i64) -> Cell<i64>

Creates a new value of this type.
Source§

fn fence(_: Ordering)

If the underlying value is atomic, calls fence with the given Ordering. Otherwise, does nothing.
Source§

fn get_mut(&mut self) -> &mut i64

Returns a mutable reference to the underlying value. Read more
Source§

fn into_inner(self) -> i64

Consumes the wrapper and returns the contained value. Read more
Source§

fn load(&self, _: Ordering) -> i64

Load a value from this object. Read more
Source§

fn store(&self, value: i64, _: Ordering)

Store a value in this object. Read more
Source§

fn swap(&self, value: i64, _: Ordering) -> i64

Swap with the value stored in this object. Read more
Source§

fn compare_and_swap(&self, current: i64, new: i64, _: Ordering) -> i64

👎Deprecated: Use compare_exchange or compare_exchange_weak instead
Stores a value into this object if the currently-stored value is the same as the current value. Read more
Source§

fn compare_exchange( &self, current: i64, new: i64, _: Ordering, _: Ordering, ) -> Result<i64, i64>

Stores a value into this object if the currently-stored value is the same as the current value. Read more
Source§

fn compare_exchange_weak( &self, current: i64, new: i64, success: Ordering, failure: Ordering, ) -> Result<i64, i64>

Stores a value into this object if the currently-stored value is the same as the current value. Read more
Source§

fn fetch_update<F>(&self, _: Ordering, _: Ordering, f: F) -> Result<i64, i64>
where F: FnMut(i64) -> Option<i64>,

Fetches the value, and applies a function to it that returns an optional new value. Read more
Source§

fn fetch_and(&self, value: i64, _: Ordering) -> i64

Performs a bitwise “and” on the currently-stored value and the argument value, and stores the result in self. Read more
Source§

fn fetch_nand(&self, value: i64, _: Ordering) -> i64

Performs a bitwise “nand” on the currently-stored value and the argument value, and stores the result in self. Read more
Source§

fn fetch_or(&self, value: i64, _: Ordering) -> i64

Performs a bitwise “or” on the currently-stored value and the argument value, and stores the result in self. Read more
Source§

fn fetch_xor(&self, value: i64, _: Ordering) -> i64

Performs a bitwise “xor” on the currently-stored value and the argument value, and stores the result in self. Read more
Source§

fn fetch_add(&self, value: i64, _: Ordering) -> i64

Adds value to the currently-stored value, wrapping on overflow, and stores the result in self. Read more
Source§

fn fetch_sub(&self, value: i64, _: Ordering) -> i64

Subtracts value from the currently-stored value, wrapping on underflow, and stores the result in self. Read more
Source§

impl Radium for Cell<i8>

Source§

type Item = i8

Source§

fn new(value: i8) -> Cell<i8>

Creates a new value of this type.
Source§

fn fence(_: Ordering)

If the underlying value is atomic, calls fence with the given Ordering. Otherwise, does nothing.
Source§

fn get_mut(&mut self) -> &mut i8

Returns a mutable reference to the underlying value. Read more
Source§

fn into_inner(self) -> i8

Consumes the wrapper and returns the contained value. Read more
Source§

fn load(&self, _: Ordering) -> i8

Load a value from this object. Read more
Source§

fn store(&self, value: i8, _: Ordering)

Store a value in this object. Read more
Source§

fn swap(&self, value: i8, _: Ordering) -> i8

Swap with the value stored in this object. Read more
Source§

fn compare_and_swap(&self, current: i8, new: i8, _: Ordering) -> i8

👎Deprecated: Use compare_exchange or compare_exchange_weak instead
Stores a value into this object if the currently-stored value is the same as the current value. Read more
Source§

fn compare_exchange( &self, current: i8, new: i8, _: Ordering, _: Ordering, ) -> Result<i8, i8>

Stores a value into this object if the currently-stored value is the same as the current value. Read more
Source§

fn compare_exchange_weak( &self, current: i8, new: i8, success: Ordering, failure: Ordering, ) -> Result<i8, i8>

Stores a value into this object if the currently-stored value is the same as the current value. Read more
Source§

fn fetch_update<F>(&self, _: Ordering, _: Ordering, f: F) -> Result<i8, i8>
where F: FnMut(i8) -> Option<i8>,

Fetches the value, and applies a function to it that returns an optional new value. Read more
Source§

fn fetch_and(&self, value: i8, _: Ordering) -> i8

Performs a bitwise “and” on the currently-stored value and the argument value, and stores the result in self. Read more
Source§

fn fetch_nand(&self, value: i8, _: Ordering) -> i8

Performs a bitwise “nand” on the currently-stored value and the argument value, and stores the result in self. Read more
Source§

fn fetch_or(&self, value: i8, _: Ordering) -> i8

Performs a bitwise “or” on the currently-stored value and the argument value, and stores the result in self. Read more
Source§

fn fetch_xor(&self, value: i8, _: Ordering) -> i8

Performs a bitwise “xor” on the currently-stored value and the argument value, and stores the result in self. Read more
Source§

fn fetch_add(&self, value: i8, _: Ordering) -> i8

Adds value to the currently-stored value, wrapping on overflow, and stores the result in self. Read more
Source§

fn fetch_sub(&self, value: i8, _: Ordering) -> i8

Subtracts value from the currently-stored value, wrapping on underflow, and stores the result in self. Read more
Source§

impl Radium for Cell<isize>

Source§

type Item = isize

Source§

fn new(value: isize) -> Cell<isize>

Creates a new value of this type.
Source§

fn fence(_: Ordering)

If the underlying value is atomic, calls fence with the given Ordering. Otherwise, does nothing.
Source§

fn get_mut(&mut self) -> &mut isize

Returns a mutable reference to the underlying value. Read more
Source§

fn into_inner(self) -> isize

Consumes the wrapper and returns the contained value. Read more
Source§

fn load(&self, _: Ordering) -> isize

Load a value from this object. Read more
Source§

fn store(&self, value: isize, _: Ordering)

Store a value in this object. Read more
Source§

fn swap(&self, value: isize, _: Ordering) -> isize

Swap with the value stored in this object. Read more
Source§

fn compare_and_swap(&self, current: isize, new: isize, _: Ordering) -> isize

👎Deprecated: Use compare_exchange or compare_exchange_weak instead
Stores a value into this object if the currently-stored value is the same as the current value. Read more
Source§

fn compare_exchange( &self, current: isize, new: isize, _: Ordering, _: Ordering, ) -> Result<isize, isize>

Stores a value into this object if the currently-stored value is the same as the current value. Read more
Source§

fn compare_exchange_weak( &self, current: isize, new: isize, success: Ordering, failure: Ordering, ) -> Result<isize, isize>

Stores a value into this object if the currently-stored value is the same as the current value. Read more
Source§

fn fetch_update<F>( &self, _: Ordering, _: Ordering, f: F, ) -> Result<isize, isize>
where F: FnMut(isize) -> Option<isize>,

Fetches the value, and applies a function to it that returns an optional new value. Read more
Source§

fn fetch_and(&self, value: isize, _: Ordering) -> isize

Performs a bitwise “and” on the currently-stored value and the argument value, and stores the result in self. Read more
Source§

fn fetch_nand(&self, value: isize, _: Ordering) -> isize

Performs a bitwise “nand” on the currently-stored value and the argument value, and stores the result in self. Read more
Source§

fn fetch_or(&self, value: isize, _: Ordering) -> isize

Performs a bitwise “or” on the currently-stored value and the argument value, and stores the result in self. Read more
Source§

fn fetch_xor(&self, value: isize, _: Ordering) -> isize

Performs a bitwise “xor” on the currently-stored value and the argument value, and stores the result in self. Read more
Source§

fn fetch_add(&self, value: isize, _: Ordering) -> isize

Adds value to the currently-stored value, wrapping on overflow, and stores the result in self. Read more
Source§

fn fetch_sub(&self, value: isize, _: Ordering) -> isize

Subtracts value from the currently-stored value, wrapping on underflow, and stores the result in self. Read more
Source§

impl Radium for Cell<u16>

Source§

type Item = u16

Source§

fn new(value: u16) -> Cell<u16>

Creates a new value of this type.
Source§

fn fence(_: Ordering)

If the underlying value is atomic, calls fence with the given Ordering. Otherwise, does nothing.
Source§

fn get_mut(&mut self) -> &mut u16

Returns a mutable reference to the underlying value. Read more
Source§

fn into_inner(self) -> u16

Consumes the wrapper and returns the contained value. Read more
Source§

fn load(&self, _: Ordering) -> u16

Load a value from this object. Read more
Source§

fn store(&self, value: u16, _: Ordering)

Store a value in this object. Read more
Source§

fn swap(&self, value: u16, _: Ordering) -> u16

Swap with the value stored in this object. Read more
Source§

fn compare_and_swap(&self, current: u16, new: u16, _: Ordering) -> u16

👎Deprecated: Use compare_exchange or compare_exchange_weak instead
Stores a value into this object if the currently-stored value is the same as the current value. Read more
Source§

fn compare_exchange( &self, current: u16, new: u16, _: Ordering, _: Ordering, ) -> Result<u16, u16>

Stores a value into this object if the currently-stored value is the same as the current value. Read more
Source§

fn compare_exchange_weak( &self, current: u16, new: u16, success: Ordering, failure: Ordering, ) -> Result<u16, u16>

Stores a value into this object if the currently-stored value is the same as the current value. Read more
Source§

fn fetch_update<F>(&self, _: Ordering, _: Ordering, f: F) -> Result<u16, u16>
where F: FnMut(u16) -> Option<u16>,

Fetches the value, and applies a function to it that returns an optional new value. Read more
Source§

fn fetch_and(&self, value: u16, _: Ordering) -> u16

Performs a bitwise “and” on the currently-stored value and the argument value, and stores the result in self. Read more
Source§

fn fetch_nand(&self, value: u16, _: Ordering) -> u16

Performs a bitwise “nand” on the currently-stored value and the argument value, and stores the result in self. Read more
Source§

fn fetch_or(&self, value: u16, _: Ordering) -> u16

Performs a bitwise “or” on the currently-stored value and the argument value, and stores the result in self. Read more
Source§

fn fetch_xor(&self, value: u16, _: Ordering) -> u16

Performs a bitwise “xor” on the currently-stored value and the argument value, and stores the result in self. Read more
Source§

fn fetch_add(&self, value: u16, _: Ordering) -> u16

Adds value to the currently-stored value, wrapping on overflow, and stores the result in self. Read more
Source§

fn fetch_sub(&self, value: u16, _: Ordering) -> u16

Subtracts value from the currently-stored value, wrapping on underflow, and stores the result in self. Read more
Source§

impl Radium for Cell<u32>

Source§

type Item = u32

Source§

fn new(value: u32) -> Cell<u32>

Creates a new value of this type.
Source§

fn fence(_: Ordering)

If the underlying value is atomic, calls fence with the given Ordering. Otherwise, does nothing.
Source§

fn get_mut(&mut self) -> &mut u32

Returns a mutable reference to the underlying value. Read more
Source§

fn into_inner(self) -> u32

Consumes the wrapper and returns the contained value. Read more
Source§

fn load(&self, _: Ordering) -> u32

Load a value from this object. Read more
Source§

fn store(&self, value: u32, _: Ordering)

Store a value in this object. Read more
Source§

fn swap(&self, value: u32, _: Ordering) -> u32

Swap with the value stored in this object. Read more
Source§

fn compare_and_swap(&self, current: u32, new: u32, _: Ordering) -> u32

👎Deprecated: Use compare_exchange or compare_exchange_weak instead
Stores a value into this object if the currently-stored value is the same as the current value. Read more
Source§

fn compare_exchange( &self, current: u32, new: u32, _: Ordering, _: Ordering, ) -> Result<u32, u32>

Stores a value into this object if the currently-stored value is the same as the current value. Read more
Source§

fn compare_exchange_weak( &self, current: u32, new: u32, success: Ordering, failure: Ordering, ) -> Result<u32, u32>

Stores a value into this object if the currently-stored value is the same as the current value. Read more
Source§

fn fetch_update<F>(&self, _: Ordering, _: Ordering, f: F) -> Result<u32, u32>
where F: FnMut(u32) -> Option<u32>,

Fetches the value, and applies a function to it that returns an optional new value. Read more
Source§

fn fetch_and(&self, value: u32, _: Ordering) -> u32

Performs a bitwise “and” on the currently-stored value and the argument value, and stores the result in self. Read more
Source§

fn fetch_nand(&self, value: u32, _: Ordering) -> u32

Performs a bitwise “nand” on the currently-stored value and the argument value, and stores the result in self. Read more
Source§

fn fetch_or(&self, value: u32, _: Ordering) -> u32

Performs a bitwise “or” on the currently-stored value and the argument value, and stores the result in self. Read more
Source§

fn fetch_xor(&self, value: u32, _: Ordering) -> u32

Performs a bitwise “xor” on the currently-stored value and the argument value, and stores the result in self. Read more
Source§

fn fetch_add(&self, value: u32, _: Ordering) -> u32

Adds value to the currently-stored value, wrapping on overflow, and stores the result in self. Read more
Source§

fn fetch_sub(&self, value: u32, _: Ordering) -> u32

Subtracts value from the currently-stored value, wrapping on underflow, and stores the result in self. Read more
Source§

impl Radium for Cell<u64>

Source§

type Item = u64

Source§

fn new(value: u64) -> Cell<u64>

Creates a new value of this type.
Source§

fn fence(_: Ordering)

If the underlying value is atomic, calls fence with the given Ordering. Otherwise, does nothing.
Source§

fn get_mut(&mut self) -> &mut u64

Returns a mutable reference to the underlying value. Read more
Source§

fn into_inner(self) -> u64

Consumes the wrapper and returns the contained value. Read more
Source§

fn load(&self, _: Ordering) -> u64

Load a value from this object. Read more
Source§

fn store(&self, value: u64, _: Ordering)

Store a value in this object. Read more
Source§

fn swap(&self, value: u64, _: Ordering) -> u64

Swap with the value stored in this object. Read more
Source§

fn compare_and_swap(&self, current: u64, new: u64, _: Ordering) -> u64

👎Deprecated: Use compare_exchange or compare_exchange_weak instead
Stores a value into this object if the currently-stored value is the same as the current value. Read more
Source§

fn compare_exchange( &self, current: u64, new: u64, _: Ordering, _: Ordering, ) -> Result<u64, u64>

Stores a value into this object if the currently-stored value is the same as the current value. Read more
Source§

fn compare_exchange_weak( &self, current: u64, new: u64, success: Ordering, failure: Ordering, ) -> Result<u64, u64>

Stores a value into this object if the currently-stored value is the same as the current value. Read more
Source§

fn fetch_update<F>(&self, _: Ordering, _: Ordering, f: F) -> Result<u64, u64>
where F: FnMut(u64) -> Option<u64>,

Fetches the value, and applies a function to it that returns an optional new value. Read more
Source§

fn fetch_and(&self, value: u64, _: Ordering) -> u64

Performs a bitwise “and” on the currently-stored value and the argument value, and stores the result in self. Read more
Source§

fn fetch_nand(&self, value: u64, _: Ordering) -> u64

Performs a bitwise “nand” on the currently-stored value and the argument value, and stores the result in self. Read more
Source§

fn fetch_or(&self, value: u64, _: Ordering) -> u64

Performs a bitwise “or” on the currently-stored value and the argument value, and stores the result in self. Read more
Source§

fn fetch_xor(&self, value: u64, _: Ordering) -> u64

Performs a bitwise “xor” on the currently-stored value and the argument value, and stores the result in self. Read more
Source§

fn fetch_add(&self, value: u64, _: Ordering) -> u64

Adds value to the currently-stored value, wrapping on overflow, and stores the result in self. Read more
Source§

fn fetch_sub(&self, value: u64, _: Ordering) -> u64

Subtracts value from the currently-stored value, wrapping on underflow, and stores the result in self. Read more
Source§

impl Radium for Cell<u8>

Source§

type Item = u8

Source§

fn new(value: u8) -> Cell<u8>

Creates a new value of this type.
Source§

fn fence(_: Ordering)

If the underlying value is atomic, calls fence with the given Ordering. Otherwise, does nothing.
Source§

fn get_mut(&mut self) -> &mut u8

Returns a mutable reference to the underlying value. Read more
Source§

fn into_inner(self) -> u8

Consumes the wrapper and returns the contained value. Read more
Source§

fn load(&self, _: Ordering) -> u8

Load a value from this object. Read more
Source§

fn store(&self, value: u8, _: Ordering)

Store a value in this object. Read more
Source§

fn swap(&self, value: u8, _: Ordering) -> u8

Swap with the value stored in this object. Read more
Source§

fn compare_and_swap(&self, current: u8, new: u8, _: Ordering) -> u8

👎Deprecated: Use compare_exchange or compare_exchange_weak instead
Stores a value into this object if the currently-stored value is the same as the current value. Read more
Source§

fn compare_exchange( &self, current: u8, new: u8, _: Ordering, _: Ordering, ) -> Result<u8, u8>

Stores a value into this object if the currently-stored value is the same as the current value. Read more
Source§

fn compare_exchange_weak( &self, current: u8, new: u8, success: Ordering, failure: Ordering, ) -> Result<u8, u8>

Stores a value into this object if the currently-stored value is the same as the current value. Read more
Source§

fn fetch_update<F>(&self, _: Ordering, _: Ordering, f: F) -> Result<u8, u8>
where F: FnMut(u8) -> Option<u8>,

Fetches the value, and applies a function to it that returns an optional new value. Read more
Source§

fn fetch_and(&self, value: u8, _: Ordering) -> u8

Performs a bitwise “and” on the currently-stored value and the argument value, and stores the result in self. Read more
Source§

fn fetch_nand(&self, value: u8, _: Ordering) -> u8

Performs a bitwise “nand” on the currently-stored value and the argument value, and stores the result in self. Read more
Source§

fn fetch_or(&self, value: u8, _: Ordering) -> u8

Performs a bitwise “or” on the currently-stored value and the argument value, and stores the result in self. Read more
Source§

fn fetch_xor(&self, value: u8, _: Ordering) -> u8

Performs a bitwise “xor” on the currently-stored value and the argument value, and stores the result in self. Read more
Source§

fn fetch_add(&self, value: u8, _: Ordering) -> u8

Adds value to the currently-stored value, wrapping on overflow, and stores the result in self. Read more
Source§

fn fetch_sub(&self, value: u8, _: Ordering) -> u8

Subtracts value from the currently-stored value, wrapping on underflow, and stores the result in self. Read more
Source§

impl Radium for Cell<usize>

Source§

type Item = usize

Source§

fn new(value: usize) -> Cell<usize>

Creates a new value of this type.
Source§

fn fence(_: Ordering)

If the underlying value is atomic, calls fence with the given Ordering. Otherwise, does nothing.
Source§

fn get_mut(&mut self) -> &mut usize

Returns a mutable reference to the underlying value. Read more
Source§

fn into_inner(self) -> usize

Consumes the wrapper and returns the contained value. Read more
Source§

fn load(&self, _: Ordering) -> usize

Load a value from this object. Read more
Source§

fn store(&self, value: usize, _: Ordering)

Store a value in this object. Read more
Source§

fn swap(&self, value: usize, _: Ordering) -> usize

Swap with the value stored in this object. Read more
Source§

fn compare_and_swap(&self, current: usize, new: usize, _: Ordering) -> usize

👎Deprecated: Use compare_exchange or compare_exchange_weak instead
Stores a value into this object if the currently-stored value is the same as the current value. Read more
Source§

fn compare_exchange( &self, current: usize, new: usize, _: Ordering, _: Ordering, ) -> Result<usize, usize>

Stores a value into this object if the currently-stored value is the same as the current value. Read more
Source§

fn compare_exchange_weak( &self, current: usize, new: usize, success: Ordering, failure: Ordering, ) -> Result<usize, usize>

Stores a value into this object if the currently-stored value is the same as the current value. Read more
Source§

fn fetch_update<F>( &self, _: Ordering, _: Ordering, f: F, ) -> Result<usize, usize>
where F: FnMut(usize) -> Option<usize>,

Fetches the value, and applies a function to it that returns an optional new value. Read more
Source§

fn fetch_and(&self, value: usize, _: Ordering) -> usize

Performs a bitwise “and” on the currently-stored value and the argument value, and stores the result in self. Read more
Source§

fn fetch_nand(&self, value: usize, _: Ordering) -> usize

Performs a bitwise “nand” on the currently-stored value and the argument value, and stores the result in self. Read more
Source§

fn fetch_or(&self, value: usize, _: Ordering) -> usize

Performs a bitwise “or” on the currently-stored value and the argument value, and stores the result in self. Read more
Source§

fn fetch_xor(&self, value: usize, _: Ordering) -> usize

Performs a bitwise “xor” on the currently-stored value and the argument value, and stores the result in self. Read more
Source§

fn fetch_add(&self, value: usize, _: Ordering) -> usize

Adds value to the currently-stored value, wrapping on overflow, and stores the result in self. Read more
Source§

fn fetch_sub(&self, value: usize, _: Ordering) -> usize

Subtracts value from the currently-stored value, wrapping on underflow, and stores the result in self. Read more
Source§

impl<T> Serialize for Cell<T>
where T: Serialize + Copy,

Source§

fn serialize<S>( &self, serializer: S, ) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>
where S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl<T, U> CoerceUnsized<Cell<U>> for Cell<T>
where T: CoerceUnsized<U>,

Source§

impl<T, U> DispatchFromDyn<Cell<U>> for Cell<T>
where T: DispatchFromDyn<U>,

1.2.0 · Source§

impl<T> Eq for Cell<T>
where T: Eq + Copy,

Source§

impl<T> PinCoerceUnsized for Cell<T>
where T: ?Sized,

1.0.0 · Source§

impl<T> Send for Cell<T>
where T: Send + ?Sized,

1.0.0 · Source§

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>
where T: Unpin + ?Sized,

§

impl<T> UnwindSafe for Cell<T>
where T: UnwindSafe + ?Sized,

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

impl<T> BitView for T
where T: BitStore,

Source§

type Store = T

The underlying element type.
Source§

fn view_bits<O>(&self) -> &BitSlice<T, O>
where O: BitOrder,

Views a memory region as an immutable bit-slice.
Source§

fn try_view_bits<O>(&self) -> Result<&BitSlice<T, O>, BitSpanError<T>>
where O: BitOrder,

Attempts to view a memory region as an immutable bit-slice. Read more
Source§

fn view_bits_mut<O>(&mut self) -> &mut BitSlice<T, O>
where O: BitOrder,

Views a memory region as a mutable bit-slice.
Source§

fn try_view_bits_mut<O>( &mut self, ) -> Result<&mut BitSlice<T, O>, BitSpanError<T>>
where O: BitOrder,

Attempts to view a memory region as a mutable bit-slice. Read more
Source§

impl<T> BitViewSized for T
where T: BitStore,

Source§

const ZERO: T = <T as BitStore>::ZERO

The zero constant.
Source§

fn as_raw_slice(&self) -> &[<T as BitView>::Store]

Views the type as a slice of its elements.
Source§

fn as_raw_mut_slice(&mut self) -> &mut [<T as BitView>::Store]

Views the type as a mutable slice of its elements.
Source§

fn into_bitarray<O>(self) -> BitArray<Self, O>
where O: BitOrder,

Wraps self in a BitArray.
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
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dst: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
Source§

impl<Q, K> Comparable<K> for Q
where Q: Ord + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn compare(&self, key: &K) -> Ordering

Compare self to key and return their ordering.
Source§

impl<T> Conv for T

Source§

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

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

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
Source§

impl<T> FmtForward for T

Source§

fn fmt_binary(self) -> FmtBinary<Self>
where Self: Binary,

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

fn fmt_display(self) -> FmtDisplay<Self>
where Self: Display,

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

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

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

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

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

fn fmt_octal(self) -> FmtOctal<Self>
where Self: Octal,

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

fn fmt_pointer(self) -> FmtPointer<Self>
where Self: Pointer,

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

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

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

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

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

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

Formats each item in a sequence. Read more
Source§

impl<T> From<!> for T

Source§

fn from(t: !) -> T

Converts to this type from the input type.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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
Source§

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

Source§

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

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

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

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

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

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

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

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

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> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> Tap for T

Source§

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

Immutable access to a value. Read more
Source§

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

Mutable access to a value. Read more
Source§

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> TryConv for T

Source§

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

Source§

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

Source§

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

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

Source§

fn vzip(self) -> V

Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,