pub enum Extension {
ApplicationId(ApplicationIdExtension),
RatchetTree(RatchetTreeExtension),
RequiredCapabilities(RequiredCapabilitiesExtension),
ExternalPub(ExternalPubExtension),
ExternalSenders(ExternalSendersExtension),
LastResort(LastResortExtension),
Unknown(u16, UnknownExtension),
}Expand description
§Extension
An extension is one of the Extension enum values.
The enum provides a set of common functionality for all extensions.
See the individual extensions for more details on each extension.
// draft-ietf-mls-protocol-16
struct {
ExtensionType extension_type;
opaque extension_data<V>;
} Extension;Variants§
ApplicationId(ApplicationIdExtension)
RatchetTree(RatchetTreeExtension)
RequiredCapabilities(RequiredCapabilitiesExtension)
ExternalPub(ExternalPubExtension)
ExternalSenders(ExternalSendersExtension)
LastResort(LastResortExtension)
Unknown(u16, UnknownExtension)
A currently unknown extension.
Implementations§
Source§impl Extension
impl Extension
Sourcepub fn as_application_id_extension(
&self,
) -> Result<&ApplicationIdExtension, ExtensionError>
pub fn as_application_id_extension( &self, ) -> Result<&ApplicationIdExtension, ExtensionError>
Get a reference to this extension as ApplicationIdExtension.
Returns an ExtensionError::InvalidExtensionType if called on an
Extension that’s not an ApplicationIdExtension.
Sourcepub fn as_ratchet_tree_extension(
&self,
) -> Result<&RatchetTreeExtension, ExtensionError>
pub fn as_ratchet_tree_extension( &self, ) -> Result<&RatchetTreeExtension, ExtensionError>
Get a reference to this extension as RatchetTreeExtension.
Returns an ExtensionError::InvalidExtensionType if called on
an Extension that’s not a RatchetTreeExtension.
Sourcepub fn as_required_capabilities_extension(
&self,
) -> Result<&RequiredCapabilitiesExtension, ExtensionError>
pub fn as_required_capabilities_extension( &self, ) -> Result<&RequiredCapabilitiesExtension, ExtensionError>
Get a reference to this extension as RequiredCapabilitiesExtension.
Returns an ExtensionError::InvalidExtensionType error if called on
an Extension that’s not a RequiredCapabilitiesExtension.
Sourcepub fn as_external_pub_extension(
&self,
) -> Result<&ExternalPubExtension, ExtensionError>
pub fn as_external_pub_extension( &self, ) -> Result<&ExternalPubExtension, ExtensionError>
Get a reference to this extension as ExternalPubExtension.
Returns an ExtensionError::InvalidExtensionType error if called on
an Extension that’s not a ExternalPubExtension.
Sourcepub fn as_external_senders_extension(
&self,
) -> Result<&ExternalSendersExtension, ExtensionError>
pub fn as_external_senders_extension( &self, ) -> Result<&ExternalSendersExtension, ExtensionError>
Get a reference to this extension as ExternalSendersExtension.
Returns an ExtensionError::InvalidExtensionType error if called on
an Extension that’s not a ExternalSendersExtension.
Sourcepub const fn extension_type(&self) -> ExtensionType
pub const fn extension_type(&self) -> ExtensionType
Returns the ExtensionType
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Extension
impl<'de> Deserialize<'de> for Extension
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 Extension
impl Deserialize for Extension
Source§fn tls_deserialize<R: Read>(bytes: &mut R) -> Result<Self, Error>
fn tls_deserialize<R: Read>(bytes: &mut R) -> Result<Self, Error>
std only.bytes from the provided a std::io::Read
and returns the populated struct. Read moreSource§impl DeserializeBytes for Extension
impl DeserializeBytes for Extension
Source§impl From<Extension> for FrankenExtension
Available on crate features test-utils only.
impl From<Extension> for FrankenExtension
test-utils only.Source§impl Serialize for &Extension
impl Serialize for &Extension
Source§impl Serialize for Extension
impl Serialize for Extension
impl Eq for Extension
impl StructuralPartialEq for Extension
Auto Trait Implementations§
impl Freeze for Extension
impl RefUnwindSafe for Extension
impl Send for Extension
impl Sync for Extension
impl Unpin for Extension
impl UnwindSafe for Extension
Blanket Implementations§
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
§impl<T> Classify for T
impl<T> Classify for T
type Classified = T
fn classify(self) -> T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Declassify for T
impl<T> Declassify for T
type Declassified = T
fn declassify(self) -> T
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more