[][src]Trait lv2rs_atom::frame::WritingFrame

pub trait WritingFrame<'a> {
    unsafe fn write_raw(&mut self, data: &[u8]) -> Result<&'a mut [u8], ()>;
fn get_atom(&self) -> &Atom; }

Basic functionality of a writing frame.

A writing frame manages an atom header and is able to append raw data to the atom. Additional methods are out-sourced to the WritingFrameExt trait since it contains generic methods and therefore can not be turned into trait objects. But don't worry, every type that implements the WritingFrame trait automatically implements the WritingFrameExt too.

Required methods

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

Try to write out a slice of bytes into the atom space.

The data will be written directly after the previously written data and no padding will be applied.

If writing was successfull, a slice with the written data is returned. In case of insufficient atom space, this function will return an error.

Also, this function is unsafe since it does not check the resulting atom for consistency. You have to know what you are doing!

fn get_atom(&self) -> &Atom

Return an immutable reference to the managed atom header.

Loading content...

Implementors

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

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

Loading content...