Skip to main content

Builder

Struct Builder 

Source
pub struct Builder<'a, T>{ /* private fields */ }

Implementations§

Source§

impl<'a, T> Builder<'a, T>

Source

pub fn len(&self) -> u32

Source

pub fn is_empty(&self) -> bool

Source

pub fn into_reader(self) -> Reader<'a, T>

Source

pub fn set(&mut self, index: u32, value: T)

Source

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

Attempts to return a view of the list as a native Rust slice.

Returns None if either:

  • The elements of the list are non-contiguous, which can happen if the schema has evolved.
  • The elements of the list are bit-sized, i.e. T is bool. In the case, the list is bit-packed, and therefore differs in representation from Rust’s &[bool].

This method raises a compile-time error if T is larger than one byte and either the unaligned feature is enabled or the target is big-endian.

Source§

impl<T: PrimitiveElement> Builder<'_, T>

Source

pub fn get(&self, index: u32) -> T

Gets the T at position index. Panics if index is greater than or equal to len().

Source

pub fn try_get(&self, index: u32) -> Option<T>

Gets the T at position index. Returns None if index is greater than or equal to len().

Source

pub fn reborrow(&mut self) -> Builder<'_, T>

Trait Implementations§

Source§

impl<'a, T: PrimitiveElement + Introspect> DowncastBuilder<'a> for Builder<'a, T>

Source§

impl<'a, T: PrimitiveElement + Introspect> From<Builder<'a, T>> for Builder<'a>

Source§

fn from(t: Builder<'a, T>) -> Builder<'a>

Converts to this type from the input type.
Source§

impl<'a, T: PrimitiveElement> FromPointerBuilder<'a> for Builder<'a, T>

Source§

fn init_pointer(builder: PointerBuilder<'a>, size: u32) -> Builder<'a, T>

Source§

fn get_from_pointer( builder: PointerBuilder<'a>, default: Option<&'a [Word]>, ) -> Result<Builder<'a, T>>

Auto Trait Implementations§

§

impl<'a, T> !RefUnwindSafe for Builder<'a, T>

§

impl<'a, T> !Send for Builder<'a, T>

§

impl<'a, T> !Sync for Builder<'a, T>

§

impl<'a, T> !UnwindSafe for Builder<'a, T>

§

impl<'a, T> Freeze for Builder<'a, T>

§

impl<'a, T> Unpin for Builder<'a, T>
where T: Unpin,

§

impl<'a, T> UnsafeUnpin for Builder<'a, T>

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

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.