Struct email::email::message::ouroboros_impl_message::MessageAsyncSendBuilder
source · pub(super) struct MessageAsyncSendBuilder<'a, ParsedBuilder_: for<'this> FnOnce(&'this mut RawMessage<'a>) -> Pin<Box<dyn Future<Output = Option<Message<'this>>> + Send + 'this>>> {
pub(super) raw: RawMessage<'a>,
pub(super) parsed_builder: ParsedBuilder_,
}
Expand description
A more verbose but stable way to construct self-referencing structs. It is comparable to using StructName { field1: value1, field2: value2 }
rather than StructName::new(value1, value2)
. This has the dual benefit of making your code both easier to refactor and more readable. Call build()
to construct the actual struct. The fields of this struct should be used as follows:
Field | Suggested Use |
---|---|
raw | Directly pass in the value this field should contain |
parsed_builder | Use a function or closure: (raw: &mut _) -> parsed: _ |
Fields§
§raw: RawMessage<'a>
§parsed_builder: ParsedBuilder_
Implementations§
source§impl<'a, ParsedBuilder_: for<'this> FnOnce(&'this mut RawMessage<'a>) -> Pin<Box<dyn Future<Output = Option<Message<'this>>> + Send + 'this>>> MessageAsyncSendBuilder<'a, ParsedBuilder_>
impl<'a, ParsedBuilder_: for<'this> FnOnce(&'this mut RawMessage<'a>) -> Pin<Box<dyn Future<Output = Option<Message<'this>>> + Send + 'this>>> MessageAsyncSendBuilder<'a, ParsedBuilder_>
sourcepub(super) async fn build(self) -> Message<'a>
pub(super) async fn build(self) -> Message<'a>
Calls Message::new()
using the provided values. This is preferrable over calling new()
directly for the reasons listed above.
Auto Trait Implementations§
impl<'a, ParsedBuilder_> Freeze for MessageAsyncSendBuilder<'a, ParsedBuilder_>where
ParsedBuilder_: Freeze,
impl<'a, ParsedBuilder_> RefUnwindSafe for MessageAsyncSendBuilder<'a, ParsedBuilder_>where
ParsedBuilder_: RefUnwindSafe,
impl<'a, ParsedBuilder_> Send for MessageAsyncSendBuilder<'a, ParsedBuilder_>where
ParsedBuilder_: Send,
impl<'a, ParsedBuilder_> Sync for MessageAsyncSendBuilder<'a, ParsedBuilder_>where
ParsedBuilder_: Sync,
impl<'a, ParsedBuilder_> Unpin for MessageAsyncSendBuilder<'a, ParsedBuilder_>where
ParsedBuilder_: Unpin,
impl<'a, ParsedBuilder_> UnwindSafe for MessageAsyncSendBuilder<'a, ParsedBuilder_>where
ParsedBuilder_: UnwindSafe,
Blanket Implementations§
source§impl<Src, Scheme> ApproxFrom<Src, Scheme> for Srcwhere
Scheme: ApproxScheme,
impl<Src, Scheme> ApproxFrom<Src, Scheme> for Srcwhere
Scheme: ApproxScheme,
source§fn approx_from(src: Src) -> Result<Src, <Src as ApproxFrom<Src, Scheme>>::Err>
fn approx_from(src: Src) -> Result<Src, <Src as ApproxFrom<Src, Scheme>>::Err>
Convert the given value into an approximately equivalent representation.
source§impl<Dst, Src, Scheme> ApproxInto<Dst, Scheme> for Srcwhere
Dst: ApproxFrom<Src, Scheme>,
Scheme: ApproxScheme,
impl<Dst, Src, Scheme> ApproxInto<Dst, Scheme> for Srcwhere
Dst: ApproxFrom<Src, Scheme>,
Scheme: ApproxScheme,
§type Err = <Dst as ApproxFrom<Src, Scheme>>::Err
type Err = <Dst as ApproxFrom<Src, Scheme>>::Err
The error type produced by a failed conversion.
source§fn approx_into(self) -> Result<Dst, <Src as ApproxInto<Dst, Scheme>>::Err>
fn approx_into(self) -> Result<Dst, <Src as ApproxInto<Dst, Scheme>>::Err>
Convert the subject into an approximately equivalent representation.
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
source§impl<T, Dst> ConvAsUtil<Dst> for T
impl<T, Dst> ConvAsUtil<Dst> for T
source§impl<T> ConvUtil for T
impl<T> ConvUtil for T
source§fn approx_as<Dst>(self) -> Result<Dst, Self::Err>where
Self: Sized + ApproxInto<Dst>,
fn approx_as<Dst>(self) -> Result<Dst, Self::Err>where
Self: Sized + ApproxInto<Dst>,
Approximate the subject to a given type with the default scheme.
source§fn approx_as_by<Dst, Scheme>(self) -> Result<Dst, Self::Err>
fn approx_as_by<Dst, Scheme>(self) -> Result<Dst, Self::Err>
Approximate the subject to a given type with a specific scheme.