Struct stun_codec::rfc5766::attributes::XorPeerAddressEncoder
source · pub struct XorPeerAddressEncoder(/* private fields */);
Expand description
XorPeerAddress
encoder.
Implementations§
Trait Implementations§
source§impl Debug for XorPeerAddressEncoder
impl Debug for XorPeerAddressEncoder
source§impl Default for XorPeerAddressEncoder
impl Default for XorPeerAddressEncoder
source§fn default() -> XorPeerAddressEncoder
fn default() -> XorPeerAddressEncoder
Returns the “default value” for a type. Read more
source§impl Encode for XorPeerAddressEncoder
impl Encode for XorPeerAddressEncoder
§type Item = XorPeerAddress
type Item = XorPeerAddress
The type of items to be encoded.
source§fn encode(&mut self, buf: &mut [u8], eos: Eos) -> Result<usize>
fn encode(&mut self, buf: &mut [u8], eos: Eos) -> Result<usize>
Encodes the items in the encoder and writes the encoded bytes to the given buffer. Read more
source§fn start_encoding(&mut self, item: Self::Item) -> Result<()>
fn start_encoding(&mut self, item: Self::Item) -> Result<()>
Tries to start encoding the given item. Read more
source§fn requiring_bytes(&self) -> ByteCount
fn requiring_bytes(&self) -> ByteCount
Returns the number of bytes required to encode all the items in the encoder. Read more
source§impl SizedEncode for XorPeerAddressEncoder
impl SizedEncode for XorPeerAddressEncoder
source§fn exact_requiring_bytes(&self) -> u64
fn exact_requiring_bytes(&self) -> u64
Returns the exact number of bytes required to encode all the items remaining in the encoder.
Auto Trait Implementations§
impl Freeze for XorPeerAddressEncoder
impl RefUnwindSafe for XorPeerAddressEncoder
impl Send for XorPeerAddressEncoder
impl Sync for XorPeerAddressEncoder
impl Unpin for XorPeerAddressEncoder
impl UnwindSafe for XorPeerAddressEncoder
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> EncodeExt for Twhere
T: Encode,
impl<T> EncodeExt for Twhere
T: Encode,
source§fn with_item(item: Self::Item) -> Result<Self, Error>where
Self: Default,
fn with_item(item: Self::Item) -> Result<Self, Error>where
Self: Default,
Creates a new encoder instance that has the given initial item. Read more
source§fn map_err<E, F>(self, f: F) -> MapErr<Self, E, F>
fn map_err<E, F>(self, f: F) -> MapErr<Self, E, F>
Creates an encoder for modifying encoding errors produced by
self
. Read moresource§fn map_from<T, F>(self, f: F) -> MapFrom<Self, T, F>
fn map_from<T, F>(self, f: F) -> MapFrom<Self, T, F>
Creates an encoder that converts items into ones that
suited to the
self
encoder by calling the given function. Read moresource§fn try_map_from<T, E, F>(self, f: F) -> TryMapFrom<Self, T, E, F>
fn try_map_from<T, E, F>(self, f: F) -> TryMapFrom<Self, T, E, F>
Creates an encoder that tries to convert items into ones that
suited to the
self
encoder by calling the given function. Read moresource§fn optional(self) -> Optional<Self>
fn optional(self) -> Optional<Self>
Creates an encoder that represents an optional encoder. Read more
source§fn max_bytes(self, n: u64) -> MaxBytes<Self>
fn max_bytes(self, n: u64) -> MaxBytes<Self>
Creates an encoder that will fail if the number of encoded bytes of an item exceeds
n
. Read moresource§fn length(self, n: u64) -> Length<Self>
fn length(self, n: u64) -> Length<Self>
Creates an encoder that required to encode each item exactly at the specified number of bytes. Read more
source§fn chain<T>(self, other: T) -> TupleEncoder<(Self, T)>where
T: Encode,
fn chain<T>(self, other: T) -> TupleEncoder<(Self, T)>where
T: Encode,
Takes two encoders and creates a new encoder that encodes both items in sequence. Read more
source§fn repeat<I>(self) -> Repeat<Self, I>
fn repeat<I>(self) -> Repeat<Self, I>
Creates an encoder that repeats encoding of
Self::Item
. Read moresource§fn pre_encode(self) -> PreEncode<Self>
fn pre_encode(self) -> PreEncode<Self>
Creates an encoder that pre-encodes items when
start_encoding
method is called. Read moresource§fn slice(self) -> Slice<Self>
fn slice(self) -> Slice<Self>
Creates an encoder that makes it possible to slice the encoded byte sequence in arbitrary units. Read more