pub struct Preallocated<'a, E: ?Sized, T> {
pub encoder: &'a mut E,
/* private fields */
}
Expand description
A pre-allocated slice of elements
Fields§
§encoder: &'a mut E
The encoder.
Implementations§
Source§impl<E: Encoder + ?Sized, T> Preallocated<'_, E, T>
impl<E: Encoder + ?Sized, T> Preallocated<'_, E, T>
Sourcepub unsafe fn write_next(&mut self, value: &T)
pub unsafe fn write_next(&mut self, value: &T)
Writes into the next pre-allocated slot in the encoder.
§Safety
All of the bytes of value
must be initialized, including padding.
Auto Trait Implementations§
impl<'a, E, T> Freeze for Preallocated<'a, E, T>where
E: ?Sized,
impl<'a, E, T> RefUnwindSafe for Preallocated<'a, E, T>
impl<'a, E, T> Send for Preallocated<'a, E, T>
impl<'a, E, T> Sync for Preallocated<'a, E, T>
impl<'a, E, T> Unpin for Preallocated<'a, E, T>
impl<'a, E, T> !UnwindSafe for Preallocated<'a, E, T>
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