pub struct VoiceCodec<EncodeDst: VoicePacketDst, DecodeDst: VoicePacketDst> { /* private fields */ }Expand description
A Codec implementation that parses a stream of data chunks into VoicePackets.
The encoding and decoding of voice packets depends on their destination. See ServerVoiceCodec and ClientVoiceCodec for the two most reasonable configurations.
Implementations§
Source§impl<EncodeDst: VoicePacketDst, DecodeDst: VoicePacketDst> VoiceCodec<EncodeDst, DecodeDst>
impl<EncodeDst: VoicePacketDst, DecodeDst: VoicePacketDst> VoiceCodec<EncodeDst, DecodeDst>
Trait Implementations§
Source§impl<EncodeDst: Debug + VoicePacketDst, DecodeDst: Debug + VoicePacketDst> Debug for VoiceCodec<EncodeDst, DecodeDst>
impl<EncodeDst: Debug + VoicePacketDst, DecodeDst: Debug + VoicePacketDst> Debug for VoiceCodec<EncodeDst, DecodeDst>
Source§impl<EncodeDst: VoicePacketDst, DecodeDst: VoicePacketDst> Decoder for VoiceCodec<EncodeDst, DecodeDst>
impl<EncodeDst: VoicePacketDst, DecodeDst: VoicePacketDst> Decoder for VoiceCodec<EncodeDst, DecodeDst>
Source§type Item = VoicePacket<DecodeDst>
type Item = VoicePacket<DecodeDst>
The type of decoded frames.
Source§fn decode(
&mut self,
buf_mut: &mut BytesMut,
) -> Result<Option<Self::Item>, Self::Error>
fn decode( &mut self, buf_mut: &mut BytesMut, ) -> Result<Option<Self::Item>, Self::Error>
Attempts to decode a frame from the provided buffer of bytes. Read more
Source§impl<EncodeDst: Default + VoicePacketDst, DecodeDst: Default + VoicePacketDst> Default for VoiceCodec<EncodeDst, DecodeDst>
impl<EncodeDst: Default + VoicePacketDst, DecodeDst: Default + VoicePacketDst> Default for VoiceCodec<EncodeDst, DecodeDst>
Source§fn default() -> VoiceCodec<EncodeDst, DecodeDst>
fn default() -> VoiceCodec<EncodeDst, DecodeDst>
Returns the “default value” for a type. Read more
Source§impl<EncodeDst: VoicePacketDst, DecodeDst: VoicePacketDst> Encoder<VoicePacket<EncodeDst>> for VoiceCodec<EncodeDst, DecodeDst>
impl<EncodeDst: VoicePacketDst, DecodeDst: VoicePacketDst> Encoder<VoicePacket<EncodeDst>> for VoiceCodec<EncodeDst, DecodeDst>
Auto Trait Implementations§
impl<EncodeDst, DecodeDst> Freeze for VoiceCodec<EncodeDst, DecodeDst>
impl<EncodeDst, DecodeDst> RefUnwindSafe for VoiceCodec<EncodeDst, DecodeDst>where
EncodeDst: RefUnwindSafe,
DecodeDst: RefUnwindSafe,
impl<EncodeDst, DecodeDst> Send for VoiceCodec<EncodeDst, DecodeDst>
impl<EncodeDst, DecodeDst> Sync for VoiceCodec<EncodeDst, DecodeDst>
impl<EncodeDst, DecodeDst> Unpin for VoiceCodec<EncodeDst, DecodeDst>
impl<EncodeDst, DecodeDst> UnwindSafe for VoiceCodec<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