Enum ckb_network::TargetSession
source · [−]pub enum TargetSession {
All,
Single(SessionId),
Filter(Box<dyn Fn(&SessionId) + Send + 'static, Global>),
}Expand description
When sending a message, select the specified session
Variants
All
Try broadcast
Single(SessionId)
Try send to only one
Filter(Box<dyn Fn(&SessionId) + Send + 'static, Global>)
Try send to some session, if return true, send to it
Trait Implementations
sourceimpl From<SessionId> for TargetSession
impl From<SessionId> for TargetSession
sourcefn from(id: SessionId) -> TargetSession
fn from(id: SessionId) -> TargetSession
Performs the conversion.
sourceimpl From<usize> for TargetSession
impl From<usize> for TargetSession
sourcefn from(id: usize) -> TargetSession
fn from(id: usize) -> TargetSession
Performs the conversion.
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
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more