Struct openmls::extensions::Extensions
source · pub struct Extensions { /* private fields */ }
Expand description
A list of extensions with unique extension types.
Implementations§
source§impl Extensions
impl Extensions
sourcepub fn from_vec(
extensions: Vec<Extension>
) -> Result<Self, InvalidExtensionError>
pub fn from_vec( extensions: Vec<Extension> ) -> Result<Self, InvalidExtensionError>
Create an extension list with multiple extensions.
This function will fail when the list of extensions contains duplicate extension types.
sourcepub fn iter(&self) -> impl Iterator<Item = &Extension>
pub fn iter(&self) -> impl Iterator<Item = &Extension>
Returns an iterator over the extension list.
sourcepub fn add(&mut self, extension: Extension) -> Result<(), InvalidExtensionError>
pub fn add(&mut self, extension: Extension) -> Result<(), InvalidExtensionError>
Add an extension to the extension list.
Returns an error when there already is an extension with the same extension type.
sourcepub fn add_or_replace(&mut self, extension: Extension) -> Option<Extension>
pub fn add_or_replace(&mut self, extension: Extension) -> Option<Extension>
Add an extension to the extension list (or replace an existing one.)
Returns the replaced extension (if any).
sourcepub fn remove(&mut self, extension_type: ExtensionType) -> Option<Extension>
pub fn remove(&mut self, extension_type: ExtensionType) -> Option<Extension>
Remove an extension from the extension list.
Returns the removed extension or None
when there is no extension with the given extension type.
sourcepub fn contains(&self, extension_type: ExtensionType) -> bool
pub fn contains(&self, extension_type: ExtensionType) -> bool
Returns true
iff the extension list contains an extension with the given extension type.
source§impl Extensions
impl Extensions
sourcepub fn application_id(&self) -> Option<&ApplicationIdExtension>
pub fn application_id(&self) -> Option<&ApplicationIdExtension>
Get a reference to the ApplicationIdExtension
if there is any.
sourcepub fn ratchet_tree(&self) -> Option<&RatchetTreeExtension>
pub fn ratchet_tree(&self) -> Option<&RatchetTreeExtension>
Get a reference to the RatchetTreeExtension
if there is any.
sourcepub fn required_capabilities(&self) -> Option<&RequiredCapabilitiesExtension>
pub fn required_capabilities(&self) -> Option<&RequiredCapabilitiesExtension>
Get a reference to the RequiredCapabilitiesExtension
if there is any.
sourcepub fn external_pub(&self) -> Option<&ExternalPubExtension>
pub fn external_pub(&self) -> Option<&ExternalPubExtension>
Get a reference to the ExternalPubExtension
if there is any.
sourcepub fn external_senders(&self) -> Option<&ExternalSendersExtension>
pub fn external_senders(&self) -> Option<&ExternalSendersExtension>
Get a reference to the ExternalSendersExtension
if there is any.
Trait Implementations§
source§impl Clone for Extensions
impl Clone for Extensions
source§fn clone(&self) -> Extensions
fn clone(&self) -> Extensions
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for Extensions
impl Debug for Extensions
source§impl Default for Extensions
impl Default for Extensions
source§fn default() -> Extensions
fn default() -> Extensions
source§impl<'de> Deserialize<'de> for Extensions
impl<'de> Deserialize<'de> for Extensions
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where __D: Deserializer<'de>,
source§impl Deserialize for Extensions
impl Deserialize for Extensions
source§fn tls_deserialize<R: Read>(bytes: &mut R) -> Result<Self, Error>where
Self: Sized,
fn tls_deserialize<R: Read>(bytes: &mut R) -> Result<Self, Error>where Self: Sized,
bytes
from the provided a std::io::Read
and returns the populated struct. Read moresource§impl PartialEq<Extensions> for Extensions
impl PartialEq<Extensions> for Extensions
source§fn eq(&self, other: &Extensions) -> bool
fn eq(&self, other: &Extensions) -> bool
self
and other
values to be equal, and is used
by ==
.