Enum ckb_network::TargetProtocol
source · [−]pub enum TargetProtocol {
All,
Single(ProtocolId),
Filter(Box<dyn Fn(&ProtocolId) + Send + 'static, Global>),
}Expand description
When dial, specify which protocol want to open
Variants
All
Try open all protocol
Single(ProtocolId)
Try open one protocol
Filter(Box<dyn Fn(&ProtocolId) + Send + 'static, Global>)
Try open some protocol, if return true, open it
Trait Implementations
sourceimpl From<ProtocolId> for TargetProtocol
impl From<ProtocolId> for TargetProtocol
sourcefn from(id: ProtocolId) -> TargetProtocol
fn from(id: ProtocolId) -> TargetProtocol
Performs the conversion.
sourceimpl From<usize> for TargetProtocol
impl From<usize> for TargetProtocol
sourcefn from(id: usize) -> TargetProtocol
fn from(id: usize) -> TargetProtocol
Performs the conversion.
Auto Trait Implementations
impl !RefUnwindSafe for TargetProtocol
impl Send for TargetProtocol
impl !Sync for TargetProtocol
impl Unpin for TargetProtocol
impl !UnwindSafe for TargetProtocol
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