Trait stun_codec::Attribute [−][src]
STUN attribute.
Attribute: The STUN term for a Type-Length-Value (TLV) object that can be added to a STUN message. Attributes are divided into two types: comprehension-required and comprehension-optional. STUN agents can safely ignore comprehension-optional attributes they don't understand, but cannot successfully process a message if it contains comprehension-required attributes that are not understood.
Associated Types
type Decoder: Default + TryTaggedDecode<Tag = AttributeType, Item = Self>
[src]
The decoder of the value part of the attribute.
type Encoder: Default + SizedEncode<Item = Self>
[src]
The encoder of the value part of the attribute.
Required methods
fn get_type(&self) -> AttributeType
[src]
Returns the type of the attribute.
Provided methods
fn before_encode<A: Attribute>(&mut self, message: &Message<A>) -> Result<()>
[src]
This method is called before encoding the attribute.
message
is the message to which the attribute belongs.
The message only contains the attributes preceding to self
.
The default implementation simply returns Ok(())
.
fn after_decode<A: Attribute>(&mut self, message: &Message<A>) -> Result<()>
[src]
This method is called after decoding the attribute and before being appended to the given message.
The default implementation simply returns Ok(())
.
Implementors
impl Attribute for stun_codec::rfc5245::Attribute
[src]
type Decoder = AttributeDecoder
type Encoder = AttributeEncoder
fn get_type(&self) -> AttributeType
[src]
fn before_encode<A>(&mut self, message: &Message<A>) -> Result<()> where
A: Attribute,
[src]
A: Attribute,
fn after_decode<A>(&mut self, message: &Message<A>) -> Result<()> where
A: Attribute,
[src]
A: Attribute,
impl Attribute for stun_codec::rfc5389::Attribute
[src]
type Decoder = AttributeDecoder
type Encoder = AttributeEncoder
fn get_type(&self) -> AttributeType
[src]
fn before_encode<A>(&mut self, message: &Message<A>) -> Result<()> where
A: Attribute,
[src]
A: Attribute,
fn after_decode<A>(&mut self, message: &Message<A>) -> Result<()> where
A: Attribute,
[src]
A: Attribute,
impl Attribute for stun_codec::rfc5766::Attribute
[src]
type Decoder = AttributeDecoder
type Encoder = AttributeEncoder
fn get_type(&self) -> AttributeType
[src]
fn before_encode<A>(&mut self, message: &Message<A>) -> Result<()> where
A: Attribute,
[src]
A: Attribute,
fn after_decode<A>(&mut self, message: &Message<A>) -> Result<()> where
A: Attribute,
[src]
A: Attribute,
impl Attribute for stun_codec::rfc5780::Attribute
[src]
type Decoder = AttributeDecoder
type Encoder = AttributeEncoder
fn get_type(&self) -> AttributeType
[src]
fn before_encode<A>(&mut self, message: &Message<A>) -> Result<()> where
A: Attribute,
[src]
A: Attribute,
fn after_decode<A>(&mut self, message: &Message<A>) -> Result<()> where
A: Attribute,
[src]
A: Attribute,