Struct email::backend::pool::BackendPool

source ·
pub struct BackendPool<C: BackendContext> {
Show 20 fields pub account_config: Arc<AccountConfig>, pub pool: ThreadPool<C>, pub add_folder: Option<BackendFeature<C, dyn AddFolder>>, pub list_folders: Option<BackendFeature<C, dyn ListFolders>>, pub expunge_folder: Option<BackendFeature<C, dyn ExpungeFolder>>, pub purge_folder: Option<BackendFeature<C, dyn PurgeFolder>>, pub delete_folder: Option<BackendFeature<C, dyn DeleteFolder>>, pub get_envelope: Option<BackendFeature<C, dyn GetEnvelope>>, pub list_envelopes: Option<BackendFeature<C, dyn ListEnvelopes>>, pub watch_envelopes: Option<BackendFeature<C, dyn WatchEnvelopes>>, pub add_flags: Option<BackendFeature<C, dyn AddFlags>>, pub set_flags: Option<BackendFeature<C, dyn SetFlags>>, pub remove_flags: Option<BackendFeature<C, dyn RemoveFlags>>, pub add_message: Option<BackendFeature<C, dyn AddMessage>>, pub send_message: Option<BackendFeature<C, dyn SendMessage>>, pub peek_messages: Option<BackendFeature<C, dyn PeekMessages>>, pub get_messages: Option<BackendFeature<C, dyn GetMessages>>, pub copy_messages: Option<BackendFeature<C, dyn CopyMessages>>, pub move_messages: Option<BackendFeature<C, dyn MoveMessages>>, pub delete_messages: Option<BackendFeature<C, dyn DeleteMessages>>,
}
Expand description

The backend pool.

This implementation owns a pool of context, and backend features are executed by the first available context.

This implementation is useful when you need to call a batch of features, in parallel.

Fields§

§account_config: Arc<AccountConfig>

The account configuration.

§pool: ThreadPool<C>

The backend context pool.

§add_folder: Option<BackendFeature<C, dyn AddFolder>>

The add folder backend feature.

§list_folders: Option<BackendFeature<C, dyn ListFolders>>

The list folders backend feature.

§expunge_folder: Option<BackendFeature<C, dyn ExpungeFolder>>

The expunge folder backend feature.

§purge_folder: Option<BackendFeature<C, dyn PurgeFolder>>

The purge folder backend feature.

§delete_folder: Option<BackendFeature<C, dyn DeleteFolder>>

The delete folder backend feature.

§get_envelope: Option<BackendFeature<C, dyn GetEnvelope>>

The get envelope backend feature.

§list_envelopes: Option<BackendFeature<C, dyn ListEnvelopes>>

The list envelopes backend feature.

§watch_envelopes: Option<BackendFeature<C, dyn WatchEnvelopes>>

The watch envelopes backend feature.

§add_flags: Option<BackendFeature<C, dyn AddFlags>>

The add flags backend feature.

§set_flags: Option<BackendFeature<C, dyn SetFlags>>

The set flags backend feature.

§remove_flags: Option<BackendFeature<C, dyn RemoveFlags>>

The remove flags backend feature.

§add_message: Option<BackendFeature<C, dyn AddMessage>>

The add message backend feature.

§send_message: Option<BackendFeature<C, dyn SendMessage>>

The send message backend feature.

§peek_messages: Option<BackendFeature<C, dyn PeekMessages>>

The peek messages backend feature.

§get_messages: Option<BackendFeature<C, dyn GetMessages>>

The get messages backend feature.

§copy_messages: Option<BackendFeature<C, dyn CopyMessages>>

The copy messages backend feature.

§move_messages: Option<BackendFeature<C, dyn MoveMessages>>

The move messages backend feature.

§delete_messages: Option<BackendFeature<C, dyn DeleteMessages>>

The delete messages backend feature.

Trait Implementations§

source§

impl<C: BackendContext + 'static> AddFlags for BackendPool<C>

source§

fn add_flags<'life0, 'life1, 'life2, 'life3, 'async_trait>( &'life0 self, folder: &'life1 str, id: &'life2 Id, flags: &'life3 Flags ) -> Pin<Box<dyn Future<Output = AnyResult<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait,

Add the given flags to envelope(s) matching the given id from the given folder.
source§

fn add_flag<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, folder: &'life1 str, id: &'life2 Id, flag: Flag ) -> Pin<Box<dyn Future<Output = AnyResult<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Add the given flag to envelope(s) matching the given id from the given folder.
source§

impl<C: BackendContext + 'static> AddFolder for BackendPool<C>

source§

fn add_folder<'life0, 'life1, 'async_trait>( &'life0 self, folder: &'life1 str ) -> Pin<Box<dyn Future<Output = AnyResult<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Create the given folder.
source§

impl<C: BackendContext + 'static> AddMessage for BackendPool<C>

source§

fn add_message_with_flags<'life0, 'life1, 'life2, 'life3, 'async_trait>( &'life0 self, folder: &'life1 str, msg: &'life2 [u8], flags: &'life3 Flags ) -> Pin<Box<dyn Future<Output = AnyResult<SingleId>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait,

Add the given raw email message with the given flags to the given folder.
source§

fn add_message_with_flag<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, folder: &'life1 str, msg: &'life2 [u8], flag: Flag ) -> Pin<Box<dyn Future<Output = AnyResult<SingleId>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Add the given raw email message with the given flag to the given folder.
source§

fn add_message<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, folder: &'life1 str, msg: &'life2 [u8] ) -> Pin<Box<dyn Future<Output = AnyResult<SingleId>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Add the given raw email message to the given folder.
source§

impl<CB> AsyncTryIntoBackendFeatures<BackendPool<<CB as BackendContextBuilder>::Context>> for BackendBuilder<CB>
where CB: BackendContextBuilder + 'static,

source§

fn try_into_backend<'async_trait>( self ) -> Pin<Box<dyn Future<Output = AnyResult<BackendPool<CB::Context>>> + Send + 'async_trait>>
where Self: 'async_trait,

source§

impl<C: BackendContext + 'static> CopyMessages for BackendPool<C>

source§

fn copy_messages<'life0, 'life1, 'life2, 'life3, 'async_trait>( &'life0 self, from_folder: &'life1 str, to_folder: &'life2 str, id: &'life3 Id ) -> Pin<Box<dyn Future<Output = AnyResult<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait,

Copy emails from the given folder to the given folder matching the given id.
source§

impl<C: BackendContext + 'static> DeleteFolder for BackendPool<C>

source§

fn delete_folder<'life0, 'life1, 'async_trait>( &'life0 self, folder: &'life1 str ) -> Pin<Box<dyn Future<Output = AnyResult<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Definitely delete the given folder. Read more
source§

impl<C: BackendContext + 'static> DeleteMessages for BackendPool<C>

source§

fn delete_messages<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, folder: &'life1 str, id: &'life2 Id ) -> Pin<Box<dyn Future<Output = AnyResult<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Delete messages from the given folder matching the given envelope id(s). Read more
source§

impl<C: BackendContext + 'static> ExpungeFolder for BackendPool<C>

source§

fn expunge_folder<'life0, 'life1, 'async_trait>( &'life0 self, folder: &'life1 str ) -> Pin<Box<dyn Future<Output = AnyResult<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Expunge the given folder. Read more
source§

impl<C: BackendContext + 'static> GetEnvelope for BackendPool<C>

source§

fn get_envelope<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, folder: &'life1 str, id: &'life2 Id ) -> Pin<Box<dyn Future<Output = AnyResult<Envelope>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Get the envelope from the given folder matching the given id.
source§

impl<C: BackendContext + 'static> GetMessages for BackendPool<C>

source§

fn get_messages<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, folder: &'life1 str, id: &'life2 Id ) -> Pin<Box<dyn Future<Output = AnyResult<Messages>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Get email messages from the given folder matching the given ids. Read more
source§

impl<C: BackendContext> HasAccountConfig for BackendPool<C>

source§

impl<C: BackendContext + 'static> ListEnvelopes for BackendPool<C>

source§

fn list_envelopes<'life0, 'life1, 'async_trait>( &'life0 self, folder: &'life1 str, opts: ListEnvelopesOptions ) -> Pin<Box<dyn Future<Output = AnyResult<Envelopes>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

List all available envelopes from the given folder matching the given pagination.
source§

impl<C: BackendContext + 'static> ListFolders for BackendPool<C>

source§

fn list_folders<'life0, 'async_trait>( &'life0 self ) -> Pin<Box<dyn Future<Output = AnyResult<Folders>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

List all available folders (alias mailboxes).
source§

impl<C: BackendContext + 'static> MoveMessages for BackendPool<C>

source§

fn move_messages<'life0, 'life1, 'life2, 'life3, 'async_trait>( &'life0 self, from_folder: &'life1 str, to_folder: &'life2 str, id: &'life3 Id ) -> Pin<Box<dyn Future<Output = AnyResult<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait,

Move emails from the given folder to the given folder matching the given id.
source§

impl<C: BackendContext + 'static> PeekMessages for BackendPool<C>

source§

fn peek_messages<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, folder: &'life1 str, id: &'life2 Id ) -> Pin<Box<dyn Future<Output = AnyResult<Messages>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Peek email messages from the given folder matching the given ids. Read more
source§

impl<C: BackendContext + 'static> PurgeFolder for BackendPool<C>

source§

fn purge_folder<'life0, 'life1, 'async_trait>( &'life0 self, folder: &'life1 str ) -> Pin<Box<dyn Future<Output = AnyResult<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Purge the given folder. Read more
source§

impl<C: BackendContext + 'static> RemoveFlags for BackendPool<C>

source§

fn remove_flags<'life0, 'life1, 'life2, 'life3, 'async_trait>( &'life0 self, folder: &'life1 str, id: &'life2 Id, flags: &'life3 Flags ) -> Pin<Box<dyn Future<Output = AnyResult<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait,

Remove the given flags from envelope(s) matching the given id from the given folder.
source§

fn remove_flag<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, folder: &'life1 str, id: &'life2 Id, flag: Flag ) -> Pin<Box<dyn Future<Output = AnyResult<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Remove the given flag from envelope(s) matching the given id from the given folder.
source§

impl<C: BackendContext + 'static> SendMessage for BackendPool<C>

source§

fn send_message<'life0, 'life1, 'async_trait>( &'life0 self, msg: &'life1 [u8] ) -> Pin<Box<dyn Future<Output = AnyResult<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Send the given raw email message.
source§

impl<C: BackendContext + 'static> SetFlags for BackendPool<C>

source§

fn set_flags<'life0, 'life1, 'life2, 'life3, 'async_trait>( &'life0 self, folder: &'life1 str, id: &'life2 Id, flags: &'life3 Flags ) -> Pin<Box<dyn Future<Output = AnyResult<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait,

Set the given flags to envelope(s) matching the given id from the given folder. Read more
source§

fn set_flag<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, folder: &'life1 str, id: &'life2 Id, flag: Flag ) -> Pin<Box<dyn Future<Output = AnyResult<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Set the given flag to envelope(s) matching the given id from the given folder. Read more
source§

impl<C: BackendContext + 'static> WatchEnvelopes for BackendPool<C>

source§

fn watch_envelopes<'life0, 'life1, 'async_trait>( &'life0 self, folder: &'life1 str ) -> Pin<Box<dyn Future<Output = AnyResult<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Watch the given folder for envelopes changes.
source§

fn exec_hooks<'life0, 'life1, 'life2, 'life3, 'async_trait>( &'life0 self, config: &'life1 AccountConfig, prev_envelopes: &'life2 HashMap<String, Envelope>, next_envelopes: &'life3 HashMap<String, Envelope> ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait,

Auto Trait Implementations§

§

impl<C> Freeze for BackendPool<C>
where C: Sync + Send,

§

impl<C> !RefUnwindSafe for BackendPool<C>

§

impl<C> Send for BackendPool<C>
where C: Sync + Send,

§

impl<C> Sync for BackendPool<C>
where C: Sync + Send,

§

impl<C> Unpin for BackendPool<C>
where C: Sync + Send,

§

impl<C> !UnwindSafe for BackendPool<C>

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<Src, Scheme> ApproxFrom<Src, Scheme> for Src
where Scheme: ApproxScheme,

§

type Err = NoError

The error type produced by a failed conversion.
source§

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 Src
where Dst: ApproxFrom<Src, Scheme>, Scheme: ApproxScheme,

§

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>

Convert the subject into an approximately equivalent representation.
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T, Dst> ConvAsUtil<Dst> for T

source§

fn approx(self) -> Result<Dst, Self::Err>
where Self: Sized + ApproxInto<Dst>,

Approximate the subject with the default scheme.
source§

fn approx_by<Scheme>(self) -> Result<Dst, Self::Err>
where Self: Sized + ApproxInto<Dst, Scheme>, Scheme: ApproxScheme,

Approximate the subject with a specific scheme.
source§

impl<T> ConvUtil for T

source§

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>
where Self: Sized + ApproxInto<Dst, Scheme>, Scheme: ApproxScheme,

Approximate the subject to a given type with a specific scheme.
source§

fn into_as<Dst>(self) -> Dst
where Self: Sized + Into<Dst>,

Convert the subject to a given type.
source§

fn try_as<Dst>(self) -> Result<Dst, Self::Err>
where Self: Sized + TryInto<Dst>,

Attempt to convert the subject to a given type.
source§

fn value_as<Dst>(self) -> Result<Dst, Self::Err>
where Self: Sized + ValueInto<Dst>,

Attempt a value conversion of the subject to a given type.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T> Instrument for T

source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> Pointable for T

source§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> SendMessageThenSaveCopy for T

source§

fn send_message_then_save_copy<'life0, 'life1, 'async_trait>( &'life0 self, msg: &'life1 [u8] ) -> Pin<Box<dyn Future<Output = AnyResult<()>> + Send + 'async_trait>>
where Self: Sync + 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Send the given raw email message, then save a copy to the Sent folder.
source§

impl<Src> TryFrom<Src> for Src

§

type Err = NoError

The error type produced by a failed conversion.
source§

fn try_from(src: Src) -> Result<Src, <Src as TryFrom<Src>>::Err>

Convert the given value into the subject type.
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<Src, Dst> TryInto<Dst> for Src
where Dst: TryFrom<Src>,

§

type Err = <Dst as TryFrom<Src>>::Err

The error type produced by a failed conversion.
source§

fn try_into(self) -> Result<Dst, <Src as TryInto<Dst>>::Err>

Convert the subject into the destination type.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

source§

fn vzip(self) -> V

source§

impl<Src> ValueFrom<Src> for Src

§

type Err = NoError

The error type produced by a failed conversion.
source§

fn value_from(src: Src) -> Result<Src, <Src as ValueFrom<Src>>::Err>

Convert the given value into an exactly equivalent representation.
source§

impl<Src, Dst> ValueInto<Dst> for Src
where Dst: ValueFrom<Src>,

§

type Err = <Dst as ValueFrom<Src>>::Err

The error type produced by a failed conversion.
source§

fn value_into(self) -> Result<Dst, <Src as ValueInto<Dst>>::Err>

Convert the subject into an exactly equivalent representation.
source§

impl<T> WithSubscriber for T

source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

impl<T> BackendFeatures for T

source§

impl<T> MaybeSync for T