NestedFrame

Struct NestedFrame 

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

A writing frame managing nested atoms.

Unlike the RootFrame, which really manages memory, this frame only forwards writing calls to the next frame in the hierarchy and updates the atom header accordingly. Additionally, this frame will assure for padding when dropped. These padding bytes will not be included in the top level header, only in the surrounding ones.

Nested frames can only be created with the create_nested_frame method.

Trait Implementations§

Source§

impl<'a, 'b, A> Drop for NestedFrame<'a, 'b, A>
where A: AtomBody + ?Sized,

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more
Source§

impl<'a, 'b, A> WritingFrame<'b> for NestedFrame<'a, 'b, A>
where A: AtomBody + ?Sized,

Source§

unsafe fn write_raw(&mut self, data: &[u8]) -> Result<&'b 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, 'b, A: AtomBody + ?Sized> WritingFrameExt<'b, A> for NestedFrame<'a, 'b, 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, 'b, A> Freeze for NestedFrame<'a, 'b, A>
where A: ?Sized,

§

impl<'a, 'b, A> !RefUnwindSafe for NestedFrame<'a, 'b, A>

§

impl<'a, 'b, A> !Send for NestedFrame<'a, 'b, A>

§

impl<'a, 'b, A> !Sync for NestedFrame<'a, 'b, A>

§

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

§

impl<'a, 'b, A> !UnwindSafe for NestedFrame<'a, 'b, 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.