Struct libspa::pod::builder::Builder

source ·
pub struct Builder<'d> { /* private fields */ }

Implementations§

source§

impl<'d> Builder<'d>

source

pub fn new(data: &'d mut Vec<u8>) -> Self

source

pub fn as_raw(&self) -> &spa_pod_builder

source

pub fn as_raw_ptr(&self) -> *mut spa_pod_builder

source

pub unsafe fn state(&self) -> spa_pod_builder_state

§Safety

The builder state may only be used as long as all frames that were pushed to the builder at the time of this call are alive and not moved

source

pub unsafe fn reset(&mut self, state: *mut spa_pod_builder_state)

§Safety

TODO: Constraints unknown, use at own risk

source

pub unsafe fn deref(&mut self, offset: u32) -> *mut spa_pod

§Safety

TODO: Constraints unknown, use at own risk

source

pub unsafe fn frame(&mut self, frame: *mut spa_pod_frame) -> *mut spa_pod

§Safety

TODO: Constraints unknown, use at own risk

source

pub unsafe fn push( &mut self, frame: *mut spa_pod_frame, pod: *const spa_pod, offset: u32 )

§Safety

TODO: Constraints unknown, use at own risk

source

pub fn raw_padded(&mut self, data: &[u8]) -> Result<(), Errno>

source

pub unsafe fn pop(&mut self, frame: &mut spa_pod_frame)

§Safety

Only the last added frame may be popped

source

pub fn add_none(&mut self) -> Result<(), Errno>

source

pub fn add_bool(&mut self, val: bool) -> Result<(), Errno>

source

pub fn add_id(&mut self, val: Id) -> Result<(), Errno>

source

pub fn add_int(&mut self, val: i32) -> Result<(), Errno>

source

pub fn add_long(&mut self, val: i64) -> Result<(), Errno>

source

pub fn add_float(&mut self, val: f32) -> Result<(), Errno>

source

pub fn add_double(&mut self, val: f64) -> Result<(), Errno>

source

pub fn add_string(&mut self, string: &str) -> Result<(), Errno>

§Panics

If string contains an interior null byte

source

pub fn add_bytes(&mut self, bytes: &[u8]) -> Result<(), Errno>

source

pub unsafe fn add_pointer( &mut self, type_: Id, val: *const c_void ) -> Result<(), Errno>

§Safety

The pointer must be pointing to valid, well-aligned data which has the type as specified by type_.

source

pub fn add_fd(&mut self, val: RawFd) -> Result<(), Errno>

source

pub fn add_rectangle(&mut self, val: Rectangle) -> Result<(), Errno>

source

pub fn add_fraction(&mut self, val: Fraction) -> Result<(), Errno>

source

pub unsafe fn push_array( &mut self, frame: &mut MaybeUninit<spa_pod_frame> ) -> Result<(), Errno>

§Safety

The provided frame must not be moved or destroyed before it is popped again.

The frame may only be assumed as initialized if this method returns Ok.

source

pub unsafe fn add_array( &mut self, child_size: u32, child_type: u32, n_elems: u32, elems: *const c_void ) -> Result<(), Errno>

§Safety

elems must point to a valid array containing at least n_elems with each child having exactly the size as specified by child_size and the type child_type.

source

pub unsafe fn push_choice( &mut self, frame: &mut MaybeUninit<spa_pod_frame>, type_: u32, flags: u32 ) -> Result<(), Errno>

§Safety

The provided frame must not be moved or destroyed before it is popped again.

The frame may only be assumed as initialized if this method returns Ok.

source

pub unsafe fn push_struct( &mut self, frame: &mut MaybeUninit<spa_pod_frame> ) -> Result<(), Errno>

§Safety

The provided frame must not be moved or destroyed before it is popped again.

The frame may only be assumed as initialized if this method returns Ok.

source

pub unsafe fn push_object( &mut self, frame: &mut MaybeUninit<spa_pod_frame>, type_: u32, id: u32 ) -> Result<(), Errno>

§Safety

The provided frame must not be moved or destroyed before it is popped again.

The frame may only be assumed as initialized if this method returns Ok.

source

pub fn add_prop(&mut self, key: u32, flags: u32) -> Result<(), Errno>

source

pub unsafe fn push_sequence( &mut self, frame: &mut MaybeUninit<spa_pod_frame>, unit: u32 ) -> Result<(), Errno>

§Safety

The provided frame must not be moved or destroyed before it is popped again.

The frame may only be assumed as initialized if this method returns Ok.

source

pub fn add_control(&mut self, offset: u32, type_: u32) -> c_int

Auto Trait Implementations§

§

impl<'d> RefUnwindSafe for Builder<'d>

§

impl<'d> !Send for Builder<'d>

§

impl<'d> !Sync for Builder<'d>

§

impl<'d> Unpin for Builder<'d>

§

impl<'d> !UnwindSafe for Builder<'d>

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<T, U> TryFrom<U> for T
where U: Into<T>,

§

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>,

§

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.