pub struct CodecKit<C> {
pub codec: C,
}Expand description
Generic typed-codec “kit” that builds typed producers/consumers for any codec.
The kit is intentionally tiny: it mostly provides constructors and a couple of
ergonomic helpers. The underlying typed wrappers (indexbus-typed) are the source of truth.
Fields§
§codec: CThe codec instance used by the typed wrappers created by this kit.
Implementations§
Source§impl<C: Copy> CodecKit<C>
impl<C: Copy> CodecKit<C>
Sourcepub fn spsc_sender(self, inner: SpscSender) -> TypedSpscSender<C>
pub fn spsc_sender(self, inner: SpscSender) -> TypedSpscSender<C>
Wrap an SPSC sender with typed messaging.
Sourcepub fn spsc_receiver(self, inner: SpscReceiver) -> TypedSpscReceiver<C>
pub fn spsc_receiver(self, inner: SpscReceiver) -> TypedSpscReceiver<C>
Wrap an SPSC receiver with typed messaging.
Sourcepub fn mpsc_producer(self, inner: MpscProducer) -> TypedMpscProducer<C>
pub fn mpsc_producer(self, inner: MpscProducer) -> TypedMpscProducer<C>
Wrap an MPSC producer with typed messaging.
Sourcepub fn mpsc_consumer(self, inner: MpscConsumer) -> TypedMpscConsumer<C>
pub fn mpsc_consumer(self, inner: MpscConsumer) -> TypedMpscConsumer<C>
Wrap an MPSC consumer with typed messaging.
Sourcepub fn fanout_producer<const N: usize>(
self,
inner: FanoutProducer<N>,
) -> TypedFanoutProducer<N, C>
pub fn fanout_producer<const N: usize>( self, inner: FanoutProducer<N>, ) -> TypedFanoutProducer<N, C>
Wrap a fanout producer with typed messaging.
Sourcepub fn fanout_consumer<const N: usize>(
self,
inner: FanoutConsumer<N>,
) -> TypedFanoutConsumer<N, C>
pub fn fanout_consumer<const N: usize>( self, inner: FanoutConsumer<N>, ) -> TypedFanoutConsumer<N, C>
Wrap a fanout consumer with typed messaging.
Sourcepub fn fanout_mpsc_producer<const N: usize>(
self,
inner: FanoutMpscProducer<N>,
) -> TypedFanoutMpscProducer<N, C>
pub fn fanout_mpsc_producer<const N: usize>( self, inner: FanoutMpscProducer<N>, ) -> TypedFanoutMpscProducer<N, C>
Wrap a fanout MPSC producer with typed messaging.
Trait Implementations§
impl<C: Copy> Copy for CodecKit<C>
Auto Trait Implementations§
impl<C> Freeze for CodecKit<C>where
C: Freeze,
impl<C> RefUnwindSafe for CodecKit<C>where
C: RefUnwindSafe,
impl<C> Send for CodecKit<C>where
C: Send,
impl<C> Sync for CodecKit<C>where
C: Sync,
impl<C> Unpin for CodecKit<C>where
C: Unpin,
impl<C> UnwindSafe for CodecKit<C>where
C: 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