pub struct GroupContext { /* private fields */ }Expand description
8.1 Group Context
struct {
ProtocolVersion version = mls10;
CipherSuite cipher_suite;
opaque group_id<V>;
uint64 epoch;
opaque tree_hash<V>;
opaque confirmed_transcript_hash<V>;
Extension extensions<V>;
} GroupContext;
The [`GroupContext`] is a state object maintained which summarizes the group
state agreed upon by each member of the group.Implementations§
Source§impl GroupContext
impl GroupContext
Sourcepub fn safe_aad_required(&self) -> bool
Available on crate feature extensions-draft-08 only.
pub fn safe_aad_required(&self) -> bool
extensions-draft-08 only.Whether Safe AAD framing is active for messages in this group.
Returns true exactly when the app_data_dictionary GroupContext
extension contains a safe_aad component (the value bytes are not
inspected here, an empty ComponentsList is still “present”).
Per the Safe AAD spec section 4.9, when this is true the
authenticated_data field always starts with the SafeAAD struct.
Sourcepub fn safe_aad_required_components(
&self,
) -> Result<Option<Vec<ComponentId>>, SafeAadError>
Available on crate feature extensions-draft-08 only.
pub fn safe_aad_required_components( &self, ) -> Result<Option<Vec<ComponentId>>, SafeAadError>
extensions-draft-08 only.The list of ComponentIds required to be understood by every member
for Safe AAD purposes.
Returns Ok(None) when the safe_aad component is absent from the
app_data_dictionary GroupContext extension, Ok(Some(list)) when it
is present and parses cleanly (the list may be empty), and an error
when the component value fails to decode as a ComponentsList.
Sourcepub fn protocol_version(&self) -> ProtocolVersion
pub fn protocol_version(&self) -> ProtocolVersion
Return the protocol version.
Sourcepub fn ciphersuite(&self) -> Ciphersuite
pub fn ciphersuite(&self) -> Ciphersuite
Return the ciphersuite.
Sourcepub fn epoch(&self) -> GroupEpoch
pub fn epoch(&self) -> GroupEpoch
Return the epoch.
Sourcepub fn confirmed_transcript_hash(&self) -> &[u8] ⓘ
pub fn confirmed_transcript_hash(&self) -> &[u8] ⓘ
Return the confirmed transcript hash.
Sourcepub fn extensions(&self) -> &Extensions<GroupContext>
pub fn extensions(&self) -> &Extensions<GroupContext>
Return the extensions.
Sourcepub fn required_capabilities(&self) -> Option<&RequiredCapabilitiesExtension>
pub fn required_capabilities(&self) -> Option<&RequiredCapabilitiesExtension>
Get the required capabilities extension.
Trait Implementations§
Source§impl Clone for GroupContext
impl Clone for GroupContext
Source§fn clone(&self) -> GroupContext
fn clone(&self) -> GroupContext
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for GroupContext
impl Debug for GroupContext
Source§impl<'de> Deserialize<'de> for GroupContext
impl<'de> Deserialize<'de> for GroupContext
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 GroupContext
impl Deserialize for GroupContext
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 GroupContext
impl DeserializeBytes for GroupContext
Source§impl ExtensionValidator for GroupContext
impl ExtensionValidator for GroupContext
Source§type Error = ExtensionTypeNotValidInGroupContextError
type Error = ExtensionTypeNotValidInGroupContextError
Source§fn validate_extension_type(
ext: &Extension,
) -> Result<(), ExtensionTypeNotValidInGroupContextError>
fn validate_extension_type( ext: &Extension, ) -> Result<(), ExtensionTypeNotValidInGroupContextError>
Source§impl PartialEq for GroupContext
impl PartialEq for GroupContext
Source§fn eq(&self, other: &GroupContext) -> bool
fn eq(&self, other: &GroupContext) -> bool
self and other values to be equal, and is used by ==.Source§impl Serialize for &GroupContext
impl Serialize for &GroupContext
Source§impl Serialize for GroupContext
impl Serialize for GroupContext
Source§impl Serialize for GroupContext
impl Serialize for GroupContext
Source§impl Size for &GroupContext
impl Size for &GroupContext
fn tls_serialized_len(&self) -> usize
Source§impl Size for GroupContext
impl Size for GroupContext
fn tls_serialized_len(&self) -> usize
impl Entity<CURRENT_VERSION> for GroupContext
impl Eq for GroupContext
impl GroupContext<CURRENT_VERSION> for GroupContext
impl StructuralPartialEq for GroupContext
Auto Trait Implementations§
impl Freeze for GroupContext
impl RefUnwindSafe for GroupContext
impl Send for GroupContext
impl Sync for GroupContext
impl Unpin for GroupContext
impl UnsafeUnpin for GroupContext
impl UnwindSafe for GroupContext
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