pub trait GetBackendSubcontext<C: BackendContext> {
    // Required method
    fn get_subcontext(&self) -> &C;
}
Expand description

Get a context in a context.

A good use case is when you have a custom backend context composed of multiple subcontexts:

struct MyContext {
    imap: email::imap::ImapContextSync,
    smtp: email::smtp::SmtpContextSync,
}

If your context is composed of optional subcontexts, use FindBackendSubcontext instead.

Required Methods§

Implementors§

source§

impl<C: BackendContext> GetBackendSubcontext<C> for C

Generic implementation for contexts that match themselves as subcontext.