Struct node_workers::EmptyPayload
source · [−]pub struct EmptyPayload {}
Expand description
Represents an empty payload that can be sent to a node worker
use node_workers::{EmptyPayload, WorkerPool};
let mut pool = WorkerPool::setup(1);
let payloads = vec![EmptyPayload::new(), EmptyPayload::new()];
pool.perform::<(), _>("examples/worker", "ping", payloads);
Implementations
sourceimpl EmptyPayload
impl EmptyPayload
pub fn new() -> EmptyPayload
sourcepub fn bulk(n: u32) -> Vec<EmptyPayload>
pub fn bulk(n: u32) -> Vec<EmptyPayload>
Convenient method to create an array of empty payload
use node_workers::{EmptyPayload, WorkerPool};
let mut pool = WorkerPool::setup(1);
let payloads = EmptyPayload::bulk(2);
pool.perform::<(), _>("examples/worker", "ping", payloads);
Trait Implementations
sourceimpl AsPayload for EmptyPayload
impl AsPayload for EmptyPayload
fn to_payload(self) -> Value
Auto Trait Implementations
impl RefUnwindSafe for EmptyPayload
impl Send for EmptyPayload
impl Sync for EmptyPayload
impl Unpin for EmptyPayload
impl UnwindSafe for EmptyPayload
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more