Struct stun_types::attribute::UnknownAttributes
source · 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));Trait Implementations§
source§impl Attribute for UnknownAttributes
impl Attribute for UnknownAttributes
source§impl Clone for UnknownAttributes
impl Clone for UnknownAttributes
source§fn clone(&self) -> UnknownAttributes
fn clone(&self) -> UnknownAttributes
Returns a copy 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<'a> From<&UnknownAttributes> for RawAttribute<'a>
impl<'a> From<&UnknownAttributes> for RawAttribute<'a>
source§fn from(value: &UnknownAttributes) -> RawAttribute<'a>
fn from(value: &UnknownAttributes) -> RawAttribute<'a>
Converts to this type from the input type.
source§impl PartialEq for UnknownAttributes
impl PartialEq for UnknownAttributes
source§fn eq(&self, other: &UnknownAttributes) -> bool
fn eq(&self, other: &UnknownAttributes) -> bool
This method tests for
self and other values to be equal, and is used
by ==.source§impl<'a> TryFrom<&RawAttribute<'a>> for UnknownAttributes
impl<'a> TryFrom<&RawAttribute<'a>> for UnknownAttributes
§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<E, T> AttributeFromRaw<E> for T
impl<E, T> AttributeFromRaw<E> for T
source§fn from_raw(raw: &RawAttribute<'_>) -> Result<T, E>
fn from_raw(raw: &RawAttribute<'_>) -> Result<T, E>
Convert an
Attribute from a RawAttributesource§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§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit)