Struct email_encoding::headers::writer::EmailWriter
source · [−]pub struct EmailWriter<'a> { /* private fields */ }
Expand description
Wrapper around Write
that remembers the length of the
last line written to it.
Implementations
sourceimpl<'a> EmailWriter<'a>
impl<'a> EmailWriter<'a>
sourcepub fn new(
writer: &'a mut dyn Write,
line_len: usize,
write_space_on_next_write: bool
) -> Self
pub fn new(
writer: &'a mut dyn Write,
line_len: usize,
write_space_on_next_write: bool
) -> Self
Construct a new EmailWriter
.
line_len
is the length of the last line inwriter
.write_space_on_next_write
is whether the writer must go to a new line when writing it’s first character
sourcepub fn space(&mut self)
pub fn space(&mut self)
Write a space which might get wrapped to a new line on the next write.
This method shouldn’t be called multiple times consecutively, and will panic if debug assertions are on.
sourcepub fn line_len(&self) -> usize
pub fn line_len(&self) -> usize
Get the length in bytes of the last line written to the inner writer.
sourcepub fn folding<'b>(&'b mut self) -> FoldingEmailWriter<'a, 'b>
pub fn folding<'b>(&'b mut self) -> FoldingEmailWriter<'a, 'b>
Get a Write
r which automatically line folds text written to it.
Trait Implementations
Auto Trait Implementations
impl<'a> !RefUnwindSafe for EmailWriter<'a>
impl<'a> !Send for EmailWriter<'a>
impl<'a> !Sync for EmailWriter<'a>
impl<'a> Unpin for EmailWriter<'a>
impl<'a> !UnwindSafe for EmailWriter<'a>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more