pub enum Method {
Binding(MethodType),
Allocate(MethodType),
CreatePermission(MethodType),
ChannelBind(MethodType),
Refresh(MethodType),
SendIndication,
DataIndication,
}Variants§
Binding(MethodType)
Allocate(MethodType)
CreatePermission(MethodType)
ChannelBind(MethodType)
Refresh(MethodType)
SendIndication
DataIndication
Implementations§
Trait Implementations§
Source§impl From<Method> for u16
impl From<Method> for u16
Source§fn from(val: Method) -> Self
fn from(val: Method) -> Self
§Test
use turn_server::codec::message::methods::*;
use std::convert::From;
assert_eq!(0x0001u16, u16::from(BINDING_REQUEST));
assert_eq!(0x0101u16, u16::from(BINDING_RESPONSE));
assert_eq!(0x0111u16, u16::from(BINDING_ERROR));
assert_eq!(0x0003u16, u16::from(ALLOCATE_REQUEST));
assert_eq!(0x0103u16, u16::from(ALLOCATE_RESPONSE));
assert_eq!(0x0113u16, u16::from(ALLOCATE_ERROR));
assert_eq!(0x0008u16, u16::from(CREATE_PERMISSION_REQUEST));
assert_eq!(0x0108u16, u16::from(CREATE_PERMISSION_RESPONSE));
assert_eq!(0x0118u16, u16::from(CREATE_PERMISSION_ERROR));
assert_eq!(0x0009u16, u16::from(CHANNEL_BIND_REQUEST));
assert_eq!(0x0109u16, u16::from(CHANNEL_BIND_RESPONSE));
assert_eq!(0x0119u16, u16::from(CHANNEL_BIND_ERROR));
assert_eq!(0x0004u16, u16::from(REFRESH_REQUEST));
assert_eq!(0x0104u16, u16::from(REFRESH_RESPONSE));
assert_eq!(0x0114u16, u16::from(REFRESH_ERROR));
assert_eq!(0x0016u16, u16::from(SEND_INDICATION));
assert_eq!(0x0017u16, u16::from(DATA_INDICATION));Source§impl TryFrom<u16> for Method
impl TryFrom<u16> for Method
Source§fn try_from(value: u16) -> Result<Self, Self::Error>
fn try_from(value: u16) -> Result<Self, Self::Error>
§Test
use turn_server::codec::message::methods::*;
use std::convert::TryFrom;
assert_eq!(Method::try_from(0x0001).unwrap(), BINDING_REQUEST);
assert_eq!(Method::try_from(0x0101).unwrap(), BINDING_RESPONSE);
assert_eq!(Method::try_from(0x0111).unwrap(), BINDING_ERROR);
assert_eq!(Method::try_from(0x0003).unwrap(), ALLOCATE_REQUEST);
assert_eq!(Method::try_from(0x0103).unwrap(), ALLOCATE_RESPONSE);
assert_eq!(Method::try_from(0x0113).unwrap(), ALLOCATE_ERROR);
assert_eq!(Method::try_from(0x0008).unwrap(), CREATE_PERMISSION_REQUEST);
assert_eq!(Method::try_from(0x0108).unwrap(), CREATE_PERMISSION_RESPONSE);
assert_eq!(Method::try_from(0x0118).unwrap(), CREATE_PERMISSION_ERROR);
assert_eq!(Method::try_from(0x0009).unwrap(), CHANNEL_BIND_REQUEST);
assert_eq!(Method::try_from(0x0109).unwrap(), CHANNEL_BIND_RESPONSE);
assert_eq!(Method::try_from(0x0119).unwrap(), CHANNEL_BIND_ERROR);
assert_eq!(Method::try_from(0x0004).unwrap(), REFRESH_REQUEST);
assert_eq!(Method::try_from(0x0104).unwrap(), REFRESH_RESPONSE);
assert_eq!(Method::try_from(0x0114).unwrap(), REFRESH_ERROR);
assert_eq!(Method::try_from(0x0016).unwrap(), SEND_INDICATION);
assert_eq!(Method::try_from(0x0017).unwrap(), DATA_INDICATION);impl Copy for Method
impl Eq for Method
impl StructuralPartialEq for Method
Auto Trait Implementations§
impl Freeze for Method
impl RefUnwindSafe for Method
impl Send for Method
impl Sync for Method
impl Unpin for Method
impl UnwindSafe for Method
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> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request