pub struct ReservationToken { /* private fields */ }Expand description
The ReservationToken Attribute.
Reserves an allocation on the TURN server or acquires an already existing allocation on the TURN server.
Reference: RFC5766 Section 14.9.
Implementations§
Source§impl ReservationToken
impl ReservationToken
Sourcepub fn new(token: u64) -> Self
pub fn new(token: u64) -> Self
Create a new ReservationToken Attribute.
§Examples
let token = ReservationToken::new(100);
assert_eq!(token.token(), 100);Sourcepub fn token(&self) -> u64
pub fn token(&self) -> u64
Retrieve the token stored in a ReservationToken.
§Examples
let token = ReservationToken::new(100);
assert_eq!(token.token(), 100);Trait Implementations§
Source§impl Attribute for ReservationToken
impl Attribute for ReservationToken
Source§impl AttributeFromRaw<'_> for ReservationToken
impl AttributeFromRaw<'_> for ReservationToken
Source§fn from_raw_ref(raw: &RawAttribute<'_>) -> Result<Self, StunParseError>where
Self: Sized,
fn from_raw_ref(raw: &RawAttribute<'_>) -> Result<Self, StunParseError>where
Self: Sized,
Produce an
Attribute from a RawAttributeSource§fn from_raw(raw: RawAttribute<'a>) -> Result<Self, StunParseError>where
Self: Sized,
fn from_raw(raw: RawAttribute<'a>) -> Result<Self, StunParseError>where
Self: Sized,
Produce an
Attribute from a RawAttributeSource§impl AttributeStaticType for ReservationToken
impl AttributeStaticType for ReservationToken
Source§const TYPE: AttributeType
const TYPE: AttributeType
The
AttributeTypeSource§impl AttributeWrite for ReservationToken
impl AttributeWrite for ReservationToken
Source§fn to_raw(&self) -> RawAttribute<'_>
fn to_raw(&self) -> RawAttribute<'_>
Produce a
RawAttribute from this AttributeSource§fn write_into_unchecked(&self, dest: &mut [u8])
fn write_into_unchecked(&self, dest: &mut [u8])
Write attribute to the provided destination buffer. Read more
Source§impl Clone for ReservationToken
impl Clone for ReservationToken
Source§fn clone(&self) -> ReservationToken
fn clone(&self) -> ReservationToken
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 ReservationToken
impl Debug for ReservationToken
Source§impl Display for ReservationToken
impl Display for ReservationToken
Source§impl TryFrom<&RawAttribute<'_>> for ReservationToken
impl TryFrom<&RawAttribute<'_>> for ReservationToken
Source§type Error = StunParseError
type Error = StunParseError
The type returned in the event of a conversion error.
Auto Trait Implementations§
impl Freeze for ReservationToken
impl RefUnwindSafe for ReservationToken
impl Send for ReservationToken
impl Sync for ReservationToken
impl Unpin for ReservationToken
impl UnwindSafe for ReservationToken
Blanket Implementations§
Source§impl<A> AttributeExt for A
impl<A> AttributeExt for A
Source§impl<A> AttributeWriteExt for Awhere
A: AttributeWrite + ?Sized,
impl<A> AttributeWriteExt for Awhere
A: AttributeWrite + ?Sized,
Source§fn write_header(&self, dest: &mut [u8]) -> Result<usize, StunWriteError>
fn write_header(&self, dest: &mut [u8]) -> Result<usize, StunWriteError>
Write the 4 byte attribute header into the provided destination buffer returning the
number of bytes written, or an error.
Source§fn write_header_unchecked(&self, dest: &mut [u8]) -> usize
fn write_header_unchecked(&self, dest: &mut [u8]) -> usize
Write the 4 byte attribute header into the provided destination buffer returning the
number of bytes written. Read more
Source§fn write_into(&self, dest: &mut [u8]) -> Result<usize, StunWriteError>
fn write_into(&self, dest: &mut [u8]) -> Result<usize, StunWriteError>
Write this attribute into the provided destination buffer returning the number of bytes
written, or an error.
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