Skip to main content

Value

Trait Value 

Source
pub trait Value<T>:
    Copy
    + Clone
    + Eq
    + Ord
    + Default {
    // Required methods
    fn value(&self) -> T;
    fn set_value<V: Number + AsPrimitive<usize>>(&mut self, val: V);

    // Provided method
    fn new(val: usize) -> Self { ... }
}
Expand description

Wrapper for a value of type T.

Required Methods§

Source

fn value(&self) -> T

Provides a way to access the value of type T.

Source

fn set_value<V: Number + AsPrimitive<usize>>(&mut self, val: V)

Sets the value of type T, using a value of type V.

Provided Methods§

Source

fn new(val: usize) -> Self

Creates a new instance of the type with the given value.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl Value<i8> for i8

Source§

fn value(&self) -> i8

Source§

fn set_value<V: Number + AsPrimitive<usize>>(&mut self, val: V)

Source§

impl Value<i16> for i16

Source§

fn value(&self) -> i16

Source§

fn set_value<V: Number + AsPrimitive<usize>>(&mut self, val: V)

Source§

impl Value<i32> for i32

Source§

fn value(&self) -> i32

Source§

fn set_value<V: Number + AsPrimitive<usize>>(&mut self, val: V)

Source§

impl Value<i64> for i64

Source§

fn value(&self) -> i64

Source§

fn set_value<V: Number + AsPrimitive<usize>>(&mut self, val: V)

Source§

impl Value<i128> for i128

Source§

fn value(&self) -> i128

Source§

fn set_value<V: Number + AsPrimitive<usize>>(&mut self, val: V)

Source§

impl Value<isize> for isize

Source§

fn value(&self) -> isize

Source§

fn set_value<V: Number + AsPrimitive<usize>>(&mut self, val: V)

Source§

impl Value<u8> for u8

Source§

fn value(&self) -> u8

Source§

fn set_value<V: Number + AsPrimitive<usize>>(&mut self, val: V)

Source§

impl Value<u16> for u16

Source§

fn value(&self) -> u16

Source§

fn set_value<V: Number + AsPrimitive<usize>>(&mut self, val: V)

Source§

impl Value<u32> for u32

Source§

fn value(&self) -> u32

Source§

fn set_value<V: Number + AsPrimitive<usize>>(&mut self, val: V)

Source§

impl Value<u64> for u64

Source§

fn value(&self) -> u64

Source§

fn set_value<V: Number + AsPrimitive<usize>>(&mut self, val: V)

Source§

impl Value<u128> for u128

Source§

fn value(&self) -> u128

Source§

fn set_value<V: Number + AsPrimitive<usize>>(&mut self, val: V)

Source§

impl Value<usize> for usize

Source§

fn value(&self) -> usize

Source§

fn set_value<V: Number + AsPrimitive<usize>>(&mut self, val: V)

Implementors§