// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. // Copyright by contributors to this project. // SPDX-License-Identifier: (Apache-2.0 OR MIT)
use alloc::vec; use alloc::vec::Vec; use mls_rs_codec::{MlsDecode, MlsEncode, MlsSize};
/// A member of a MLS group. // #[cfg_attr( // all(feature = "ffi", not(test)), // safer_ffi_gen::ffi_type(clone, opaque) // )] #[derive(Debug, Clone, PartialEq, Eq)] #[non_exhaustive] pubstruct Member { /// The index of this member within a group. /// /// This value is consistent for all clients and will not change as the /// group evolves. pub index: u32, /// Current identity public key and credential of this member. pub signing_identity: SigningIdentity, /// Current client [Capabilities] of this member. pub capabilities: Capabilities, /// Current leaf node extensions in use by this member. pub extensions: ExtensionList,
}
/// The index of this member within a group. /// /// This value is consistent for all clients and will not change as the /// group evolves. #[cfg(feature = "ffi")] pubfn index(&self) -> u32 { self.index
}
/// Current identity public key and credential of this member. #[cfg(feature = "ffi")] pubfn signing_identity(&self) -> &SigningIdentity {
&self.signing_identity
}
/// Current client [Capabilities] of this member. #[cfg(feature = "ffi")] pubfn capabilities(&self) -> &Capabilities {
&self.capabilities
}
/// Current leaf node extensions in use by this member. #[cfg(feature = "ffi")] pubfn extensions(&self) -> &ExtensionList {
&self.extensions
}
}
#[derive(Clone, Debug, PartialEq)] #[non_exhaustive] // #[cfg_attr( // all(feature = "ffi", not(test)), // safer_ffi_gen::ffi_type(clone, opaque) // )] /// Update of a member due to a commit. pubstruct MemberUpdate { pub prior: Member, pub new: Member,
}
// #[cfg_attr(all(feature = "ffi", not(test)), safer_ffi_gen::safer_ffi_gen)] impl MemberUpdate { /// Create a new member update. pubfn new(prior: Member, new: Member) -> MemberUpdate {
MemberUpdate { prior, new }
}
/// The index that was updated. pubfn index(&self) -> u32 { self.new.index
}
/// Member state before the update. #[cfg(feature = "ffi")] pubfn before_update(&self) -> &Member {
&self.prior
}
/// Member state after the update. #[cfg(feature = "ffi")] pubfn after_update(&self) -> &Member {
&self.new
}
}
/// A set of roster updates due to a commit. #[derive(Clone, Debug, PartialEq)] #[non_exhaustive] pubstruct RosterUpdate { pub(crate) added: Vec<Member>, pub(crate) removed: Vec<Member>, pub(crate) updated: Vec<MemberUpdate>,
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.