pub struct ConnectionId { /* private fields */ }Expand description
The ConnectionId Attribute.
TCP Connection handling through a TURN server.
Reference: RFC6062 Section 6.2.1.
Implementations§
Source§impl ConnectionId
impl ConnectionId
Sourcepub fn new(id: u32) -> Self
pub fn new(id: u32) -> Self
Create a new ConnectionId Attribute.
§Examples
let conn_id = ConnectionId::new(0x42);
assert_eq!(conn_id.id(), 0x42);Sourcepub fn id(&self) -> u32
pub fn id(&self) -> u32
Retrieve the protocol stored in a ConnectionId
§Examples
let conn_id = ConnectionId::new(0x402);
assert_eq!(conn_id.id(), 0x402);Trait Implementations§
Source§impl Attribute for ConnectionId
impl Attribute for ConnectionId
Source§impl AttributeFromRaw<'_> for ConnectionId
impl AttributeFromRaw<'_> for ConnectionId
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 ConnectionId
impl AttributeStaticType for ConnectionId
Source§const TYPE: AttributeType
const TYPE: AttributeType
The
AttributeTypeSource§impl AttributeWrite for ConnectionId
impl AttributeWrite for ConnectionId
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 ConnectionId
impl Clone for ConnectionId
Source§fn clone(&self) -> ConnectionId
fn clone(&self) -> ConnectionId
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 ConnectionId
impl Debug for ConnectionId
Source§impl Display for ConnectionId
impl Display for ConnectionId
Source§impl TryFrom<&RawAttribute<'_>> for ConnectionId
impl TryFrom<&RawAttribute<'_>> for ConnectionId
Source§type Error = StunParseError
type Error = StunParseError
The type returned in the event of a conversion error.
Auto Trait Implementations§
impl Freeze for ConnectionId
impl RefUnwindSafe for ConnectionId
impl Send for ConnectionId
impl Sync for ConnectionId
impl Unpin for ConnectionId
impl UnwindSafe for ConnectionId
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