pub enum StunMethod {
Binding(StunMethodKind),
Allocate(StunMethodKind),
CreatePermission(StunMethodKind),
ChannelBind(StunMethodKind),
Refresh(StunMethodKind),
SendIndication,
DataIndication,
}Variants§
Binding(StunMethodKind)
Allocate(StunMethodKind)
CreatePermission(StunMethodKind)
ChannelBind(StunMethodKind)
Refresh(StunMethodKind)
SendIndication
DataIndication
Implementations§
Trait Implementations§
Source§impl Clone for StunMethod
impl Clone for StunMethod
Source§fn clone(&self) -> StunMethod
fn clone(&self) -> StunMethod
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for StunMethod
impl Debug for StunMethod
Source§impl Hash for StunMethod
impl Hash for StunMethod
Source§impl Into<u16> for StunMethod
impl Into<u16> for StunMethod
Source§fn into(self) -> u16
fn into(self) -> u16
§Test
use turn_server::stun::method::*;
use std::convert::Into;
assert_eq!(0x0001u16, <StunMethod as Into<u16>>::into(BINDING_REQUEST));
assert_eq!(0x0101u16, <StunMethod as Into<u16>>::into(BINDING_RESPONSE));
assert_eq!(0x0111u16, <StunMethod as Into<u16>>::into(BINDING_ERROR));
assert_eq!(0x0003u16, <StunMethod as Into<u16>>::into(ALLOCATE_REQUEST));
assert_eq!(0x0103u16, <StunMethod as Into<u16>>::into(ALLOCATE_RESPONSE));
assert_eq!(0x0113u16, <StunMethod as Into<u16>>::into(ALLOCATE_ERROR));
assert_eq!(0x0008u16, <StunMethod as Into<u16>>::into(CREATE_PERMISSION_REQUEST));
assert_eq!(0x0108u16, <StunMethod as Into<u16>>::into(CREATE_PERMISSION_RESPONSE));
assert_eq!(0x0118u16, <StunMethod as Into<u16>>::into(CREATE_PERMISSION_ERROR));
assert_eq!(0x0009u16, <StunMethod as Into<u16>>::into(CHANNEL_BIND_REQUEST));
assert_eq!(0x0109u16, <StunMethod as Into<u16>>::into(CHANNEL_BIND_RESPONSE));
assert_eq!(0x0119u16, <StunMethod as Into<u16>>::into(CHANNEL_BIND_ERROR));
assert_eq!(0x0004u16, <StunMethod as Into<u16>>::into(REFRESH_REQUEST));
assert_eq!(0x0104u16, <StunMethod as Into<u16>>::into(REFRESH_RESPONSE));
assert_eq!(0x0114u16, <StunMethod as Into<u16>>::into(REFRESH_ERROR));
assert_eq!(0x0016u16, <StunMethod as Into<u16>>::into(SEND_INDICATION));
assert_eq!(0x0017u16, <StunMethod as Into<u16>>::into(DATA_INDICATION));Source§impl PartialEq for StunMethod
impl PartialEq for StunMethod
Source§impl TryFrom<u16> for StunMethod
impl TryFrom<u16> for StunMethod
Source§fn try_from(value: u16) -> Result<Self, Self::Error>
fn try_from(value: u16) -> Result<Self, Self::Error>
§Test
use turn_server::stun::method::*;
use std::convert::TryFrom;
assert_eq!(StunMethod::try_from(0x0001).unwrap(), BINDING_REQUEST);
assert_eq!(StunMethod::try_from(0x0101).unwrap(), BINDING_RESPONSE);
assert_eq!(StunMethod::try_from(0x0111).unwrap(), BINDING_ERROR);
assert_eq!(StunMethod::try_from(0x0003).unwrap(), ALLOCATE_REQUEST);
assert_eq!(StunMethod::try_from(0x0103).unwrap(), ALLOCATE_RESPONSE);
assert_eq!(StunMethod::try_from(0x0113).unwrap(), ALLOCATE_ERROR);
assert_eq!(StunMethod::try_from(0x0008).unwrap(), CREATE_PERMISSION_REQUEST);
assert_eq!(StunMethod::try_from(0x0108).unwrap(), CREATE_PERMISSION_RESPONSE);
assert_eq!(StunMethod::try_from(0x0118).unwrap(), CREATE_PERMISSION_ERROR);
assert_eq!(StunMethod::try_from(0x0009).unwrap(), CHANNEL_BIND_REQUEST);
assert_eq!(StunMethod::try_from(0x0109).unwrap(), CHANNEL_BIND_RESPONSE);
assert_eq!(StunMethod::try_from(0x0119).unwrap(), CHANNEL_BIND_ERROR);
assert_eq!(StunMethod::try_from(0x0004).unwrap(), REFRESH_REQUEST);
assert_eq!(StunMethod::try_from(0x0104).unwrap(), REFRESH_RESPONSE);
assert_eq!(StunMethod::try_from(0x0114).unwrap(), REFRESH_ERROR);
assert_eq!(StunMethod::try_from(0x0016).unwrap(), SEND_INDICATION);
assert_eq!(StunMethod::try_from(0x0017).unwrap(), DATA_INDICATION);impl Copy for StunMethod
impl Eq for StunMethod
impl StructuralPartialEq for StunMethod
Auto Trait Implementations§
impl Freeze for StunMethod
impl RefUnwindSafe for StunMethod
impl Send for StunMethod
impl Sync for StunMethod
impl Unpin for StunMethod
impl UnwindSafe for StunMethod
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more