pub struct Backend<C>where
C: BackendContext,{Show 22 fields
pub account_config: Arc<AccountConfig>,
pub context: Arc<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 thread_envelopes: Option<BackendFeature<C, dyn ThreadEnvelopes>>,
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>>,
pub remove_messages: Option<BackendFeature<C, dyn RemoveMessages>>,
}
Expand description
The basic backend implementation.
This is the most primitive backend implementation: it owns its context, and backend features are directly called from it.
This implementation is useful when you need to call features in
serie. If you need to call features in batch (parallel), see the
[pool::BackendPool
] implementation instead.
Fields§
§account_config: Arc<AccountConfig>
The account configuration.
context: Arc<C>
The backend context.
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.
thread_envelopes: Option<BackendFeature<C, dyn ThreadEnvelopes>>
The thread 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.
remove_messages: Option<BackendFeature<C, dyn RemoveMessages>>
The delete messages backend feature.
Trait Implementations§
Source§impl<C: BackendContext> AddFlags for Backend<C>
impl<C: BackendContext> AddFlags for Backend<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,
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,
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,
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,
Source§impl<C: BackendContext> AddFolder for Backend<C>
impl<C: BackendContext> AddFolder for Backend<C>
Source§impl<C: BackendContext> AddMessage for Backend<C>
impl<C: BackendContext> AddMessage for Backend<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,
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,
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,
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,
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,
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,
Source§impl<C: BackendContext> CopyMessages for Backend<C>
impl<C: BackendContext> CopyMessages for Backend<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,
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,
Source§impl<C: BackendContext> DeleteFolder for Backend<C>
impl<C: BackendContext> DeleteFolder for Backend<C>
Source§impl<C: BackendContext> DeleteMessages for Backend<C>
impl<C: BackendContext> DeleteMessages for Backend<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,
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,
Source§impl<C: BackendContext> ExpungeFolder for Backend<C>
impl<C: BackendContext> ExpungeFolder for Backend<C>
Source§impl<C: BackendContext> GetEnvelope for Backend<C>
impl<C: BackendContext> GetEnvelope for Backend<C>
Source§fn get_envelope<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
folder: &'life1 str,
id: &'life2 SingleId,
) -> Pin<Box<dyn Future<Output = AnyResult<Envelope>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn get_envelope<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
folder: &'life1 str,
id: &'life2 SingleId,
) -> Pin<Box<dyn Future<Output = AnyResult<Envelope>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Source§impl<C: BackendContext> GetMessages for Backend<C>
impl<C: BackendContext> GetMessages for Backend<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,
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,
Source§impl<C: BackendContext> HasAccountConfig for Backend<C>
impl<C: BackendContext> HasAccountConfig for Backend<C>
fn account_config(&self) -> &AccountConfig
Source§impl<C: BackendContext> ListEnvelopes for Backend<C>
impl<C: BackendContext> ListEnvelopes for Backend<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,
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,
Source§impl<C: BackendContext> ListFolders for Backend<C>
impl<C: BackendContext> ListFolders for Backend<C>
Source§impl<C: BackendContext> MoveMessages for Backend<C>
impl<C: BackendContext> MoveMessages for Backend<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,
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,
Source§impl<C: BackendContext> PeekMessages for Backend<C>
impl<C: BackendContext> PeekMessages for Backend<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,
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,
Source§impl<C: BackendContext> PurgeFolder for Backend<C>
impl<C: BackendContext> PurgeFolder for Backend<C>
Source§impl<C: BackendContext> RemoveFlags for Backend<C>
impl<C: BackendContext> RemoveFlags for Backend<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,
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,
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,
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,
Source§impl<C: BackendContext> RemoveMessages for Backend<C>
impl<C: BackendContext> RemoveMessages for Backend<C>
Source§fn remove_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,
fn remove_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,
Source§impl<C: BackendContext> SendMessage for Backend<C>
impl<C: BackendContext> SendMessage for Backend<C>
Source§impl<C: BackendContext> SetFlags for Backend<C>
impl<C: BackendContext> SetFlags for Backend<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,
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,
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,
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,
Source§impl<C: BackendContext> ThreadEnvelopes for Backend<C>
impl<C: BackendContext> ThreadEnvelopes for Backend<C>
Source§fn thread_envelopes<'life0, 'life1, 'async_trait>(
&'life0 self,
folder: &'life1 str,
opts: ListEnvelopesOptions,
) -> Pin<Box<dyn Future<Output = AnyResult<ThreadedEnvelopes>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn thread_envelopes<'life0, 'life1, 'async_trait>(
&'life0 self,
folder: &'life1 str,
opts: ListEnvelopesOptions,
) -> Pin<Box<dyn Future<Output = AnyResult<ThreadedEnvelopes>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn thread_envelope<'life0, 'life1, 'async_trait>(
&'life0 self,
folder: &'life1 str,
id: SingleId,
opts: ListEnvelopesOptions,
) -> Pin<Box<dyn Future<Output = AnyResult<ThreadedEnvelopes>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Source§impl<C: BackendContext> WatchEnvelopes for Backend<C>
impl<C: BackendContext> WatchEnvelopes for Backend<C>
Source§fn watch_envelopes<'life0, 'life1, 'async_trait>(
&'life0 self,
folder: &'life1 str,
wait_for_shutdown_request: Receiver<()>,
shutdown: Sender<()>,
) -> Pin<Box<dyn Future<Output = AnyResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn watch_envelopes<'life0, 'life1, 'async_trait>(
&'life0 self,
folder: &'life1 str,
wait_for_shutdown_request: Receiver<()>,
shutdown: Sender<()>,
) -> Pin<Box<dyn Future<Output = AnyResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
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 Backend<C>
impl<C> !RefUnwindSafe for Backend<C>
impl<C> Send for Backend<C>
impl<C> Sync for Backend<C>
impl<C> Unpin for Backend<C>
impl<C> !UnwindSafe for Backend<C>
Blanket Implementations§
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more