pub struct ControlCodec<EncodeDst: VoicePacketDst, DecodeDst: VoicePacketDst> { /* private fields */ }
Expand description
A Codec
implementation that parses a stream of data into ControlPackets.
Since VoicePackets can be tunneled over the control channel and their encoding and decoding depends on their destination, the control codec also needs to know the side it’s on. See ServerControlCodec and ClientControlCodec for the two most reasonable configurations.
Implementations§
Source§impl<EncodeDst: VoicePacketDst, DecodeDst: VoicePacketDst> ControlCodec<EncodeDst, DecodeDst>
impl<EncodeDst: VoicePacketDst, DecodeDst: VoicePacketDst> ControlCodec<EncodeDst, DecodeDst>
Trait Implementations§
Source§impl<EncodeDst: Debug + VoicePacketDst, DecodeDst: Debug + VoicePacketDst> Debug for ControlCodec<EncodeDst, DecodeDst>
impl<EncodeDst: Debug + VoicePacketDst, DecodeDst: Debug + VoicePacketDst> Debug for ControlCodec<EncodeDst, DecodeDst>
Source§impl<EncodeDst: VoicePacketDst, DecodeDst: VoicePacketDst> Decoder for ControlCodec<EncodeDst, DecodeDst>
impl<EncodeDst: VoicePacketDst, DecodeDst: VoicePacketDst> Decoder for ControlCodec<EncodeDst, DecodeDst>
Source§type Item = ControlPacket<DecodeDst>
type Item = ControlPacket<DecodeDst>
The type of decoded frames.
Source§fn decode(
&mut self,
buf: &mut BytesMut,
) -> Result<Option<Self::Item>, Self::Error>
fn decode( &mut self, buf: &mut BytesMut, ) -> Result<Option<Self::Item>, Self::Error>
Attempts to decode a frame from the provided buffer of bytes. Read more
Source§impl<EncodeDst: VoicePacketDst, DecodeDst: VoicePacketDst> Default for ControlCodec<EncodeDst, DecodeDst>
impl<EncodeDst: VoicePacketDst, DecodeDst: VoicePacketDst> Default for ControlCodec<EncodeDst, DecodeDst>
Source§impl<EncodeDst: VoicePacketDst, DecodeDst: VoicePacketDst> Encoder<ControlPacket<EncodeDst>> for ControlCodec<EncodeDst, DecodeDst>
impl<EncodeDst: VoicePacketDst, DecodeDst: VoicePacketDst> Encoder<ControlPacket<EncodeDst>> for ControlCodec<EncodeDst, DecodeDst>
Auto Trait Implementations§
impl<EncodeDst, DecodeDst> Freeze for ControlCodec<EncodeDst, DecodeDst>
impl<EncodeDst, DecodeDst> RefUnwindSafe for ControlCodec<EncodeDst, DecodeDst>where
EncodeDst: RefUnwindSafe,
DecodeDst: RefUnwindSafe,
impl<EncodeDst, DecodeDst> Send for ControlCodec<EncodeDst, DecodeDst>
impl<EncodeDst, DecodeDst> Sync for ControlCodec<EncodeDst, DecodeDst>
impl<EncodeDst, DecodeDst> Unpin for ControlCodec<EncodeDst, DecodeDst>
impl<EncodeDst, DecodeDst> UnwindSafe for ControlCodec<EncodeDst, DecodeDst>where
EncodeDst: UnwindSafe,
DecodeDst: 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