pub struct Messages { /* private fields */ }
Expand description
The self-referencing struct.
Implementations§
source§impl Messages
impl Messages
sourcepub(super) fn new(
raw: RawMessages,
emails_builder: impl for<'this> FnOnce(&'this mut RawMessages) -> Vec<Message<'this>>
) -> Messages
pub(super) fn new( raw: RawMessages, emails_builder: impl for<'this> FnOnce(&'this mut RawMessages) -> Vec<Message<'this>> ) -> Messages
Constructs a new instance of this self-referential struct. (See also MessagesBuilder::build()
). Each argument is a field of the new struct. Fields that refer to other fields inside the struct are initialized using functions instead of directly passing their value. The arguments are as follows:
Argument | Suggested Use |
---|---|
raw | Directly pass in the value this field should contain |
emails_builder | Use a function or closure: (raw: &mut _) -> emails: _ |
sourcepub(super) async fn new_async(
raw: RawMessages,
emails_builder: impl for<'this> FnOnce(&'this mut RawMessages) -> Pin<Box<dyn Future<Output = Vec<Message<'this>>> + 'this>>
) -> Messages
pub(super) async fn new_async( raw: RawMessages, emails_builder: impl for<'this> FnOnce(&'this mut RawMessages) -> Pin<Box<dyn Future<Output = Vec<Message<'this>>> + 'this>> ) -> Messages
Constructs a new instance of this self-referential struct. (See also MessagesAsyncBuilder::build()
). Each argument is a field of the new struct. Fields that refer to other fields inside the struct are initialized using functions instead of directly passing their value. The arguments are as follows:
Argument | Suggested Use |
---|---|
raw | Directly pass in the value this field should contain |
emails_builder | Use a function or closure: (raw: &mut _) -> emails: _ |
sourcepub(super) async fn new_async_send(
raw: RawMessages,
emails_builder: impl for<'this> FnOnce(&'this mut RawMessages) -> Pin<Box<dyn Future<Output = Vec<Message<'this>>> + Send + 'this>>
) -> Messages
pub(super) async fn new_async_send( raw: RawMessages, emails_builder: impl for<'this> FnOnce(&'this mut RawMessages) -> Pin<Box<dyn Future<Output = Vec<Message<'this>>> + Send + 'this>> ) -> Messages
Constructs a new instance of this self-referential struct. (See also MessagesAsyncSendBuilder::build()
). Each argument is a field of the new struct. Fields that refer to other fields inside the struct are initialized using functions instead of directly passing their value. The arguments are as follows:
Argument | Suggested Use |
---|---|
raw | Directly pass in the value this field should contain |
emails_builder | Use a function or closure: (raw: &mut _) -> emails: _ |
sourcepub(super) fn try_new<Error_>(
raw: RawMessages,
emails_builder: impl for<'this> FnOnce(&'this mut RawMessages) -> Result<Vec<Message<'this>>, Error_>
) -> Result<Messages, Error_>
pub(super) fn try_new<Error_>( raw: RawMessages, emails_builder: impl for<'this> FnOnce(&'this mut RawMessages) -> Result<Vec<Message<'this>>, Error_> ) -> Result<Messages, Error_>
(See also MessagesTryBuilder::try_build()
.) Like new
, but builders for self-referencing fields can return results. If any of them fail, Err
is returned. If all of them succeed, Ok
is returned. The arguments are as follows:
Argument | Suggested Use |
---|---|
raw | Directly pass in the value this field should contain |
emails_builder | Use a function or closure: (raw: &mut _) -> Result<emails: _, Error_> |
sourcepub(super) fn try_new_or_recover<Error_>(
raw: RawMessages,
emails_builder: impl for<'this> FnOnce(&'this mut RawMessages) -> Result<Vec<Message<'this>>, Error_>
) -> Result<Messages, (Error_, Heads)>
pub(super) fn try_new_or_recover<Error_>( raw: RawMessages, emails_builder: impl for<'this> FnOnce(&'this mut RawMessages) -> Result<Vec<Message<'this>>, Error_> ) -> Result<Messages, (Error_, Heads)>
(See also MessagesTryBuilder::try_build_or_recover()
.) Like try_new
, but all head fields are returned in the case of an error. The arguments are as follows:
Argument | Suggested Use |
---|---|
raw | Directly pass in the value this field should contain |
emails_builder | Use a function or closure: (raw: &mut _) -> Result<emails: _, Error_> |
sourcepub(super) async fn try_new_async<Error_>(
raw: RawMessages,
emails_builder: impl for<'this> FnOnce(&'this mut RawMessages) -> Pin<Box<dyn Future<Output = Result<Vec<Message<'this>>, Error_>> + 'this>>
) -> Result<Messages, Error_>
pub(super) async fn try_new_async<Error_>( raw: RawMessages, emails_builder: impl for<'this> FnOnce(&'this mut RawMessages) -> Pin<Box<dyn Future<Output = Result<Vec<Message<'this>>, Error_>> + 'this>> ) -> Result<Messages, Error_>
(See also MessagesAsyncTryBuilder::try_build()
.) Like new
, but builders for self-referencing fields can return results. If any of them fail, Err
is returned. If all of them succeed, Ok
is returned. The arguments are as follows:
Argument | Suggested Use |
---|---|
raw | Directly pass in the value this field should contain |
emails_builder | Use a function or closure: (raw: &mut _) -> Result<emails: _, Error_> |
sourcepub(super) async fn try_new_or_recover_async<Error_>(
raw: RawMessages,
emails_builder: impl for<'this> FnOnce(&'this mut RawMessages) -> Pin<Box<dyn Future<Output = Result<Vec<Message<'this>>, Error_>> + 'this>>
) -> Result<Messages, (Error_, Heads)>
pub(super) async fn try_new_or_recover_async<Error_>( raw: RawMessages, emails_builder: impl for<'this> FnOnce(&'this mut RawMessages) -> Pin<Box<dyn Future<Output = Result<Vec<Message<'this>>, Error_>> + 'this>> ) -> Result<Messages, (Error_, Heads)>
(See also MessagesAsyncTryBuilder::try_build_or_recover()
.) Like try_new
, but all head fields are returned in the case of an error. The arguments are as follows:
Argument | Suggested Use |
---|---|
raw | Directly pass in the value this field should contain |
emails_builder | Use a function or closure: (raw: &mut _) -> Result<emails: _, Error_> |
sourcepub(super) async fn try_new_async_send<Error_>(
raw: RawMessages,
emails_builder: impl for<'this> FnOnce(&'this mut RawMessages) -> Pin<Box<dyn Future<Output = Result<Vec<Message<'this>>, Error_>> + Send + 'this>>
) -> Result<Messages, Error_>
pub(super) async fn try_new_async_send<Error_>( raw: RawMessages, emails_builder: impl for<'this> FnOnce(&'this mut RawMessages) -> Pin<Box<dyn Future<Output = Result<Vec<Message<'this>>, Error_>> + Send + 'this>> ) -> Result<Messages, Error_>
(See also MessagesAsyncSendTryBuilder::try_build()
.) Like new
, but builders for self-referencing fields can return results. If any of them fail, Err
is returned. If all of them succeed, Ok
is returned. The arguments are as follows:
Argument | Suggested Use |
---|---|
raw | Directly pass in the value this field should contain |
emails_builder | Use a function or closure: (raw: &mut _) -> Result<emails: _, Error_> |
sourcepub(super) async fn try_new_or_recover_async_send<Error_>(
raw: RawMessages,
emails_builder: impl for<'this> FnOnce(&'this mut RawMessages) -> Pin<Box<dyn Future<Output = Result<Vec<Message<'this>>, Error_>> + Send + 'this>>
) -> Result<Messages, (Error_, Heads)>
pub(super) async fn try_new_or_recover_async_send<Error_>( raw: RawMessages, emails_builder: impl for<'this> FnOnce(&'this mut RawMessages) -> Pin<Box<dyn Future<Output = Result<Vec<Message<'this>>, Error_>> + Send + 'this>> ) -> Result<Messages, (Error_, Heads)>
(See also MessagesAsyncSendTryBuilder::try_build_or_recover()
.) Like try_new
, but all head fields are returned in the case of an error. The arguments are as follows:
Argument | Suggested Use |
---|---|
raw | Directly pass in the value this field should contain |
emails_builder | Use a function or closure: (raw: &mut _) -> Result<emails: _, Error_> |
sourcepub(super) fn with_emails<'outer_borrow, ReturnType>(
&'outer_borrow self,
user: impl for<'this> FnOnce(&'outer_borrow Vec<Message<'this>>) -> ReturnType
) -> ReturnType
pub(super) fn with_emails<'outer_borrow, ReturnType>( &'outer_borrow self, user: impl for<'this> FnOnce(&'outer_borrow Vec<Message<'this>>) -> ReturnType ) -> ReturnType
Provides an immutable reference to emails
. This method was generated because emails
is a tail field.
sourcepub(super) fn borrow_emails<'this>(&'this self) -> &'this Vec<Message<'this>>
pub(super) fn borrow_emails<'this>(&'this self) -> &'this Vec<Message<'this>>
Provides an immutable reference to emails
. This method was generated because emails
is a tail field.
sourcepub(super) fn with_emails_mut<'outer_borrow, ReturnType>(
&'outer_borrow mut self,
user: impl for<'this> FnOnce(&'outer_borrow mut Vec<Message<'this>>) -> ReturnType
) -> ReturnType
pub(super) fn with_emails_mut<'outer_borrow, ReturnType>( &'outer_borrow mut self, user: impl for<'this> FnOnce(&'outer_borrow mut Vec<Message<'this>>) -> ReturnType ) -> ReturnType
Provides a mutable reference to emails
. This method was generated because emails
is a tail field. No borrow_emails_mut
function was generated because Rust’s borrow checker is currently unable to guarantee that such a method would be used safely.
sourcepub(super) fn with<'outer_borrow, ReturnType>(
&'outer_borrow self,
user: impl for<'this> FnOnce(BorrowedFields<'outer_borrow, 'this>) -> ReturnType
) -> ReturnType
pub(super) fn with<'outer_borrow, ReturnType>( &'outer_borrow self, user: impl for<'this> FnOnce(BorrowedFields<'outer_borrow, 'this>) -> ReturnType ) -> ReturnType
This method provides immutable references to all tail and immutably borrowed fields.
sourcepub(super) fn with_mut<'outer_borrow, ReturnType>(
&'outer_borrow mut self,
user: impl for<'this> FnOnce(BorrowedMutFields<'outer_borrow, 'this>) -> ReturnType
) -> ReturnType
pub(super) fn with_mut<'outer_borrow, ReturnType>( &'outer_borrow mut self, user: impl for<'this> FnOnce(BorrowedMutFields<'outer_borrow, 'this>) -> ReturnType ) -> ReturnType
This method provides mutable references to all tail fields.
sourcepub(super) fn into_heads(self) -> Heads
pub(super) fn into_heads(self) -> Heads
This function drops all internally referencing fields and returns only the head fields of this struct.