pub struct ConnectionMultiplexer { /* private fields */ }Expand description
Connection multiplexer for stream management
Implementations§
Source§impl ConnectionMultiplexer
Implementations for new structures
impl ConnectionMultiplexer
Implementations for new structures
Sourcepub fn new(max_streams_per_connection: u32, stream_timeout: Duration) -> Self
pub fn new(max_streams_per_connection: u32, stream_timeout: Duration) -> Self
Create new connection multiplexer
Sourcepub async fn open_stream(
&self,
peer_id: PeerId,
priority: Priority,
) -> Result<StreamId, NetworkError>
pub async fn open_stream( &self, peer_id: PeerId, priority: Priority, ) -> Result<StreamId, NetworkError>
Open a new stream on a connection
Sourcepub async fn close_stream(
&self,
stream_id: StreamId,
) -> Result<(), NetworkError>
pub async fn close_stream( &self, stream_id: StreamId, ) -> Result<(), NetworkError>
Close a stream
Sourcepub fn get_stream_info(&self, stream_id: StreamId) -> Option<StreamInfo>
pub fn get_stream_info(&self, stream_id: StreamId) -> Option<StreamInfo>
Get stream information
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for ConnectionMultiplexer
impl !UnwindSafe for ConnectionMultiplexer
impl Freeze for ConnectionMultiplexer
impl Send for ConnectionMultiplexer
impl Sync for ConnectionMultiplexer
impl Unpin for ConnectionMultiplexer
impl UnsafeUnpin for ConnectionMultiplexer
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
Source§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
impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
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