pub trait WritableVecExt<T>: Writable<Target = Vec<T>> {
// Provided methods
fn push(&mut self, value: T)
where T: 'static { ... }
fn pop(&mut self) -> Option<T>
where T: 'static { ... }
fn insert(&mut self, index: usize, value: T)
where T: 'static { ... }
fn remove(&mut self, index: usize) -> T
where T: 'static { ... }
fn clear(&mut self)
where T: 'static { ... }
fn extend(&mut self, iter: impl IntoIterator<Item = T>)
where T: 'static { ... }
fn truncate(&mut self, len: usize)
where T: 'static { ... }
fn swap_remove(&mut self, index: usize) -> T
where T: 'static { ... }
fn retain(&mut self, f: impl FnMut(&T) -> bool)
where T: 'static { ... }
fn split_off(&mut self, at: usize) -> Vec<T>
where T: 'static { ... }
fn get_mut(
&mut self,
index: usize,
) -> Option<WriteLock<'_, T, Self::Storage, Self::WriteMetadata>>
where T: 'static { ... }
fn iter_mut(&mut self) -> WritableValueIterator<'_, Self> ⓘ
where Self: Sized + Clone { ... }
}Available on crate feature
prelude only.Expand description
An extension trait for Writable<Vec<T>> that provides some convenience methods.
Provided Methods§
Sourcefn insert(&mut self, index: usize, value: T)where
T: 'static,
fn insert(&mut self, index: usize, value: T)where
T: 'static,
Inserts a new value at the given index.
Sourcefn extend(&mut self, iter: impl IntoIterator<Item = T>)where
T: 'static,
fn extend(&mut self, iter: impl IntoIterator<Item = T>)where
T: 'static,
Extends the vector with the given iterator.
Sourcefn swap_remove(&mut self, index: usize) -> Twhere
T: 'static,
fn swap_remove(&mut self, index: usize) -> Twhere
T: 'static,
Swaps two values in the vector.
Sourcefn retain(&mut self, f: impl FnMut(&T) -> bool)where
T: 'static,
fn retain(&mut self, f: impl FnMut(&T) -> bool)where
T: 'static,
Retains only the values that match the given predicate.
Sourcefn split_off(&mut self, at: usize) -> Vec<T>where
T: 'static,
fn split_off(&mut self, at: usize) -> Vec<T>where
T: 'static,
Splits the vector into two at the given index.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".