pub trait Attribute: Debug {
fn get_type(&self) -> AttributeType;
fn length(&self) -> u16;
fn to_raw(&self) -> RawAttribute;
fn from_raw(raw: &RawAttribute) -> Result<Self, StunParseError>
where
Self: Sized;
}
Expand description
A STUN attribute for use in Message
s
Required Methods§
sourcefn get_type(&self) -> AttributeType
fn get_type(&self) -> AttributeType
Retrieve the AttributeType
of an Attribute
sourcefn length(&self) -> u16
fn length(&self) -> u16
Retrieve the length of an Attribute
. This is not the padded length as stored in a
Message
sourcefn to_raw(&self) -> RawAttribute
fn to_raw(&self) -> RawAttribute
Convert an Attribute
to a RawAttribute
sourcefn from_raw(raw: &RawAttribute) -> Result<Self, StunParseError>where
Self: Sized,
fn from_raw(raw: &RawAttribute) -> Result<Self, StunParseError>where
Self: Sized,
Convert an Attribute
from a RawAttribute