Struct bones_schema::ptr::SchemaVecAccess

source ·
pub struct SchemaVecAccess<'a> { /* private fields */ }
Expand description

Access helper for a SchemaVec.

Implementations§

source§

impl<'a> SchemaVecAccess<'a>

source

pub fn into_schema_ref(self) -> SchemaRef<'a>

Convert back to a SchemaRefMut

Methods from Deref<Target = &'a SchemaVec>§

source

pub fn try_push<T: HasSchema>( &mut self, item: T, ) -> Result<(), SchemaMismatchError>

Push an item to the vec.

§Errors

Errors if the schema of T doesn’t match the vec.

source

pub fn push<T: HasSchema>(&mut self, item: T)

Push an item to the vec.

§Panics

Panics if the schema of T doesn’t match the vec.

source

pub fn try_push_box( &mut self, item: SchemaBox, ) -> Result<(), SchemaMismatchError>

Push the item into the end of the vector.

source

pub fn push_box(&mut self, item: SchemaBox)

Push the item into the end of the vector.

source

pub fn pop_box(&mut self) -> Option<SchemaBox>

Pop the last item off of the end of the vector.

source

pub fn try_pop<T: HasSchema>( &mut self, ) -> Result<Option<T>, SchemaMismatchError>

Pop an item off the vec.

§Errors

Errors if the schema of T doesn’t match.

source

pub fn pop<T: HasSchema>(&mut self) -> Option<T>

Pop an item off the vec.

§Panics

Panics if the schema of T doesn’t match.

source

pub fn try_get<T: HasSchema>( &self, idx: usize, ) -> Result<Option<&T>, SchemaMismatchError>

Get an item in the vec.

§Errors

Errors if the schema doesn’t match.

source

pub fn get<T: HasSchema>(&self, idx: usize) -> Option<&T>

Get an item in the vec.

§Panics

Panics if the schema doesn’t match.

source

pub fn get_ref(&self, idx: usize) -> Option<SchemaRef<'_>>

Get the item with the given index.

source

pub fn try_get_mut<T: HasSchema>( &mut self, idx: usize, ) -> Result<Option<&mut T>, SchemaMismatchError>

Get an item in the vec.

§Errors

Errors if the schema doesn’t match.

source

pub fn get_mut<T: HasSchema>(&mut self, idx: usize) -> Option<&mut T>

Get an item in the vec.

§Panics

Panics if the schema doesn’t match.

source

pub fn get_ref_mut(&mut self, idx: usize) -> Option<SchemaRefMut<'_>>

Get an item with the given index.

source

pub fn len(&self) -> usize

Get the number of items in the vector.

source

pub fn is_empty(&self) -> bool

Returns true if the vector has zero items in it.

source

pub fn capacity(&self) -> usize

Get the capacity of the backing buffer.

source

pub fn schema(&self) -> &'static Schema

Get the schema of items in this SchemaVec.

source

pub fn iter(&self) -> SchemaVecIter<'_>

Iterate over values in the vec

source

pub fn iter_mut(&mut self) -> SchemaVecIterMut<'_>

Iterate mutably over values in the vec

source

pub fn hash(&self) -> u64

Get the hash of this SchemaVec.

§Panics

Panics if the inner type doesn’t implement hash.

source

pub fn remove(&mut self, index: usize) -> SchemaBox

Remove and return the element at position index within the vector, shifting all elements after it to the left.

§Panics

Panics if index is out of bounds.

source

pub fn clear(&mut self)

Clears the vector, removing all values.

source

pub fn truncate(&mut self, len: usize)

Shortens the vector, keeping the first len elements and dropping the rest.

If len is greater than the vector’s current length, this has no effect.

Trait Implementations§

source§

impl<'a> Clone for SchemaVecAccess<'a>

source§

fn clone(&self) -> SchemaVecAccess<'a>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<'a> Deref for SchemaVecAccess<'a>

§

type Target = &'a SchemaVec

The resulting type after dereferencing.
source§

fn deref(&self) -> &Self::Target

Dereferences the value.
source§

impl<'a> DerefMut for SchemaVecAccess<'a>

source§

fn deref_mut(&mut self) -> &mut Self::Target

Mutably dereferences the value.
source§

impl<'a> Copy for SchemaVecAccess<'a>

Auto Trait Implementations§

§

impl<'a> Freeze for SchemaVecAccess<'a>

§

impl<'a> !RefUnwindSafe for SchemaVecAccess<'a>

§

impl<'a> !Send for SchemaVecAccess<'a>

§

impl<'a> !Sync for SchemaVecAccess<'a>

§

impl<'a> Unpin for SchemaVecAccess<'a>

§

impl<'a> !UnwindSafe for SchemaVecAccess<'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> CloneToUninit for T
where T: Copy,

source§

unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> CloneToUninit for T
where T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. 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> RawClone for T
where T: Clone,

source§

unsafe fn raw_clone(src: *const c_void, dst: *mut c_void)

Write the default value of the type to the pointer. Read more
source§

fn raw_clone_cb() -> Unsafe<&'static (dyn Fn(*const c_void, *mut c_void) + Sync + Send + 'static)>

Get a callback suitable for SchemaData.
source§

impl<T> RawDrop for T

source§

unsafe fn raw_drop(ptr: *mut c_void)

Write the default value of the type to the pointer. Read more
source§

fn raw_drop_cb() -> Unsafe<&'static (dyn Fn(*mut c_void) + Sync + Send + 'static)>

Get a callback suitable for SchemaData.
source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V