RootFrame

Struct RootFrame 

Source
pub struct RootFrame<'a, A: AtomBody + ?Sized> { /* private fields */ }
Expand description

The ground level writing frame.

This writing frame manages the first atom and actually has access to the data. It is created by the AtomOutputPort and simply acts like any WritingFrame.

Implementations§

Source§

impl<'a, A: AtomBody + ?Sized> RootFrame<'a, A>

Source

pub fn new(free_space: &'a mut [u8], urids: &mut CachedMap) -> Result<Self, ()>

Try to create a new root frame.

All you need to create a root frame is a slice of writable memory and a way to retrieve the URID of the managed atom. Then, this function will initialize the header in the beginning of the slice and create the frame.

If the slice is not big enough to hold the atom header, this function returns an Err.

Trait Implementations§

Source§

impl<'a, A: AtomBody + ?Sized> WritingFrame<'a> for RootFrame<'a, A>

Source§

unsafe fn write_raw(&mut self, data: &[u8]) -> Result<&'a mut [u8], ()>

Try to write out a slice of bytes into the atom space. Read more
Source§

fn get_atom(&self) -> &Atom

Return an immutable reference to the managed atom header.
Source§

impl<'a, A: AtomBody + ?Sized> WritingFrameExt<'a, A> for RootFrame<'a, A>

Source§

unsafe fn write_sized<T: Sized>(&mut self, object: &T) -> Result<&'a mut T, ()>

Try to write a sized object into the atom space. Read more
Source§

unsafe fn create_nested_frame<'b, C: AtomBody + ?Sized>( &'b mut self, urids: &mut CachedMap, ) -> Result<NestedFrame<'b, 'a, C>, ()>

Create a new atom header and return a nested writing frame for it. Read more
Source§

unsafe fn get_atom_body<'b>( &'b self, urids: &mut CachedMap, ) -> Result<&'b A, GetBodyError>

Try to get a reference to the body from our atom header. Read more

Auto Trait Implementations§

§

impl<'a, A> Freeze for RootFrame<'a, A>
where A: ?Sized,

§

impl<'a, A> RefUnwindSafe for RootFrame<'a, A>
where A: RefUnwindSafe + ?Sized,

§

impl<'a, A> Send for RootFrame<'a, A>
where A: Send + ?Sized,

§

impl<'a, A> Sync for RootFrame<'a, A>
where A: Sync + ?Sized,

§

impl<'a, A> Unpin for RootFrame<'a, A>
where A: Unpin + ?Sized,

§

impl<'a, A> !UnwindSafe for RootFrame<'a, A>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<'a, W> LiteralWritingFrame<'a> for W

Source§

fn append_string(&mut self, string: &str) -> Result<(), ()>

Append a string to the literal. Read more
Source§

impl<'a, W> ObjectWritingFrame<'a> for W

Source§

fn push_property<'b, A: AtomBody + ?Sized>( &'b mut self, key: URID, context: URID, parameter: &A::InitializationParameter, urids: &mut CachedMap, ) -> Result<NestedFrame<'b, 'a, A>, ()>

Add a property to the object. Read more
Source§

impl<'a, W> SequenceWritingFrame<'a> for W

Source§

fn push_event<'b, A: AtomBody + ?Sized>( &'b mut self, time: TimeStamp, parameter: &A::InitializationParameter, urids: &mut CachedMap, ) -> Result<NestedFrame<'b, 'a, A>, ()>

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<'a, W> TupleWritingFrame<'a> for W

Source§

fn push_atom<'b, A: AtomBody + ?Sized>( &'b mut self, parameter: &A::InitializationParameter, urids: &mut CachedMap, ) -> Result<NestedFrame<'b, 'a, A>, ()>

Add a new atom to the tuple. Read more
Source§

impl<'a, T, F> VectorWritingFrame<'a, T> for F
where T: 'static + AtomBody + Copy, F: WritingFrame<'a> + WritingFrameExt<'a, ArrayAtomBody<VectorHeader, T>>,

Source§

fn push(&mut self, value: T) -> Result<(), ()>

Push a value to the end of the vector.
Source§

fn append(&mut self, slice: &[T]) -> Result<(), ()>

Append a slice of values to the end of the vector.