pub struct ShardHandle { /* private fields */ }Expand description
A cloneable handle for sending commands to a shard task.
Wraps the mpsc sender so callers don’t need to manage oneshot channels directly.
Implementations§
Source§impl ShardHandle
impl ShardHandle
Sourcepub async fn send(
&self,
request: ShardRequest,
) -> Result<ShardResponse, ShardError>
pub async fn send( &self, request: ShardRequest, ) -> Result<ShardResponse, ShardError>
Sends a request and waits for the response.
Returns ShardError::Unavailable if the shard task has stopped.
Trait Implementations§
Source§impl Clone for ShardHandle
impl Clone for ShardHandle
Source§fn clone(&self) -> ShardHandle
fn clone(&self) -> ShardHandle
Returns a duplicate 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 Freeze for ShardHandle
impl RefUnwindSafe for ShardHandle
impl Send for ShardHandle
impl Sync for ShardHandle
impl Unpin for ShardHandle
impl UnwindSafe for ShardHandle
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