pub struct EnqueuedJob {
pub id: u64,
pub queue: String,
pub job: Value,
}Expand description
A job sent to a queue, from Client::jobs.
Fields§
§id: u64Position in the capture, from 1 (shared with runs).
queue: StringThe queue: default, or the name given to ocre::jobs::queue.
job: ValueThe job as the app serialized it: {"send_welcome": {"user_id": 7}}.
Implementations§
Source§impl EnqueuedJob
impl EnqueuedJob
Sourcepub fn name(&self) -> Option<&str>
pub fn name(&self) -> Option<&str>
The job’s name: the key of its JSON object (send_welcome), as PerformedJob::job names it.
§Examples
let job: ocre::testing::EnqueuedJob =
ocre::serde_json::from_str(r#"{"id":1,"queue":"default","job":"cleanup"}"#).unwrap();
assert_eq!(job.name(), Some("cleanup"));Trait Implementations§
Source§impl Clone for EnqueuedJob
impl Clone for EnqueuedJob
Source§fn clone(&self) -> EnqueuedJob
fn clone(&self) -> EnqueuedJob
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 EnqueuedJob
impl Debug for EnqueuedJob
Source§impl<'de> Deserialize<'de> for EnqueuedJob
impl<'de> Deserialize<'de> for EnqueuedJob
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 PartialEq for EnqueuedJob
impl PartialEq for EnqueuedJob
Source§fn eq(&self, other: &EnqueuedJob) -> bool
fn eq(&self, other: &EnqueuedJob) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for EnqueuedJob
Auto Trait Implementations§
impl Freeze for EnqueuedJob
impl RefUnwindSafe for EnqueuedJob
impl Send for EnqueuedJob
impl Sync for EnqueuedJob
impl Unpin for EnqueuedJob
impl UnsafeUnpin for EnqueuedJob
impl UnwindSafe for EnqueuedJob
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