Trait tea_core::prelude::UninitRefMut
source · pub trait UninitRefMut<T>: GetLen {
// Required method
unsafe fn uset(&mut self, idx: usize, v: T);
// Provided method
fn write_trust_iter<I: TrustedLen<Item = T>>(
&mut self,
iter: I,
) -> TResult<()>
where T: Clone { ... }
}Expand description
Trait for mutable references to uninitialized vectors that can be written to.
Required Methods§
Provided Methods§
sourcefn write_trust_iter<I: TrustedLen<Item = T>>(&mut self, iter: I) -> TResult<()>where
T: Clone,
fn write_trust_iter<I: TrustedLen<Item = T>>(&mut self, iter: I) -> TResult<()>where
T: Clone,
Writes the contents of a trusted iterator to the uninitialized vector.
This method handles three cases:
- If the iterator length matches the vector length, it writes each item.
- If the iterator has only one item, it clones and writes that item to all positions.
- If the lengths don’t match and the iterator has more than one item, it returns an error.
Object Safety§
This trait is not object safe.