pub struct Negotiator<TProto> { /* private fields */ }
Implementations§
Source§impl<TProto: AsRef<[u8]> + Clone + Debug> Negotiator<TProto>
impl<TProto: AsRef<[u8]> + Clone + Debug> Negotiator<TProto>
pub fn new_with_protocols<Iter>(protocols: Iter) -> Selfwhere
Iter: IntoIterator<Item = TProto>,
pub fn add_protocol(&mut self, proto: TProto) -> Result<(), ProtocolError>
pub async fn negotiate<TSocket>( &self, socket: TSocket, ) -> Result<(TProto, TSocket), NegotiationError>
pub async fn select_one<TSocket>( &self, socket: TSocket, ) -> Result<(TProto, TSocket), NegotiationError>
Trait Implementations§
Auto Trait Implementations§
impl<TProto> Freeze for Negotiator<TProto>
impl<TProto> RefUnwindSafe for Negotiator<TProto>where
TProto: RefUnwindSafe,
impl<TProto> Send for Negotiator<TProto>where
TProto: Send,
impl<TProto> Sync for Negotiator<TProto>where
TProto: Sync,
impl<TProto> Unpin for Negotiator<TProto>where
TProto: Unpin,
impl<TProto> UnwindSafe for Negotiator<TProto>where
TProto: UnwindSafe,
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