Struct overclock::core::BoundedHandle
source · pub struct BoundedHandle<T> { /* private fields */ }
Expand description
Bounded handle
Implementations§
source§impl<T> BoundedHandle<T>
impl<T> BoundedHandle<T>
sourcepub fn new(
sender: Sender<T>,
gauge: IntGauge,
abort_handle: AbortHandle,
scope_id: ScopeId
) -> Self
pub fn new(
sender: Sender<T>,
gauge: IntGauge,
abort_handle: AbortHandle,
scope_id: ScopeId
) -> Self
Create new bounded handle
sourcepub async fn send(&self, message: T) -> Result<(), SendError<T>>
pub async fn send(&self, message: T) -> Result<(), SendError<T>>
Send message to the bounded channel
sourcepub fn send_after(
&self,
message: T,
duration: Duration
) -> JoinHandle<Result<(), SendError<T>>>where
T: Send + 'static,
pub fn send_after(
&self,
message: T,
duration: Duration
) -> JoinHandle<Result<(), SendError<T>>>where
T: Send + 'static,
Send message to the channel after the duration pass
sourcepub fn try_send(&self, message: T) -> Result<(), TrySendError<T>>
pub fn try_send(&self, message: T) -> Result<(), TrySendError<T>>
Attempt to send message to the bounded channel
sourcepub fn same_channel(&self, other: &Self) -> bool
pub fn same_channel(&self, other: &Self) -> bool
Returns true if the handle belongs to same channel