Struct gstd::prelude::cell::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>

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);
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. Difference with std::mem::swap is that this function doesn’t require &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 · 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: unstable) · source

pub fn into_inner(self) -> T

Unwraps the value, consuming the cell.

§Examples
use std::cell::Cell;

let c = Cell::new(5);
let five = c.into_inner();

assert_eq!(five, 5);
source§

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

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

§

impl BitStore for Cell<u16>

§

type Mem = u16

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

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
§

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

type Unalias = Cell<u16>

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

const ZERO: Cell<u16> = _

The zero constant.
§

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

Wraps a raw memory value as a BitStore type.
§

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

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

const ALIGNED_TO_SIZE: [(); 1] = _

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

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
§

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
§

impl BitStore for Cell<u32>

§

type Mem = u32

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

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
§

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

type Unalias = Cell<u32>

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

const ZERO: Cell<u32> = _

The zero constant.
§

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

Wraps a raw memory value as a BitStore type.
§

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

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

const ALIGNED_TO_SIZE: [(); 1] = _

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

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
§

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
§

impl BitStore for Cell<u64>

§

type Mem = u64

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

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
§

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

type Unalias = Cell<u64>

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

const ZERO: Cell<u64> = _

The zero constant.
§

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

Wraps a raw memory value as a BitStore type.
§

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

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

const ALIGNED_TO_SIZE: [(); 1] = _

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

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
§

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
§

impl BitStore for Cell<u8>

§

type Mem = u8

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

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
§

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

type Unalias = Cell<u8>

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

const ZERO: Cell<u8> = _

The zero constant.
§

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

Wraps a raw memory value as a BitStore type.
§

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

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

const ALIGNED_TO_SIZE: [(); 1] = _

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

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
§

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
§

impl BitStore for Cell<usize>

§

type Mem = usize

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

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
§

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

type Unalias = Cell<usize>

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

const ZERO: Cell<usize> = _

The zero constant.
§

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

Wraps a raw memory value as a BitStore type.
§

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

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

const ALIGNED_TO_SIZE: [(); 1] = _

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

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
§

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<T> Clone for Cell<T>
where T: Copy,

source§

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

Returns a copy of the value. Read more
source§

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

Performs copy-assignment from source. Read more
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> 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
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 + PartialOrd,

Restrict a value to a certain interval. Read more
source§

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

source§

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

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

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

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
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

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

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

This method 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

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

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

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

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

§

type Item = *mut T

§

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

Creates a new value of this type.
§

fn fence(_: Ordering)

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

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

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

fn into_inner(self) -> *mut T

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

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

Load a value from this object. Read more
§

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

Store a value in this object. Read more
§

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

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

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
§

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
§

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
§

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
§

impl Radium for Cell<bool>

§

type Item = bool

§

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

Creates a new value of this type.
§

fn fence(_: Ordering)

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

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

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

fn into_inner(self) -> bool

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

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

Load a value from this object. Read more
§

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

Store a value in this object. Read more
§

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

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

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
§

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
§

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
§

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
§

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
§

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
§

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
§

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
§

impl Radium for Cell<i16>

§

type Item = i16

§

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

Creates a new value of this type.
§

fn fence(_: Ordering)

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

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

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

fn into_inner(self) -> i16

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

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

Load a value from this object. Read more
§

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

Store a value in this object. Read more
§

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

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

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
§

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
§

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
§

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
§

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
§

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
§

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
§

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
§

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
§

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
§

impl Radium for Cell<i32>

§

type Item = i32

§

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

Creates a new value of this type.
§

fn fence(_: Ordering)

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

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

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

fn into_inner(self) -> i32

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

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

Load a value from this object. Read more
§

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

Store a value in this object. Read more
§

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

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

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
§

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
§

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
§

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
§

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
§

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
§

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
§

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
§

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
§

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
§

impl Radium for Cell<i64>

§

type Item = i64

§

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

Creates a new value of this type.
§

fn fence(_: Ordering)

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

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

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

fn into_inner(self) -> i64

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

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

Load a value from this object. Read more
§

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

Store a value in this object. Read more
§

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

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

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
§

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
§

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
§

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
§

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
§

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
§

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
§

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
§

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
§

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
§

impl Radium for Cell<i8>

§

type Item = i8

§

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

Creates a new value of this type.
§

fn fence(_: Ordering)

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

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

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

fn into_inner(self) -> i8

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

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

Load a value from this object. Read more
§

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

Store a value in this object. Read more
§

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

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

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
§

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
§

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
§

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
§

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
§

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
§

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
§

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
§

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
§

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
§

impl Radium for Cell<isize>

§

type Item = isize

§

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

Creates a new value of this type.
§

fn fence(_: Ordering)

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

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

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

fn into_inner(self) -> isize

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

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

Load a value from this object. Read more
§

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

Store a value in this object. Read more
§

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

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

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
§

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
§

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
§

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
§

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
§

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
§

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
§

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
§

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
§

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
§

impl Radium for Cell<u16>

§

type Item = u16

§

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

Creates a new value of this type.
§

fn fence(_: Ordering)

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

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

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

fn into_inner(self) -> u16

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

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

Load a value from this object. Read more
§

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

Store a value in this object. Read more
§

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

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

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
§

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
§

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
§

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
§

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
§

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
§

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
§

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
§

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
§

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
§

impl Radium for Cell<u32>

§

type Item = u32

§

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

Creates a new value of this type.
§

fn fence(_: Ordering)

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

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

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

fn into_inner(self) -> u32

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

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

Load a value from this object. Read more
§

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

Store a value in this object. Read more
§

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

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

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
§

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
§

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
§

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
§

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
§

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
§

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
§

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
§

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
§

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
§

impl Radium for Cell<u64>

§

type Item = u64

§

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

Creates a new value of this type.
§

fn fence(_: Ordering)

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

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

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

fn into_inner(self) -> u64

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

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

Load a value from this object. Read more
§

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

Store a value in this object. Read more
§

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

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

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
§

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
§

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
§

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
§

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
§

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
§

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
§

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
§

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
§

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
§

impl Radium for Cell<u8>

§

type Item = u8

§

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

Creates a new value of this type.
§

fn fence(_: Ordering)

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

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

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

fn into_inner(self) -> u8

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

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

Load a value from this object. Read more
§

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

Store a value in this object. Read more
§

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

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

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
§

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
§

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
§

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
§

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
§

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
§

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
§

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
§

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
§

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
§

impl Radium for Cell<usize>

§

type Item = usize

§

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

Creates a new value of this type.
§

fn fence(_: Ordering)

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

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

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

fn into_inner(self) -> usize

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

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

Load a value from this object. Read more
§

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

Store a value in this object. Read more
§

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

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

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
§

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
§

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
§

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
§

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
§

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
§

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
§

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
§

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
§

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> Send for Cell<T>
where T: Send + ?Sized,

source§

impl<T> !Sync for Cell<T>
where T: ?Sized,

Auto Trait Implementations§

§

impl<T> !RefUnwindSafe for Cell<T>

§

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

§

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

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

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

§

type Store = T

The underlying element type.
§

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

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

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
§

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

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

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
§

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

§

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

The zero constant.
§

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

Views the type as a slice of its elements.
§

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

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

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
§

impl<T> Conv for T

§

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

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

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

§

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

Checks if this value is equivalent to the given key. Read more
§

impl<T> FmtForward for T

§

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Formats each item in a sequence. Read more
source§

impl<T> From<!> 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.

§

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

§

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

Pipes by value. This is generally the method you want to use. Read more
§

fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> R
where R: 'a,

Borrows self and passes that borrow into the pipe function. Read more
§

fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> R
where R: 'a,

Mutably borrows self and passes that borrow into the pipe function. Read more
§

fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
where Self: Borrow<B>, B: 'a + ?Sized, R: 'a,

Borrows self, then passes self.borrow() into the pipe function. Read more
§

fn pipe_borrow_mut<'a, B, R>( &'a mut self, func: impl FnOnce(&'a mut B) -> R ) -> R
where Self: BorrowMut<B>, B: 'a + ?Sized, R: 'a,

Mutably borrows self, then passes self.borrow_mut() into the pipe function. Read more
§

fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
where Self: AsRef<U>, U: 'a + ?Sized, R: 'a,

Borrows self, then passes self.as_ref() into the pipe function.
§

fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
where Self: AsMut<U>, U: 'a + ?Sized, R: 'a,

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

fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
where Self: Deref<Target = T>, T: 'a + ?Sized, R: 'a,

Borrows self, then passes self.deref() into the pipe function.
§

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

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

impl<T> Tap for T

§

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

Immutable access to a value. Read more
§

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

Mutable access to a value. Read more
§

fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
where Self: Borrow<B>, B: ?Sized,

Immutable access to the Borrow<B> of a value. Read more
§

fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
where Self: BorrowMut<B>, B: ?Sized,

Mutable access to the BorrowMut<B> of a value. Read more
§

fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
where Self: AsRef<R>, R: ?Sized,

Immutable access to the AsRef<R> view of a value. Read more
§

fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
where Self: AsMut<R>, R: ?Sized,

Mutable access to the AsMut<R> view of a value. Read more
§

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

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

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

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

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

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

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

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

fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
where Self: Borrow<B>, B: ?Sized,

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

fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
where Self: BorrowMut<B>, B: ?Sized,

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

fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
where Self: AsRef<R>, R: ?Sized,

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

fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
where Self: AsMut<R>, R: ?Sized,

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

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

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

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

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

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

§

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
§

impl<T> TryConv for T

§

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

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

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

§

type Error = Infallible

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

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

Performs the conversion.
source§

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

§

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

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

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

Performs the conversion.
§

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

§

fn vzip(self) -> V

source§

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

§

impl<T> JsonSchemaMaybe for T