pub struct EmailJob {
pub email: Email,
pub priority: EmailPriority,
pub max_retries: u32,
pub timeout_seconds: u64,
pub provider: Option<String>,
pub metadata: HashMap<String, String>,
}Expand description
Email job for background processing
Fields§
§email: EmailThe email to be sent
priority: EmailPriorityJob priority
max_retries: u32Maximum retry attempts
timeout_seconds: u64Job timeout
provider: Option<String>Provider to use for sending (optional, uses default if None)
metadata: HashMap<String, String>Additional metadata
Implementations§
Source§impl EmailJob
impl EmailJob
Sourcepub fn with_priority(self, priority: EmailPriority) -> Self
pub fn with_priority(self, priority: EmailPriority) -> Self
Set job priority
Sourcepub fn with_max_retries(self, max_retries: u32) -> Self
pub fn with_max_retries(self, max_retries: u32) -> Self
Set maximum retry attempts
Sourcepub fn with_timeout(self, timeout: Duration) -> Self
pub fn with_timeout(self, timeout: Duration) -> Self
Set job timeout
Sourcepub fn with_provider(self, provider: String) -> Self
pub fn with_provider(self, provider: String) -> Self
Set specific provider to use
Sourcepub fn with_metadata(self, key: String, value: String) -> Self
pub fn with_metadata(self, key: String, value: String) -> Self
Add metadata
Trait Implementations§
Source§impl<'de> Deserialize<'de> for EmailJob
impl<'de> Deserialize<'de> for EmailJob
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
Source§impl Job for EmailJob
impl Job for EmailJob
Source§fn execute<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = JobResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn execute<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = JobResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Execute the job
Source§fn max_retries(&self) -> u32
fn max_retries(&self) -> u32
Get maximum number of retry attempts (default: 3)
Source§fn retry_delay(&self, attempt: u32) -> Duration
fn retry_delay(&self, attempt: u32) -> Duration
Get retry delay (default: exponential backoff starting at 1 second)
Auto Trait Implementations§
impl Freeze for EmailJob
impl RefUnwindSafe for EmailJob
impl Send for EmailJob
impl Sync for EmailJob
impl Unpin for EmailJob
impl UnwindSafe for EmailJob
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