Struct bones_asset::SchemaVec
pub struct SchemaVec { /* private fields */ }
Expand description
A type-erased Vec
-like collection that for items with the same [Schema
].
Implementations§
§impl SchemaVec
impl SchemaVec
pub fn new(schema: &'static Schema) -> SchemaVec
pub fn new(schema: &'static Schema) -> SchemaVec
Initialize an empty SchemaVec
for items with the given schema.
pub fn try_push<T>(&mut self, item: T) -> Result<(), SchemaMismatchError>where
T: HasSchema,
pub fn try_push<T>(&mut self, item: T) -> Result<(), SchemaMismatchError>where T: HasSchema,
pub fn try_push_box(
&mut self,
item: SchemaBox
) -> Result<(), SchemaMismatchError>
pub fn try_push_box( &mut self, item: SchemaBox ) -> Result<(), SchemaMismatchError>
Push the item into the end of the vector.
pub fn try_pop<T>(&mut self) -> Result<Option<T>, SchemaMismatchError>where
T: HasSchema,
pub fn try_pop<T>(&mut self) -> Result<Option<T>, SchemaMismatchError>where T: HasSchema,
pub fn try_get_mut<T>(
&mut self,
idx: usize
) -> Result<Option<&mut T>, SchemaMismatchError>where
T: HasSchema,
pub fn try_get_mut<T>( &mut self, idx: usize ) -> Result<Option<&mut T>, SchemaMismatchError>where T: HasSchema,
pub fn get_ref_mut(&mut self, idx: usize) -> Option<SchemaRefMut<'_>>
pub fn get_ref_mut(&mut self, idx: usize) -> Option<SchemaRefMut<'_>>
Get an item with the given index.
pub fn iter(&self) -> SchemaVecIter<'_>
pub fn iter(&self) -> SchemaVecIter<'_>
Iterate over values in the vec
pub fn iter_mut(&mut self) -> SchemaVecIterMut<'_>
pub fn iter_mut(&mut self) -> SchemaVecIterMut<'_>
Iterate mutably over values in the vec
pub fn try_into_svec<T>(self) -> Result<SVec<T>, SchemaMismatchError>where
T: HasSchema,
pub fn try_into_svec<T>(self) -> Result<SVec<T>, SchemaMismatchError>where T: HasSchema,
Trait Implementations§
§impl<'a> IntoIterator for &'a SchemaVec
impl<'a> IntoIterator for &'a SchemaVec
§impl<'a> IntoIterator for &'a mut SchemaVec
impl<'a> IntoIterator for &'a mut SchemaVec
impl Eq for SchemaVec
impl Send for SchemaVec
impl Sync for SchemaVec
Auto Trait Implementations§
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.