pub struct UnknownAttributes { /* private fields */ }
Expand description
The UnknownAttributes Attribute
Implementations§
Source§impl UnknownAttributes
impl UnknownAttributes
Sourcepub fn new(attrs: &[AttributeType]) -> Self
pub fn new(attrs: &[AttributeType]) -> Self
Sourcepub fn add_attribute(&mut self, attr: AttributeType)
pub fn add_attribute(&mut self, attr: AttributeType)
Add an AttributeType
that is unsupported
§Examples
let mut unknown = UnknownAttributes::new(&[]);
unknown.add_attribute(Username::TYPE);
assert!(unknown.has_attribute(Username::TYPE));
Sourcepub fn has_attribute(&self, attr: AttributeType) -> bool
pub fn has_attribute(&self, attr: AttributeType) -> bool
Check if an AttributeType
is present
§Examples
let unknown = UnknownAttributes::new(&[Username::TYPE]);
assert!(unknown.has_attribute(Username::TYPE));
assert!(!unknown.has_attribute(ErrorCode::TYPE));
Trait Implementations§
Source§impl Attribute for UnknownAttributes
impl Attribute for UnknownAttributes
Source§impl AttributeFromRaw<'_> for UnknownAttributes
impl AttributeFromRaw<'_> for UnknownAttributes
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 RawAttribute
Source§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 RawAttribute
Source§impl AttributeStaticType for UnknownAttributes
impl AttributeStaticType for UnknownAttributes
Source§const TYPE: AttributeType
const TYPE: AttributeType
The
AttributeType
Source§impl AttributeWrite for UnknownAttributes
impl AttributeWrite for UnknownAttributes
Source§fn to_raw(&self) -> RawAttribute<'_>
fn to_raw(&self) -> RawAttribute<'_>
Produce a
RawAttribute
from this Attribute
Source§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 UnknownAttributes
impl Clone for UnknownAttributes
Source§fn clone(&self) -> UnknownAttributes
fn clone(&self) -> UnknownAttributes
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 UnknownAttributes
impl Debug for UnknownAttributes
Source§impl Display for UnknownAttributes
impl Display for UnknownAttributes
Source§impl PartialEq for UnknownAttributes
impl PartialEq for UnknownAttributes
Source§impl TryFrom<&RawAttribute<'_>> for UnknownAttributes
impl TryFrom<&RawAttribute<'_>> for UnknownAttributes
Source§type Error = StunParseError
type Error = StunParseError
The type returned in the event of a conversion error.
impl Eq for UnknownAttributes
impl StructuralPartialEq for UnknownAttributes
Auto Trait Implementations§
impl Freeze for UnknownAttributes
impl RefUnwindSafe for UnknownAttributes
impl Send for UnknownAttributes
impl Sync for UnknownAttributes
impl Unpin for UnknownAttributes
impl UnwindSafe for UnknownAttributes
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