pub struct SchemaVec { /* private fields */ }Expand description
A type-erased Vec-like collection that for items with the same [Schema].
Implementations§
Source§impl SchemaVec
impl SchemaVec
Sourcepub fn new(schema: &'static Schema) -> SchemaVec
pub fn new(schema: &'static Schema) -> SchemaVec
Initialize an empty SchemaVec for items with the given schema.
Sourcepub 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.
Sourcepub fn try_get<T>(&self, idx: usize) -> Result<Option<&T>, SchemaMismatchError>where
T: HasSchema,
pub fn try_get<T>(&self, idx: usize) -> Result<Option<&T>, SchemaMismatchError>where
T: HasSchema,
Sourcepub 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,
Sourcepub 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.
Sourcepub fn iter(&self) -> SchemaVecIter<'_> ⓘ
pub fn iter(&self) -> SchemaVecIter<'_> ⓘ
Iterate over values in the vec
Sourcepub fn iter_mut(&mut self) -> SchemaVecIterMut<'_> ⓘ
pub fn iter_mut(&mut self) -> SchemaVecIterMut<'_> ⓘ
Iterate mutably over values in the vec
Sourcepub 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§
Source§impl<'a> IntoIterator for &'a SchemaVec
impl<'a> IntoIterator for &'a SchemaVec
Source§impl<'a> IntoIterator for &'a mut SchemaVec
impl<'a> IntoIterator for &'a mut SchemaVec
Source§type Item = SchemaRefMut<'a>
type Item = SchemaRefMut<'a>
The type of the elements being iterated over.
Source§type IntoIter = SchemaVecIterMut<'a>
type IntoIter = SchemaVecIterMut<'a>
Which kind of iterator are we turning this into?
impl Eq for SchemaVec
impl Send for SchemaVec
impl Sync for SchemaVec
Auto Trait Implementations§
impl Freeze for SchemaVec
impl !RefUnwindSafe for SchemaVec
impl Unpin for SchemaVec
impl !UnwindSafe for SchemaVec
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