Struct sqlxmq::JobBuilder
source · pub struct JobBuilder<'a> { /* private fields */ }
Expand description
Type for building a job to send.
Implementations§
source§impl<'a> JobBuilder<'a>
impl<'a> JobBuilder<'a>
sourcepub fn new_with_id(id: Uuid, name: &'a str) -> Self
pub fn new_with_id(id: Uuid, name: &'a str) -> Self
Prepare to send a job with the specified name and ID.
sourcepub fn set_proto<'b>(
&'b mut self,
proto: impl FnOnce(&'b mut Self) -> &'b mut Self
) -> &'b mut Self
pub fn set_proto<'b>( &'b mut self, proto: impl FnOnce(&'b mut Self) -> &'b mut Self ) -> &'b mut Self
Use the provided function to set any number of configuration options at once.
sourcepub fn set_channel_name(&mut self, channel_name: &'a str) -> &mut Self
pub fn set_channel_name(&mut self, channel_name: &'a str) -> &mut Self
Set the channel name (default “”).
sourcepub fn set_channel_args(&mut self, channel_args: &'a str) -> &mut Self
pub fn set_channel_args(&mut self, channel_args: &'a str) -> &mut Self
Set the channel arguments (default “”).
sourcepub fn set_retries(&mut self, retries: u32) -> &mut Self
pub fn set_retries(&mut self, retries: u32) -> &mut Self
Set the number of retries after the initial attempt (default 4).
sourcepub fn set_retry_backoff(&mut self, retry_backoff: Duration) -> &mut Self
pub fn set_retry_backoff(&mut self, retry_backoff: Duration) -> &mut Self
Set the initial backoff for retries (default 1s).
sourcepub fn set_commit_interval(
&mut self,
commit_interval: Option<Duration>
) -> &mut Self
pub fn set_commit_interval( &mut self, commit_interval: Option<Duration> ) -> &mut Self
Set the commit interval for two-phase commit (default disabled).
sourcepub fn set_ordered(&mut self, ordered: bool) -> &mut Self
pub fn set_ordered(&mut self, ordered: bool) -> &mut Self
Set whether this job is strictly ordered with respect to other ordered job in the same channel (default false).
sourcepub fn set_delay(&mut self, delay: Duration) -> &mut Self
pub fn set_delay(&mut self, delay: Duration) -> &mut Self
Set a delay before this job is executed (default none).
sourcepub fn set_raw_json(&mut self, raw_json: &'a str) -> &mut Self
pub fn set_raw_json(&mut self, raw_json: &'a str) -> &mut Self
Set a raw JSON payload for the job.
sourcepub fn set_raw_bytes(&mut self, raw_bytes: &'a [u8]) -> &mut Self
pub fn set_raw_bytes(&mut self, raw_bytes: &'a [u8]) -> &mut Self
Set a raw binary payload for the job.
Trait Implementations§
source§impl<'a> Clone for JobBuilder<'a>
impl<'a> Clone for JobBuilder<'a>
source§fn clone(&self) -> JobBuilder<'a>
fn clone(&self) -> JobBuilder<'a>
Returns a copy 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 moreAuto Trait Implementations§
impl<'a> RefUnwindSafe for JobBuilder<'a>
impl<'a> Send for JobBuilder<'a>
impl<'a> Sync for JobBuilder<'a>
impl<'a> Unpin for JobBuilder<'a>
impl<'a> UnwindSafe for JobBuilder<'a>
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