Struct email::email::message::ouroboros_impl_messages::MessagesAsyncBuilder
source · pub(super) struct MessagesAsyncBuilder<EmailsBuilder_: for<'this> FnOnce(&'this mut RawMessages) -> Pin<Box<dyn Future<Output = Vec<Message<'this>>> + 'this>>> {
pub(super) raw: RawMessages,
pub(super) emails_builder: EmailsBuilder_,
}
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 |
emails_builder | Use a function or closure: (raw: &mut _) -> emails: _ |
Fields§
§raw: RawMessages
§emails_builder: EmailsBuilder_
Implementations§
source§impl<EmailsBuilder_: for<'this> FnOnce(&'this mut RawMessages) -> Pin<Box<dyn Future<Output = Vec<Message<'this>>> + 'this>>> MessagesAsyncBuilder<EmailsBuilder_>
impl<EmailsBuilder_: for<'this> FnOnce(&'this mut RawMessages) -> Pin<Box<dyn Future<Output = Vec<Message<'this>>> + 'this>>> MessagesAsyncBuilder<EmailsBuilder_>
sourcepub(super) async fn build(self) -> Messages
pub(super) async fn build(self) -> Messages
Calls Messages::new()
using the provided values. This is preferrable over calling new()
directly for the reasons listed above.
Auto Trait Implementations§
impl<EmailsBuilder_> Freeze for MessagesAsyncBuilder<EmailsBuilder_>where
EmailsBuilder_: Freeze,
impl<EmailsBuilder_> RefUnwindSafe for MessagesAsyncBuilder<EmailsBuilder_>where
EmailsBuilder_: RefUnwindSafe,
impl<EmailsBuilder_> Send for MessagesAsyncBuilder<EmailsBuilder_>where
EmailsBuilder_: Send,
impl<EmailsBuilder_> Sync for MessagesAsyncBuilder<EmailsBuilder_>where
EmailsBuilder_: Sync,
impl<EmailsBuilder_> Unpin for MessagesAsyncBuilder<EmailsBuilder_>where
EmailsBuilder_: Unpin,
impl<EmailsBuilder_> UnwindSafe for MessagesAsyncBuilder<EmailsBuilder_>where
EmailsBuilder_: 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.