pub trait Value: Sized {
    // Required methods
    fn into_parts(self) -> Vec<Primitive>;
    fn from_parts<I>(values: &mut I) -> Result<(Self, usize), MemoryError>
       where I: Iterator<Item = Option<Primitive>>;
}
Expand description

Types that can be written to or read from KCEP program memory, in one contiguous block. If they require multiple memory addresses, they will be laid out into multiple consecutive memory addresses.

Required Methods§

source

fn into_parts(self) -> Vec<Primitive>

Store the value in memory.

source

fn from_parts<I>(values: &mut I) -> Result<(Self, usize), MemoryError>
where I: Iterator<Item = Option<Primitive>>,

Read the value from memory.

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl Value for bool

source§

fn into_parts(self) -> Vec<Primitive>

source§

fn from_parts<I>(values: &mut I) -> Result<(Self, usize), MemoryError>
where I: Iterator<Item = Option<Primitive>>,

source§

impl Value for f32

source§

fn into_parts(self) -> Vec<Primitive>

source§

fn from_parts<I>(values: &mut I) -> Result<(Self, usize), MemoryError>
where I: Iterator<Item = Option<Primitive>>,

source§

impl Value for f64

source§

fn into_parts(self) -> Vec<Primitive>

source§

fn from_parts<I>(values: &mut I) -> Result<(Self, usize), MemoryError>
where I: Iterator<Item = Option<Primitive>>,

source§

impl Value for i64

source§

fn into_parts(self) -> Vec<Primitive>

source§

fn from_parts<I>(values: &mut I) -> Result<(Self, usize), MemoryError>
where I: Iterator<Item = Option<Primitive>>,

source§

impl Value for u32

source§

fn into_parts(self) -> Vec<Primitive>

source§

fn from_parts<I>(values: &mut I) -> Result<(Self, usize), MemoryError>
where I: Iterator<Item = Option<Primitive>>,

source§

impl Value for usize

source§

fn into_parts(self) -> Vec<Primitive>

source§

fn from_parts<I>(values: &mut I) -> Result<(Self, usize), MemoryError>
where I: Iterator<Item = Option<Primitive>>,

source§

impl Value for String

source§

fn into_parts(self) -> Vec<Primitive>

source§

fn from_parts<I>(values: &mut I) -> Result<(Self, usize), MemoryError>
where I: Iterator<Item = Option<Primitive>>,

source§

impl Value for Vec<u8>

source§

fn into_parts(self) -> Vec<Primitive>

source§

fn from_parts<I>(values: &mut I) -> Result<(Self, usize), MemoryError>
where I: Iterator<Item = Option<Primitive>>,

source§

impl Value for Uuid

source§

fn into_parts(self) -> Vec<Primitive>

source§

fn from_parts<I>(values: &mut I) -> Result<(Self, usize), MemoryError>
where I: Iterator<Item = Option<Primitive>>,

source§

impl<T> Value for Option<T>
where T: Value,

Use the standard enum convention (a string for the variant tag, then all fields of the variant)

source§

fn into_parts(self) -> Vec<Primitive>

source§

fn from_parts<I>(values: &mut I) -> Result<(Self, usize), MemoryError>
where I: Iterator<Item = Option<Primitive>>,

source§

impl<T> Value for Box<T>
where T: Value,

Box<T> is laid out identically to an unboxed T.

source§

fn into_parts(self) -> Vec<Primitive>

source§

fn from_parts<I>(values: &mut I) -> Result<(Self, usize), MemoryError>
where I: Iterator<Item = Option<Primitive>>,

source§

impl<T> Value for Vec<T>
where T: Value,

Store the vec’s length as the first primitive, then lay out all elements.

source§

fn into_parts(self) -> Vec<Primitive>

source§

fn from_parts<I>(values: &mut I) -> Result<(Self, usize), MemoryError>
where I: Iterator<Item = Option<Primitive>>,

source§

impl<T> Value for HashSet<T>
where T: Value + Eq + Hash,

Store the HashMap’s length as the first primitive, then lay out all elements.

source§

fn into_parts(self) -> Vec<Primitive>

source§

fn from_parts<I>(values: &mut I) -> Result<(Self, usize), MemoryError>
where I: Iterator<Item = Option<Primitive>>,

Implementors§