Enum ckb_network::TargetSession
source · pub enum TargetSession {
All,
Single(SessionId),
Multi(Box<dyn Iterator<Item = SessionId> + Send + 'static, Global>),
Filter(Box<dyn FnMut(&SessionId) -> bool + Send + 'static, Global>),
}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 + 'static, Global>)
Try send to some determined session
Filter(Box<dyn FnMut(&SessionId) -> bool + Send + 'static, Global>)
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.