pub struct MuxHandle<S: Sender, R: Receiver> { /* private fields */ }Expand description
A clonable handle that allows registering routes at any time, even after the Muxer is running.
Implementations§
Source§impl<S: Sender, R: Receiver> MuxHandle<S, R>
impl<S: Sender, R: Receiver> MuxHandle<S, R>
Sourcepub async fn register(
&mut self,
subchannel: Channel,
) -> Result<(SubSender<S>, SubReceiver<R>), Error>
pub async fn register( &mut self, subchannel: Channel, ) -> Result<(SubSender<S>, SubReceiver<R>), Error>
Open a subchannel. Returns a (SubSender, SubReceiver) pair that can be used to send
and receive messages for that subchannel.
Panics if the subchannel is already registered at any point.
Trait Implementations§
Auto Trait Implementations§
impl<S, R> Freeze for MuxHandle<S, R>where
S: Freeze,
impl<S, R> !RefUnwindSafe for MuxHandle<S, R>
impl<S, R> Send for MuxHandle<S, R>
impl<S, R> Sync for MuxHandle<S, R>where
S: Sync,
impl<S, R> Unpin for MuxHandle<S, R>where
S: Unpin,
impl<S, R> !UnwindSafe for MuxHandle<S, R>
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
Source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
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