Skip to main content

Attribute

Trait Attribute 

Source
pub trait Attribute<'a> {
    type Error: Debug;
    type Item;

    const TYPE: AttributeType;

    // Required method
    fn deserialize(
        bytes: &'a [u8],
        transaction_id: &'a [u8],
    ) -> Result<Self::Item, Self::Error>;

    // Provided method
    fn serialize<B: BufMut>(
        value: Self::Item,
        bytes: &mut B,
        transaction_id: &'a [u8],
    ) { ... }
}
Expand description

dyn stun/turn message attribute.

Required Associated Constants§

Source

const TYPE: AttributeType

current attribute type.

Required Associated Types§

Source

type Error: Debug

Source

type Item

current attribute inner type.

Required Methods§

Source

fn deserialize( bytes: &'a [u8], transaction_id: &'a [u8], ) -> Result<Self::Item, Self::Error>

convert bytesfer to current attribute.

Provided Methods§

Source

fn serialize<B: BufMut>( value: Self::Item, bytes: &mut B, transaction_id: &'a [u8], )

write the current attribute to the bytesfer.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl<'a> Attribute<'a> for AdditionalAddressFamily

Source§

const TYPE: AttributeType = AttributeType::AdditionalAddressFamily

Source§

type Error = Error

Source§

type Item = IpFamily

Source§

impl<'a> Attribute<'a> for ChannelNumber

Source§

const TYPE: AttributeType = AttributeType::ChannelNumber

Source§

type Error = Error

Source§

type Item = u16

Source§

impl<'a> Attribute<'a> for Data

Source§

const TYPE: AttributeType = AttributeType::Data

Source§

type Error = Error

Source§

type Item = &'a [u8]

Source§

impl<'a> Attribute<'a> for DontFragment

Source§

const TYPE: AttributeType = AttributeType::DontFragment

Source§

type Error = Error

Source§

type Item = ()

Source§

impl<'a> Attribute<'a> for ErrorCode<'a>

Source§

const TYPE: AttributeType = AttributeType::ErrorCode

Source§

type Error = Error

Source§

type Item = ErrorCode<'a>

Source§

impl<'a> Attribute<'a> for EvenPort

Source§

const TYPE: AttributeType = AttributeType::EvenPort

Source§

type Error = Error

Source§

type Item = bool

Source§

impl<'a> Attribute<'a> for Fingerprint

Source§

const TYPE: AttributeType = AttributeType::Fingerprint

Source§

type Error = Error

Source§

type Item = u32

Source§

impl<'a> Attribute<'a> for IceControlled

Source§

const TYPE: AttributeType = AttributeType::IceControlled

Source§

type Error = Error

Source§

type Item = u64

Source§

impl<'a> Attribute<'a> for IceControlling

Source§

const TYPE: AttributeType = AttributeType::IceControlling

Source§

type Error = Error

Source§

type Item = u64

Source§

impl<'a> Attribute<'a> for Lifetime

Source§

const TYPE: AttributeType = AttributeType::Lifetime

Source§

type Error = Error

Source§

type Item = u32

Source§

impl<'a> Attribute<'a> for MappedAddress

Source§

const TYPE: AttributeType = AttributeType::MappedAddress

Source§

type Error = Error

Source§

type Item = SocketAddr

Source§

impl<'a> Attribute<'a> for MessageIntegrity

Source§

const TYPE: AttributeType = AttributeType::MessageIntegrity

Source§

type Error = Error

Source§

type Item = &'a [u8]

Source§

impl<'a> Attribute<'a> for MessageIntegritySha256

Source§

const TYPE: AttributeType = AttributeType::MessageIntegritySha256

Source§

type Error = Error

Source§

type Item = &'a [u8]

Source§

impl<'a> Attribute<'a> for Nonce

Source§

const TYPE: AttributeType = AttributeType::Nonce

Source§

type Error = Error

Source§

type Item = &'a str

Source§

impl<'a> Attribute<'a> for PasswordAlgorithm

Source§

const TYPE: AttributeType = AttributeType::PasswordAlgorithm

Source§

type Error = Error

Source§

type Item = PasswordAlgorithm

Source§

impl<'a> Attribute<'a> for PasswordAlgorithms

Source§

const TYPE: AttributeType = AttributeType::PasswordAlgorithms

Source§

type Error = Error

Source§

type Item = Vec<PasswordAlgorithm>

Source§

impl<'a> Attribute<'a> for Priority

Source§

const TYPE: AttributeType = AttributeType::Priority

Source§

type Error = Error

Source§

type Item = u32

Source§

impl<'a> Attribute<'a> for Realm

Source§

const TYPE: AttributeType = AttributeType::Realm

Source§

type Error = Error

Source§

type Item = &'a str

Source§

impl<'a> Attribute<'a> for RequestedAddressFamily

Source§

const TYPE: AttributeType = AttributeType::RequestedAddressFamily

Source§

type Error = Error

Source§

type Item = IpFamily

Source§

impl<'a> Attribute<'a> for RequestedTransport

Source§

const TYPE: AttributeType = AttributeType::RequestedTransport

Source§

type Error = Error

Source§

type Item = RequestedTransport

Source§

impl<'a> Attribute<'a> for ReservationToken

Source§

const TYPE: AttributeType = AttributeType::ReservationToken

Source§

type Error = Error

Source§

type Item = u64

Source§

impl<'a> Attribute<'a> for ResponseOrigin

Source§

const TYPE: AttributeType = AttributeType::ResponseOrigin

Source§

type Error = Error

Source§

type Item = SocketAddr

Source§

impl<'a> Attribute<'a> for Software

Source§

const TYPE: AttributeType = AttributeType::Software

Source§

type Error = Error

Source§

type Item = &'a str

Source§

impl<'a> Attribute<'a> for ThirdPartyAuathorization

Source§

const TYPE: AttributeType = AttributeType::ThirdPartyAuathorization

Source§

type Error = Error

Source§

type Item = &'a str

Source§

impl<'a> Attribute<'a> for UseCandidate

Source§

const TYPE: AttributeType = AttributeType::UseCandidate

Source§

type Error = Error

Source§

type Item = ()

Source§

impl<'a> Attribute<'a> for UserHash

Source§

const TYPE: AttributeType = AttributeType::UserHash

Source§

type Error = Error

Source§

type Item = &'a [u8]

Source§

impl<'a> Attribute<'a> for UserName

Source§

const TYPE: AttributeType = AttributeType::UserName

Source§

type Error = Error

Source§

type Item = &'a str

Source§

impl<'a> Attribute<'a> for XorMappedAddress

Source§

const TYPE: AttributeType = AttributeType::XorMappedAddress

Source§

type Error = Error

Source§

type Item = SocketAddr

Source§

impl<'a> Attribute<'a> for XorPeerAddress

Source§

const TYPE: AttributeType = AttributeType::XorPeerAddress

Source§

type Error = Error

Source§

type Item = SocketAddr

Source§

impl<'a> Attribute<'a> for XorRelayedAddress

Source§

const TYPE: AttributeType = AttributeType::XorRelayedAddress

Source§

type Error = Error

Source§

type Item = SocketAddr