pub trait ResizableMutator<T> {
// Required methods
fn resize(&mut self, new_len: usize, value: T);
fn extend<'a, I: IntoIterator<Item = &'a T>>(&mut self, iter: I)
where T: 'a;
fn splice<R, I>(
&mut self,
range: R,
replace_with: I,
) -> Splice<'_, I::IntoIter>
where R: RangeBounds<usize>,
I: IntoIterator<Item = T>;
fn drain<R>(&mut self, range: R) -> Drain<'_, T>
where R: RangeBounds<usize>;
}
Expand description
Contains resizable bytes
Required Methods§
Sourcefn resize(&mut self, new_len: usize, value: T)
fn resize(&mut self, new_len: usize, value: T)
Resize the mutator content to a given new size.
Use value
to fill new slots in case the buffer grows.
See Vec::splice
.
Sourcefn extend<'a, I: IntoIterator<Item = &'a T>>(&mut self, iter: I)where
T: 'a,
fn extend<'a, I: IntoIterator<Item = &'a T>>(&mut self, iter: I)where
T: 'a,
Extends the given buffer with an iterator. See alloc::vec::Vec::extend
Sourcefn splice<R, I>(&mut self, range: R, replace_with: I) -> Splice<'_, I::IntoIter>
fn splice<R, I>(&mut self, range: R, replace_with: I) -> Splice<'_, I::IntoIter>
Splices the given target values according to Vec::splice
’s rules
Sourcefn drain<R>(&mut self, range: R) -> Drain<'_, T>where
R: RangeBounds<usize>,
fn drain<R>(&mut self, range: R) -> Drain<'_, T>where
R: RangeBounds<usize>,
Drains the given target value according to Vec::drain
’s rules
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.