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("examples/worker", 1);
let payloads = vec![EmptyPayload::new(), EmptyPayload::new()];
pool.perform::<(), _>("ping", payloads)?;
Implementations§
Source§impl 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("examples/worker", 1);
let payloads = EmptyPayload::bulk(2);
pool.perform::<(), _>("ping", payloads)?;
Trait Implementations§
Source§impl AsPayload for EmptyPayload
impl AsPayload for EmptyPayload
fn to_payload(self) -> Value
Auto Trait Implementations§
impl Freeze for EmptyPayload
impl RefUnwindSafe for EmptyPayload
impl Send for EmptyPayload
impl Sync for EmptyPayload
impl Unpin for EmptyPayload
impl UnwindSafe for EmptyPayload
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