pub struct InChannels(/* private fields */);Expand description
§Input Channels
A hash-table mapping NodeId to InChannel. In Dagrs, each Node stores input
channels in this map, enabling Node to receive information packets from other Nodes.
Implementations§
Source§impl InChannels
impl InChannels
Sourcepub fn blocking_recv_from(&mut self, id: &NodeId) -> Result<Content, RecvErr>
pub fn blocking_recv_from(&mut self, id: &NodeId) -> Result<Content, RecvErr>
Perform a blocking receive on the incoming channel from NodeId.
Sourcepub async fn recv_from(&mut self, id: &NodeId) -> Result<Content, RecvErr>
pub async fn recv_from(&mut self, id: &NodeId) -> Result<Content, RecvErr>
Perform a asynchronous receive on the incoming channel from NodeId.
Sourcepub fn blocking_map<F, T>(&mut self, f: F) -> Vec<T>
pub fn blocking_map<F, T>(&mut self, f: F) -> Vec<T>
Calls blocking_recv for all the InChannels, and applies transformation f to
the return values of the call.
Sourcepub async fn map<F, T>(&mut self, f: F) -> Vec<T>
pub async fn map<F, T>(&mut self, f: F) -> Vec<T>
Calls recv for all the InChannels, and applies transformation f to
the return values of the call asynchronously.
Sourcepub async fn close_async(&mut self, id: &NodeId)
pub async fn close_async(&mut self, id: &NodeId)
Close the channel by the given NodeId asynchronously, and remove the channel in this map.
Trait Implementations§
Source§impl Default for InChannels
impl Default for InChannels
Source§fn default() -> InChannels
fn default() -> InChannels
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl !RefUnwindSafe for InChannels
impl !UnwindSafe for InChannels
impl Freeze for InChannels
impl Send for InChannels
impl Sync for InChannels
impl Unpin for InChannels
impl UnsafeUnpin for InChannels
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more