pub struct Writer<'cx> { /* private fields */ }Expand description
Where values are written: bytes, the first value that couldn’t be, and the context they are written in.
Implementations§
Source§impl Writer<'_>
impl Writer<'_>
pub fn new() -> Self
pub fn with_capacity(capacity: usize) -> Self
Sourcepub fn with_context<'c>(self, context: &'c mut (dyn Context + 'c)) -> Writer<'c>
pub fn with_context<'c>(self, context: &'c mut (dyn Context + 'c)) -> Writer<'c>
This writer, writing in context.
Sourcepub fn context_mut<T: Any>(&mut self) -> Option<&mut T>
pub fn context_mut<T: Any>(&mut self) -> Option<&mut T>
The context’s part of type T, to change, if it has one.
pub fn push(&mut self, byte: u8)
pub fn extend_from_slice(&mut self, bytes: &[u8])
Sourcepub fn fail(&mut self, error: String)
pub fn fail(&mut self, error: String)
Records that a value can’t be written; the first such error is what
Writer::finish returns.
Trait Implementations§
Auto Trait Implementations§
impl<'cx> !RefUnwindSafe for Writer<'cx>
impl<'cx> !Send for Writer<'cx>
impl<'cx> !Sync for Writer<'cx>
impl<'cx> !UnwindSafe for Writer<'cx>
impl<'cx> Forget for Writer<'cx>
impl<'cx> Freeze for Writer<'cx>
impl<'cx> Move for Writer<'cx>
impl<'cx> Unpin for Writer<'cx>
impl<'cx> UnsafeUnpin for Writer<'cx>where
*const u8 is !null: UnsafeUnpin,
PhantomData<u8>: UnsafeUnpin,
&'cx mut dyn Context: UnsafeUnpin,
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