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§
source§impl<'a> EmailWriter<'a>
impl<'a> EmailWriter<'a>
sourcepub fn new(
writer: &'a mut dyn Write,
line_len: usize,
spaces: usize,
can_go_to_new_line_now: bool
) -> Self
pub fn new( writer: &'a mut dyn Write, line_len: usize, spaces: usize, can_go_to_new_line_now: bool ) -> Self
Construct a new EmailWriter.
line_lenis the length of the last line inwriter.spacesthe number of spaces that must be written before the next write.can_go_to_new_line_nowis whether the current line can be wrapped now or not.
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 projected_line_len(&self) -> usize
pub fn projected_line_len(&self) -> usize
Get the length in bytes of the last line written to the inner writer plus the spaces which might be written to in on the next write call.
sourcepub fn folding<'b>(&'b mut self) -> FoldingEmailWriter<'a, 'b>
pub fn folding<'b>(&'b mut self) -> FoldingEmailWriter<'a, 'b>
Get a Writer which automatically line folds text written to it.
Trait Implementations§
source§impl<'a> Drop for EmailWriter<'a>
impl<'a> Drop for EmailWriter<'a>
Auto Trait Implementations§
impl<'a> Freeze for EmailWriter<'a>
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§
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