pub struct PriorityConfig {
pub default_priority: Priority,
pub sender_priorities: HashMap<String, Priority>,
pub recipient_priorities: HashMap<String, Priority>,
pub domain_priorities: HashMap<String, Priority>,
pub inherit_priority_on_retry: bool,
pub boost_after_attempts: Option<u32>,
pub boost_amount: u8,
}Expand description
Configuration for priority assignment rules
Fields§
§default_priority: PriorityDefault priority if no rules match
sender_priorities: HashMap<String, Priority>Sender-based priority rules (email -> priority)
recipient_priorities: HashMap<String, Priority>Recipient-based priority rules (email -> priority)
domain_priorities: HashMap<String, Priority>Domain-based priority rules (domain -> priority)
inherit_priority_on_retry: boolEnable priority inheritance for retries
boost_after_attempts: Option<u32>Boost priority after N failed attempts
boost_amount: u8Priority boost amount (e.g., Low -> Normal)
Implementations§
Source§impl PriorityConfig
impl PriorityConfig
Sourcepub fn add_sender_priority(
&mut self,
sender: impl Into<String>,
priority: Priority,
)
pub fn add_sender_priority( &mut self, sender: impl Into<String>, priority: Priority, )
Add sender priority rule
Sourcepub fn add_recipient_priority(
&mut self,
recipient: impl Into<String>,
priority: Priority,
)
pub fn add_recipient_priority( &mut self, recipient: impl Into<String>, priority: Priority, )
Add recipient priority rule
Sourcepub fn add_domain_priority(
&mut self,
domain: impl Into<String>,
priority: Priority,
)
pub fn add_domain_priority( &mut self, domain: impl Into<String>, priority: Priority, )
Add domain priority rule
Sourcepub fn calculate_priority(&self, mail: &Mail, current_attempts: u32) -> Priority
pub fn calculate_priority(&self, mail: &Mail, current_attempts: u32) -> Priority
Calculate priority for a mail based on configured rules
Trait Implementations§
Source§impl Clone for PriorityConfig
impl Clone for PriorityConfig
Source§fn clone(&self) -> PriorityConfig
fn clone(&self) -> PriorityConfig
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for PriorityConfig
impl Debug for PriorityConfig
Source§impl Default for PriorityConfig
impl Default for PriorityConfig
Source§impl<'de> Deserialize<'de> for PriorityConfig
impl<'de> Deserialize<'de> for PriorityConfig
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for PriorityConfig
impl RefUnwindSafe for PriorityConfig
impl Send for PriorityConfig
impl Sync for PriorityConfig
impl Unpin for PriorityConfig
impl UnsafeUnpin for PriorityConfig
impl UnwindSafe for PriorityConfig
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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
Source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
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>
Converts
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>
Converts
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 moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request