Struct emailmessage::SinglePart
source · pub struct SinglePart<B = Body> { /* private fields */ }
Expand description
Single part
Example
extern crate mime;
extern crate emailmessage;
use emailmessage::{SinglePart, header};
let part = SinglePart::builder()
.header(header::ContentType("text/plain; charset=utf8".parse().unwrap()))
.header(header::ContentTransferEncoding::Binary)
.body("Текст письма в уникоде");
Implementations
sourceimpl SinglePart<()>
impl SinglePart<()>
sourcepub fn builder() -> SinglePartBuilder
pub fn builder() -> SinglePartBuilder
Creates a default builder for singlepart
sourcepub fn seven_bit() -> SinglePartBuilder
pub fn seven_bit() -> SinglePartBuilder
Creates a singlepart builder with 7bit encoding
Shortcut for SinglePart::builder().header(ContentTransferEncoding::SevenBit)
.
sourcepub fn quoted_printable() -> SinglePartBuilder
pub fn quoted_printable() -> SinglePartBuilder
Creates a singlepart builder with quoted-printable encoding
Shortcut for SinglePart::builder().header(ContentTransferEncoding::QuotedPrintable)
.
sourcepub fn base64() -> SinglePartBuilder
pub fn base64() -> SinglePartBuilder
Creates a singlepart builder with base64 encoding
Shortcut for SinglePart::builder().header(ContentTransferEncoding::Base64)
.
sourcepub fn eight_bit() -> SinglePartBuilder
pub fn eight_bit() -> SinglePartBuilder
Creates a singlepart builder with 8-bit encoding
Shortcut for SinglePart::builder().header(ContentTransferEncoding::EightBit)
.
sourcepub fn binary() -> SinglePartBuilder
pub fn binary() -> SinglePartBuilder
Creates a singlepart builder with binary encoding
Shortcut for SinglePart::builder().header(ContentTransferEncoding::Binary)
.
sourceimpl<B> SinglePart<B>
impl<B> SinglePart<B>
sourcepub fn encoding(&self) -> Option<&ContentTransferEncoding>
pub fn encoding(&self) -> Option<&ContentTransferEncoding>
Get the transfer encoding
sourcepub fn headers_mut(&mut self) -> &mut Headers
pub fn headers_mut(&mut self) -> &mut Headers
Get a mutable reference to the headers
sourcepub fn into_stream(self) -> SinglePartStream<B>where
B: Payload,
pub fn into_stream(self) -> SinglePartStream<B>where
B: Payload,
Converts singlepart into stream
Trait Implementations
sourceimpl<B: Clone> Clone for SinglePart<B>
impl<B: Clone> Clone for SinglePart<B>
sourcefn clone(&self) -> SinglePart<B>
fn clone(&self) -> SinglePart<B>
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresourceimpl<B: Debug> Debug for SinglePart<B>
impl<B: Debug> Debug for SinglePart<B>
sourceimpl<B> Display for SinglePart<B>where
B: AsRef<str>,
impl<B> Display for SinglePart<B>where
B: AsRef<str>,
sourceimpl<B> From<SinglePart<B>> for Bodywhere
B: Payload,
B::Data: IntoBuf,
B::Error: Error + Send + Sync,
impl<B> From<SinglePart<B>> for Bodywhere
B: Payload,
B::Data: IntoBuf,
B::Error: Error + Send + Sync,
sourcefn from(this: SinglePart<B>) -> Self
fn from(this: SinglePart<B>) -> Self
sourceimpl<B> From<SinglePart<B>> for SinglePartStream<B>where
B: Payload,
impl<B> From<SinglePart<B>> for SinglePartStream<B>where
B: Payload,
Convert single part into boxed stream of binary chunks