[−][src]Struct lv2rs_atom::array::ArrayAtomBody
Abstract type for dynamically sized atom bodies.
Many dynamically sized atoms bodies have a lot of their behaviour and raw representation in common. Therefore, they are abstracted to this struct that contains a header and an array of sized items.
If you don't want to have a header, you can use ()
instead.
Not all combinations of header and data items are atom bodies, but many methods rely on the combination being an atom body.
Fields
header: H
data: [T]
Methods
impl<H, T> ArrayAtomBody<H, T> where
Self: AtomBody,
H: ArrayAtomHeader,
T: 'static + Sized + Copy,
[src]
Self: AtomBody,
H: ArrayAtomHeader,
T: 'static + Sized + Copy,
pub unsafe fn __initialize_body<'a, W>(
writer: &mut W,
parameter: &H::InitializationParameter,
urids: &mut CachedMap
) -> Result<(), ()> where
W: WritingFrame<'a> + WritingFrameExt<'a, Self>,
[src]
writer: &mut W,
parameter: &H::InitializationParameter,
urids: &mut CachedMap
) -> Result<(), ()> where
W: WritingFrame<'a> + WritingFrameExt<'a, Self>,
Internal method to initialize the body.
It simply calls the initialization method of the header, the data array will be left empty.
pub fn __create_ref<'a>(raw_data: &'a [u8]) -> Result<&'a Self, ()>
[src]
Internal method to create an atom body reference.
pub unsafe fn push<'a, W>(writer: &mut W, value: T) -> Result<(), ()> where
W: WritingFrame<'a> + WritingFrameExt<'a, Self>,
[src]
W: WritingFrame<'a> + WritingFrameExt<'a, Self>,
Push another value to the data array.
In case of insufficient memory, an Err
is returned.
This method assumes that the atom was already initialized, but since can't be checked, this method is unsafe.
pub unsafe fn append<'a, W>(writer: &mut W, slice: &[T]) -> Result<(), ()> where
W: WritingFrame<'a> + WritingFrameExt<'a, Self>,
[src]
W: WritingFrame<'a> + WritingFrameExt<'a, Self>,
Append a T
slice to the data.
In case of insufficient memory, an Err
is returned.
This method assumes that the atom was already initialized, but since can't be checked, this method is unsafe.
Auto Trait Implementations
impl<H, T> Send for ArrayAtomBody<H, T> where
H: Send,
T: Send,
H: Send,
T: Send,
impl<H, T> Sync for ArrayAtomBody<H, T> where
H: Sync,
T: Sync,
H: Sync,
T: Sync,
Blanket Implementations
impl<T, U> Into for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From for T
[src]
impl<T, U> TryFrom for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T> Borrow for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,