Trait mail_core::context::MailIdGenComponent
source · pub trait MailIdGenComponent: Debug + Send + Sync + 'static {
fn generate_message_id(&self) -> MessageId;
fn generate_content_id(&self) -> ContentId;
}
Expand description
Trait needed to be implemented for providing the id generation parts to a CompositeContext
.
It is possible/valid to use the same implementation (internal function etc.) for both message and content ids. While they are used at different places they have mostly the same constraints (their meaning is still different i.e. it’s much more important for an message id to be “world unique” then for an content id, expect in some cases where external bodies are used).
Required Methods
sourcefn generate_message_id(&self) -> MessageId
fn generate_message_id(&self) -> MessageId
Calls to Context::generate_message_id
will be forwarded to this method.
sourcefn generate_content_id(&self) -> ContentId
fn generate_content_id(&self) -> ContentId
Calls to Context::generate_content_id
will be forwarded to this method.
Implementors
impl MailIdGenComponent for HashedIdGen
impl<C> MailIdGenComponent for Cwhere
C: Context,
Allows using a part of an context as an component.