pub enum TargetProtocol {
All,
Single(ProtocolId),
Filter(Box<dyn Fn(&ProtocolId) -> bool + Sync + Send>),
}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) -> bool + Sync + Send>)
Try open some protocol, if return true, open it
Trait Implementations§
Source§impl From<ProtocolId> for TargetProtocol
impl From<ProtocolId> for TargetProtocol
Source§fn from(id: ProtocolId) -> TargetProtocol
fn from(id: ProtocolId) -> TargetProtocol
Converts to this type from the input type.
Source§impl From<usize> for TargetProtocol
impl From<usize> for TargetProtocol
Source§fn from(id: usize) -> TargetProtocol
fn from(id: usize) -> TargetProtocol
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for TargetProtocol
impl !RefUnwindSafe for TargetProtocol
impl Send for TargetProtocol
impl Sync for TargetProtocol
impl Unpin for TargetProtocol
impl !UnwindSafe for TargetProtocol
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
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