Value

Trait Value 

Source
pub trait Value {
    type Storage: Copy;

    // Required methods
    fn into_storage(self) -> Self::Storage;
    fn from_storage(storage: Self::Storage) -> Self;
}
Expand description

A value that can be written into or read from type-errased storage.

Required Associated Types§

Source

type Storage: Copy

The backing type that can store all variable types.

Required Methods§

Source

fn into_storage(self) -> Self::Storage

Converts a variable value into the variable storage type.

Source

fn from_storage(storage: Self::Storage) -> Self

Reads a variable value out of storage.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§