Trait polyvalue::ValueTrait

source ·
pub trait ValueTrait: Display + Debug + Clone + PartialEq + PartialOrd + Hash + Serialize + for<'a> Deserialize<'a> + Default {
    type Inner;

    // Required methods
    fn new(inner: Self::Inner) -> Self;
    fn inner(&self) -> &Self::Inner;
    fn inner_mut(&mut self) -> &mut Self::Inner;
    fn into_inner(self) -> Self::Inner;
}
Expand description

A trait that all values must implement It enforces a set of common traits and accessors

Required Associated Types§

source

type Inner

The inner type of the value

Required Methods§

source

fn new(inner: Self::Inner) -> Self

Creates a new value from the given inner value

source

fn inner(&self) -> &Self::Inner

Returns a reference to the inner value

source

fn inner_mut(&mut self) -> &mut Self::Inner

Returns a mutable reference to the inner value

source

fn into_inner(self) -> Self::Inner

Consumes the value and returns the inner value

Object Safety§

This trait is not object safe.

Implementors§