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§
sourcefn into_parts(self) -> Vec<Primitive>
fn into_parts(self) -> Vec<Primitive>
Store the value in memory.
sourcefn from_parts<I>(values: &mut I) -> Result<(Self, usize), MemoryError>
fn from_parts<I>(values: &mut I) -> Result<(Self, usize), MemoryError>
Read the value from memory.
Object Safety§
This trait is not object safe.
Implementations on Foreign Types§
source§impl Value for bool
impl Value for bool
fn into_parts(self) -> Vec<Primitive>
fn from_parts<I>(values: &mut I) -> Result<(Self, usize), MemoryError>
source§impl Value for f32
impl Value for f32
fn into_parts(self) -> Vec<Primitive>
fn from_parts<I>(values: &mut I) -> Result<(Self, usize), MemoryError>
source§impl Value for f64
impl Value for f64
fn into_parts(self) -> Vec<Primitive>
fn from_parts<I>(values: &mut I) -> Result<(Self, usize), MemoryError>
source§impl Value for i64
impl Value for i64
fn into_parts(self) -> Vec<Primitive>
fn from_parts<I>(values: &mut I) -> Result<(Self, usize), MemoryError>
source§impl Value for u32
impl Value for u32
fn into_parts(self) -> Vec<Primitive>
fn from_parts<I>(values: &mut I) -> Result<(Self, usize), MemoryError>
source§impl Value for usize
impl Value for usize
fn into_parts(self) -> Vec<Primitive>
fn from_parts<I>(values: &mut I) -> Result<(Self, usize), MemoryError>
source§impl Value for String
impl Value for String
fn into_parts(self) -> Vec<Primitive>
fn from_parts<I>(values: &mut I) -> Result<(Self, usize), MemoryError>
source§impl Value for Vec<u8>
impl Value for Vec<u8>
fn into_parts(self) -> Vec<Primitive>
fn from_parts<I>(values: &mut I) -> Result<(Self, usize), MemoryError>
source§impl Value for Uuid
impl Value for Uuid
fn into_parts(self) -> Vec<Primitive>
fn from_parts<I>(values: &mut I) -> Result<(Self, usize), MemoryError>
source§impl<T> Value for Option<T>where
T: Value,
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)
fn into_parts(self) -> Vec<Primitive>
fn from_parts<I>(values: &mut I) -> Result<(Self, usize), MemoryError>
source§impl<T> Value for Box<T>where
T: Value,
impl<T> Value for Box<T>where
T: Value,
Box<T>
is laid out identically to an unboxed T
.
fn into_parts(self) -> Vec<Primitive>
fn from_parts<I>(values: &mut I) -> Result<(Self, usize), MemoryError>
source§impl<T> Value for Vec<T>where
T: Value,
impl<T> Value for Vec<T>where
T: Value,
Store the vec’s length as the first primitive, then lay out all elements.
fn into_parts(self) -> Vec<Primitive>
fn from_parts<I>(values: &mut I) -> Result<(Self, usize), MemoryError>
source§impl<T> Value for HashSet<T>
impl<T> Value for HashSet<T>
Store the HashMap’s length as the first primitive, then lay out all elements.