pub struct MultiplexedSession<PeerID> { /* private fields */ }
Expand description
A multiplexed session.
Implementations§
source§impl<PeerID> MultiplexedSession<PeerID>
impl<PeerID> MultiplexedSession<PeerID>
sourcepub fn get_peer_id(&self) -> &PeerID
pub fn get_peer_id(&self) -> &PeerID
Return the session’s peer ID.
sourcepub fn set_peer_id(&mut self, peer_id: PeerID)
pub fn set_peer_id(&mut self, peer_id: PeerID)
Set the session’s peer ID.
sourcepub fn get_session_id(&self) -> &SessionID
pub fn get_session_id(&self) -> &SessionID
Return the session ID.
sourcepub fn info(&self) -> Option<Arc<SessionInfo>>
pub fn info(&self) -> Option<Arc<SessionInfo>>
Session information.
sourcepub async fn process_data<W: Write>(
&mut self,
data: &[u8],
writer: W,
) -> Result<Option<Message>>
pub async fn process_data<W: Write>( &mut self, data: &[u8], writer: W, ) -> Result<Option<Message>>
Process incoming session data.
sourcepub fn write_message<W: Write>(&mut self, msg: Message, writer: W) -> Result<()>
pub fn write_message<W: Write>(&mut self, msg: Message, writer: W) -> Result<()>
Write message to session and generate a response.
sourcepub fn get_remote_node(&self) -> Result<PublicKey>
pub fn get_remote_node(&self) -> Result<PublicKey>
Return remote node identifier.
sourcepub fn set_remote_node(&mut self, node: PublicKey) -> Result<()>
pub fn set_remote_node(&mut self, node: PublicKey) -> Result<()>
Set the remote node identifier.
sourcepub fn is_connected(&self) -> bool
pub fn is_connected(&self) -> bool
Whether the session handshake has completed and the session is in transport mode.
sourcepub fn is_unauthenticated(&self) -> bool
pub fn is_unauthenticated(&self) -> bool
Whether the session is in unauthenticated transport state. In this state the session can only be used to transmit a close notification.
Auto Trait Implementations§
impl<PeerID> Freeze for MultiplexedSession<PeerID>where
PeerID: Freeze,
impl<PeerID> !RefUnwindSafe for MultiplexedSession<PeerID>
impl<PeerID> Send for MultiplexedSession<PeerID>where
PeerID: Send,
impl<PeerID> Sync for MultiplexedSession<PeerID>where
PeerID: Sync,
impl<PeerID> Unpin for MultiplexedSession<PeerID>where
PeerID: Unpin,
impl<PeerID> !UnwindSafe for MultiplexedSession<PeerID>
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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