[−][src]Trait lv2_atom::scalar::ScalarAtom
An atom that only contains a single, scalar value.
Since scalar values are so simple, the reading and writing methods are exactly the same.
Associated Types
type InternalType: Unpin + Copy + Send + Sync + Sized + 'static
The internal representation of the atom.
For example, the Int
atom has the internal type of i32
, which is i32
on most platforms.
Provided methods
fn read_scalar(body: Space<'_>) -> Option<Self::InternalType>
Try to read the atom from a space.
If the space does not contain the atom or is not big enough, return None
. The second return value is the space behind the atom.
fn write_scalar<'a, 'b>(
frame: FramedMutSpace<'a, 'b>,
value: Self::InternalType
) -> Option<&'a mut Self::InternalType>
frame: FramedMutSpace<'a, 'b>,
value: Self::InternalType
) -> Option<&'a mut Self::InternalType>
Try to write the atom into a space.
Write an atom with the value of value
into the space and return a mutable reference to the written value. If the space is not big enough, return None
.