Attribute

Trait Attribute 

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

    const KIND: AttrKind;

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

    // Provided method
    fn encode(value: Self::Item, bytes: &mut BytesMut, token: &'a [u8]) { ... }
}
Expand description

dyn stun/turn message attribute.

Required Associated Constants§

Source

const KIND: AttrKind

current attribute type.

Required Associated Types§

Source

type Error: Debug

Source

type Item

current attribute inner type.

Required Methods§

Source

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

convert bytesfer to current attribute.

Provided Methods§

Source

fn encode(value: Self::Item, bytes: &mut BytesMut, token: &'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", so this trait is not object safe.

Implementors§

Source§

impl<'a> Attribute<'a> for AccessToken<'a>

Source§

const KIND: AttrKind = AttrKind::AccessToken

Source§

type Error = StunError

Source§

type Item = AccessToken<'a>

Source§

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

Source§

const KIND: AttrKind = AttrKind::AdditionalAddressFamily

Source§

type Error = StunError

Source§

type Item = IpFamily

Source§

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

Source§

const KIND: AttrKind = AttrKind::ChannelNumber

Source§

type Error = StunError

Source§

type Item = u16

Source§

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

Source§

const KIND: AttrKind = AttrKind::Data

Source§

type Error = StunError

Source§

type Item = &'a [u8]

Source§

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

Source§

const KIND: AttrKind = AttrKind::DontFragment

Source§

type Error = StunError

Source§

type Item = ()

Source§

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

Source§

const KIND: AttrKind = AttrKind::ErrorCode

Source§

type Error = StunError

Source§

type Item = Error<'a>

Source§

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

Source§

const KIND: AttrKind = AttrKind::EvenPort

Source§

type Error = StunError

Source§

type Item = bool

Source§

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

Source§

const KIND: AttrKind = AttrKind::Fingerprint

Source§

type Error = StunError

Source§

type Item = u32

Source§

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

Source§

const KIND: AttrKind = AttrKind::IceControlled

Source§

type Error = StunError

Source§

type Item = u64

Source§

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

Source§

const KIND: AttrKind = AttrKind::IceControlling

Source§

type Error = StunError

Source§

type Item = u64

Source§

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

Source§

const KIND: AttrKind = AttrKind::Lifetime

Source§

type Error = StunError

Source§

type Item = u32

Source§

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

Source§

const KIND: AttrKind = AttrKind::MappedAddress

Source§

type Error = StunError

Source§

type Item = SocketAddr

Source§

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

Source§

const KIND: AttrKind = AttrKind::MessageIntegrity

Source§

type Error = StunError

Source§

type Item = &'a [u8]

Source§

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

Source§

const KIND: AttrKind = AttrKind::Nonce

Source§

type Error = StunError

Source§

type Item = &'a str

Source§

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

Source§

const KIND: AttrKind = AttrKind::Priority

Source§

type Error = StunError

Source§

type Item = u32

Source§

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

Source§

const KIND: AttrKind = AttrKind::Realm

Source§

type Error = StunError

Source§

type Item = &'a str

Source§

impl<'a> Attribute<'a> for ReqeestedTransport

Source§

const KIND: AttrKind = AttrKind::ReqeestedTransport

Source§

type Error = StunError

Source§

type Item = Transport

Source§

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

Source§

const KIND: AttrKind = AttrKind::RequestedAddressFamily

Source§

type Error = StunError

Source§

type Item = IpFamily

Source§

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

Source§

const KIND: AttrKind = AttrKind::ReservationToken

Source§

type Error = StunError

Source§

type Item = u64

Source§

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

Source§

const KIND: AttrKind = AttrKind::ResponseOrigin

Source§

type Error = StunError

Source§

type Item = SocketAddr

Source§

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

Source§

const KIND: AttrKind = AttrKind::Software

Source§

type Error = StunError

Source§

type Item = &'a str

Source§

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

Source§

const KIND: AttrKind = AttrKind::ThirdPartyAuathorization

Source§

type Error = StunError

Source§

type Item = &'a str

Source§

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

Source§

const KIND: AttrKind = AttrKind::UseCandidate

Source§

type Error = StunError

Source§

type Item = ()

Source§

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

Source§

const KIND: AttrKind = AttrKind::UserName

Source§

type Error = StunError

Source§

type Item = &'a str

Source§

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

Source§

const KIND: AttrKind = AttrKind::XorMappedAddress

Source§

type Error = StunError

Source§

type Item = SocketAddr

Source§

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

Source§

const KIND: AttrKind = AttrKind::XorPeerAddress

Source§

type Error = StunError

Source§

type Item = SocketAddr

Source§

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

Source§

const KIND: AttrKind = AttrKind::XorRelayedAddress

Source§

type Error = StunError

Source§

type Item = SocketAddr