Vector

Type Alias Vector 

Source
pub type Vector<T> = ArrayAtomBody<VectorHeader, T>;
Expand description

A homogenous array of sized atoms.

See the module documentation for more information.

Aliased Type§

#[repr(C)]
pub struct Vector<T> { pub header: VectorHeader, pub data: [T], }

Fields§

§header: VectorHeader§data: [T]

Implementations§

Source§

impl<T> Vector<T>
where T: 'static + AtomBody + Sized + Copy,

Source

pub fn child_body_size(&self) -> usize

Return the size of the child type, according to the vector’s body header.

Source

pub fn child_body_type(&self) -> URID

Return the type of the child, according to the vector’s body header.

Source

pub fn as_slice(&self) -> &[T]

Return a slice containing all items in the vector.

No allocation is done; This method simply borrows the data of the vector.

Trait Implementations§

Source§

impl<T> AtomBody for Vector<T>
where T: 'static + AtomBody + Sized + Copy,

Source§

type InitializationParameter = ()

The type of the parameter for initialize_body Read more
Source§

fn get_uri() -> &'static CStr

Return the URI of the atom type.
Source§

unsafe fn initialize_body<'a, W>( writer: &mut W, _: &(), urids: &mut CachedMap, ) -> Result<(), ()>
where W: WritingFrame<'a> + WritingFrameExt<'a, Self>,

Write out a basic but valid atom body. Read more
Source§

fn create_ref<'a>(raw_data: &'a [u8]) -> Result<&'a Self, ()>

Try to create a Self reference from a slice of raw data. Read more