pub struct TopicHandshakeInitiator<T, Evt> {
pub topic: T,
pub event_tx: Sender<Evt>,
}Expand description
Initiator side of the topic handshake protocol.
After the protocol is complete both peers know the T of the initiator.
Fields§
§topic: T§event_tx: Sender<Evt>Implementations§
Source§impl<T, Evt> TopicHandshakeInitiator<T, Evt>
impl<T, Evt> TopicHandshakeInitiator<T, Evt>
Trait Implementations§
Source§impl<T, Evt> Protocol for TopicHandshakeInitiator<T, Evt>where
T: Clone + Debug + for<'de> Deserialize<'de> + Serialize + Send + Sync + 'static,
Evt: From<TopicHandshakeEvent<T>>,
impl<T, Evt> Protocol for TopicHandshakeInitiator<T, Evt>where
T: Clone + Debug + for<'de> Deserialize<'de> + Serialize + Send + Sync + 'static,
Evt: From<TopicHandshakeEvent<T>>,
type Error = TopicHandshakeError<T>
type Output = ()
type Message = TopicHandshakeMessage<T>
async fn run( self, sink: &mut (impl Sink<Self::Message, Error = impl Debug> + Unpin), stream: &mut (impl Stream<Item = Result<Self::Message, impl Debug>> + Unpin), ) -> Result<Self::Output, Self::Error>
Auto Trait Implementations§
impl<T, Evt> Freeze for TopicHandshakeInitiator<T, Evt>where
T: Freeze,
impl<T, Evt> !RefUnwindSafe for TopicHandshakeInitiator<T, Evt>
impl<T, Evt> Send for TopicHandshakeInitiator<T, Evt>
impl<T, Evt> Sync for TopicHandshakeInitiator<T, Evt>
impl<T, Evt> Unpin for TopicHandshakeInitiator<T, Evt>where
T: Unpin,
impl<T, Evt> !UnwindSafe for TopicHandshakeInitiator<T, Evt>
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