pub struct EnvelopeWriter<W: Write> { /* private fields */ }Expand description
Implementations§
Source§impl<W: Write> EnvelopeWriter<W>
impl<W: Write> EnvelopeWriter<W>
Sourcepub fn new(out: W) -> Result<Self, LogError>
pub fn new(out: W) -> Result<Self, LogError>
Starts a new log in out: writes the header line.
§Errors
LogError::Io when the header cannot be written.
Sourcepub fn write(&mut self, envelope: &Envelope) -> Result<(), LogError>
pub fn write(&mut self, envelope: &Envelope) -> Result<(), LogError>
Appends one envelope as one line.
§Errors
LogError::Io when the write fails. The line may be half written then: do not append to
the same file after an error, start a new one.
Auto Trait Implementations§
impl<W> Freeze for EnvelopeWriter<W>where
W: Freeze,
impl<W> RefUnwindSafe for EnvelopeWriter<W>where
W: RefUnwindSafe,
impl<W> Send for EnvelopeWriter<W>where
W: Send,
impl<W> Sync for EnvelopeWriter<W>where
W: Sync,
impl<W> Unpin for EnvelopeWriter<W>where
W: Unpin,
impl<W> UnsafeUnpin for EnvelopeWriter<W>where
W: UnsafeUnpin,
impl<W> UnwindSafe for EnvelopeWriter<W>where
W: UnwindSafe,
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