[][src]Struct beanstalkc::Job

pub struct Job<'a> { /* fields omitted */ }

Job is a simple abstraction about beanstalkd job.

Methods

impl<'a> Job<'a>[src]

pub fn new(
    conn: &'a mut Beanstalkc,
    job_id: u64,
    body: String,
    reserved: bool
) -> Job
[src]

Initialize and return the Job object.

pub fn id(&self) -> u64[src]

Return job id.

pub fn body(&self) -> &str[src]

Return job body.

pub fn reserved(&self) -> bool[src]

Return job reserving status.

pub fn delete(&mut self) -> Result<(), BeanstalkcError>[src]

Delete this job.

Example

use beanstalkc::Beanstalkc;

let mut conn = Beanstalkc::new().connect().unwrap();

let mut job = conn.reserve().unwrap();
job.delete().unwrap();

pub fn release_default(&mut self) -> Result<(), BeanstalkcError>[src]

Release this job back to the ready queue with default priority and delay.

Example

use beanstalkc::Beanstalkc;

let mut conn = Beanstalkc::new().connect().unwrap();

let mut job = conn.reserve().unwrap();
job.release_default().unwrap();

pub fn release(
    &mut self,
    priority: u32,
    delay: Duration
) -> Result<(), BeanstalkcError>
[src]

Release this job back to the ready queue with custom priority and delay.

Example

use std::time::Duration;
use beanstalkc::Beanstalkc;

let mut conn = Beanstalkc::new().connect().unwrap();

let mut job = conn.reserve().unwrap();
job.release(0, Duration::from_secs(0)).unwrap();

pub fn bury_default(&mut self) -> Result<(), BeanstalkcError>[src]

Bury this job with default priority.

Example

use std::time::Duration;
use beanstalkc::Beanstalkc;

let mut conn = Beanstalkc::new().connect().unwrap();

let mut job = conn.reserve().unwrap();
job.bury_default().unwrap();

pub fn bury(&mut self, priority: u32) -> Result<(), BeanstalkcError>[src]

Bury this job with custom priority.

Example

use std::time::Duration;
use beanstalkc::Beanstalkc;

let mut conn = Beanstalkc::new().connect().unwrap();

let mut job = conn.reserve().unwrap();
job.bury(1024).unwrap();

pub fn kick(&mut self) -> Result<(), BeanstalkcError>[src]

Kick this job to ready queue.

Example

use std::time::Duration;
use beanstalkc::Beanstalkc;

let mut conn = Beanstalkc::new().connect().unwrap();

let mut job = conn.peek_buried().unwrap();
job.kick().unwrap();

pub fn touch(&mut self) -> Result<(), BeanstalkcError>[src]

Touch this reserved job, requesting more time to work on it.

Example

use std::time::Duration;
use beanstalkc::Beanstalkc;

let mut conn = Beanstalkc::new().connect().unwrap();

let mut job = conn.reserve().unwrap();
job.touch().unwrap();

pub fn stats(&mut self) -> Result<HashMap<String, String>, BeanstalkcError>[src]

Return a dict of statistical information about this job.

Example

use std::time::Duration;
use beanstalkc::Beanstalkc;

let mut conn = Beanstalkc::new().connect().unwrap();

let mut job = conn.peek_ready().unwrap();
let job_stats = job.stats().unwrap();
dbg!(job_stats);

Trait Implementations

impl<'a> Display for Job<'a>[src]

impl<'a> Debug for Job<'a>[src]

Auto Trait Implementations

impl<'a> Send for Job<'a>

impl<'a> Sync for Job<'a>

Blanket Implementations

impl<T> From for T[src]

impl<T, U> Into for T where
    U: From<T>, 
[src]

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T, U> TryFrom for T where
    U: Into<T>, 
[src]

type Error = !

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> BorrowMut for T where
    T: ?Sized
[src]

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.