Enum ckb_network::TargetSession
source · pub enum TargetSession {
All,
Single(SessionId),
Multi(Box<dyn Iterator<Item = SessionId> + Send>),
Filter(Box<dyn FnMut(&SessionId) -> bool + Send>),
}
Expand description
When sending a message, select the specified session
Variants§
All
Try broadcast
Single(SessionId)
Try send to only one
Multi(Box<dyn Iterator<Item = SessionId> + Send>)
Try send to some determined session
Filter(Box<dyn FnMut(&SessionId) -> bool + Send>)
Try send to some session, if return true, send to it
Trait Implementations§
source§impl From<SessionId> for TargetSession
impl From<SessionId> for TargetSession
source§fn from(id: SessionId) -> TargetSession
fn from(id: SessionId) -> TargetSession
Converts to this type from the input type.
source§impl From<usize> for TargetSession
impl From<usize> for TargetSession
source§fn from(id: usize) -> TargetSession
fn from(id: usize) -> TargetSession
Converts to this type from the input type.
Auto Trait Implementations§
impl !RefUnwindSafe for TargetSession
impl Send for TargetSession
impl !Sync for TargetSession
impl Unpin for TargetSession
impl !UnwindSafe for TargetSession
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