Struct GroupMutableMetadata
pub struct GroupMutableMetadata {
pub admin_list: Vec<String>,
pub super_admin_list: Vec<String>,
/* private fields */
}Expand description
Represents the mutable metadata for a group.
This struct is stored as an MLS Unknown Group Context Extension.
The _commit_log_signer attribute holds the group’s commit-log private key
as hex. Debug redacts it and it is wiped on drop. The attribute map is
private: read it with GroupMutableMetadata::attributes and change it
with GroupMutableMetadata::insert_attribute and
GroupMutableMetadata::remove_attribute, which wipe the value they
replace or remove.
Fields§
§admin_list: Vec<String>List of admin inbox IDs for this group.
See GroupMutablePermissions for more details on admin permissions.
super_admin_list: Vec<String>List of super admin inbox IDs for this group.
See GroupMutablePermissions for more details on super admin permissions.
Implementations§
§impl GroupMutableMetadata
impl GroupMutableMetadata
pub fn new(
attributes: HashMap<String, String>,
admin_list: Vec<String>,
super_admin_list: Vec<String>,
) -> GroupMutableMetadata
pub fn new( attributes: HashMap<String, String>, admin_list: Vec<String>, super_admin_list: Vec<String>, ) -> GroupMutableMetadata
Creates a new GroupMutableMetadata instance.
pub fn new_default(
creator_inbox_id: String,
commit_log_signer: Option<Secret>,
opts: GroupMetadataOptions,
) -> GroupMutableMetadata
pub fn new_default( creator_inbox_id: String, commit_log_signer: Option<Secret>, opts: GroupMetadataOptions, ) -> GroupMutableMetadata
Creates a new GroupMutableMetadata instance with default values.
The creator is automatically added as a super admin.
See GroupMutablePermissions for more details on super admin permissions.
pub fn new_dm_default( _creator_inbox_id: String, _dm_target_inbox_id: &str, commit_log_signer: Option<Secret>, opts: DMMetadataOptions, ) -> GroupMutableMetadata
pub fn supported_fields() -> Vec<MetadataField>
pub fn supported_fields() -> Vec<MetadataField>
Returns a vector of supported metadata fields.
These fields will receive default permission policies for new groups.
pub fn is_super_admin(&self, inbox_id: &String) -> bool
pub fn is_super_admin(&self, inbox_id: &String) -> bool
Checks if the given inbox ID is a super admin.
pub fn commit_log_signer(&self) -> Option<Secret>
pub fn commit_log_signer(&self) -> Option<Secret>
Retrieves the commit log signer secret from the metadata attributes. Returns None if the field is not present or if hex decoding fails.
The hex decodes straight into the zeroizing buffer that the Secret
takes over. A 0x or 0X prefix is accepted, as hex::decode does.
pub fn attributes(&self) -> &HashMap<String, String>
pub fn attributes(&self) -> &HashMap<String, String>
The attributes, read-only. Change them with
Self::insert_attribute and Self::remove_attribute.
pub fn take_attributes(&mut self) -> HashMap<String, String>
pub fn take_attributes(&mut self) -> HashMap<String, String>
Move the attributes out, leaving the map empty. The caller owns the values, the commit-log signer included.
pub fn insert_attribute(&mut self, key: String, value: String)
pub fn insert_attribute(&mut self, key: String, value: String)
Set an attribute, wiping the value it replaces.
pub fn remove_attribute(&mut self, key: &str)
pub fn remove_attribute(&mut self, key: &str)
Remove an attribute, wiping its value.
Trait Implementations§
§impl Clone for GroupMutableMetadata
impl Clone for GroupMutableMetadata
§fn clone(&self) -> GroupMutableMetadata
fn clone(&self) -> GroupMutableMetadata
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more§impl Debug for GroupMutableMetadata
impl Debug for GroupMutableMetadata
§impl Drop for GroupMutableMetadata
impl Drop for GroupMutableMetadata
§impl PartialEq for GroupMutableMetadata
impl PartialEq for GroupMutableMetadata
§fn eq(&self, other: &GroupMutableMetadata) -> bool
fn eq(&self, other: &GroupMutableMetadata) -> bool
self and other values to be equal, and is used by ==.§impl TryFrom<&Vec<u8>> for GroupMutableMetadata
impl TryFrom<&Vec<u8>> for GroupMutableMetadata
§fn try_from(
value: &Vec<u8>,
) -> Result<GroupMutableMetadata, <GroupMutableMetadata as TryFrom<&Vec<u8>>>::Error>
fn try_from( value: &Vec<u8>, ) -> Result<GroupMutableMetadata, <GroupMutableMetadata as TryFrom<&Vec<u8>>>::Error>
Converts a byte vector to GroupMutableMetadata.
§type Error = GroupMutableMetadataError
type Error = GroupMutableMetadataError
§impl TryFrom<GroupMutableMetadata> for Vec<u8>
impl TryFrom<GroupMutableMetadata> for Vec<u8>
§fn try_from(
value: GroupMutableMetadata,
) -> Result<Vec<u8>, <Vec<u8> as TryFrom<GroupMutableMetadata>>::Error>
fn try_from( value: GroupMutableMetadata, ) -> Result<Vec<u8>, <Vec<u8> as TryFrom<GroupMutableMetadata>>::Error>
Converts GroupMutableMetadata to a byte vector for storage as an MLS Unknown Group Context Extension.
The attributes move into the proto, whose signer value is wiped after encoding. The returned bytes are the extension handed to OpenMLS.
§type Error = GroupMutableMetadataError
type Error = GroupMutableMetadataError
§impl TryFrom<GroupMutableMetadataV1> for GroupMutableMetadata
impl TryFrom<GroupMutableMetadataV1> for GroupMutableMetadata
§fn try_from(
value: GroupMutableMetadataV1,
) -> Result<GroupMutableMetadata, <GroupMutableMetadata as TryFrom<GroupMutableMetadataV1>>::Error>
fn try_from( value: GroupMutableMetadataV1, ) -> Result<GroupMutableMetadata, <GroupMutableMetadata as TryFrom<GroupMutableMetadataV1>>::Error>
Converts a GroupMutableMetadataProto to GroupMutableMetadata.
§type Error = GroupMutableMetadataError
type Error = GroupMutableMetadataError
impl StructuralPartialEq for GroupMutableMetadata
Auto Trait Implementations§
impl Freeze for GroupMutableMetadata
impl RefUnwindSafe for GroupMutableMetadata
impl Send for GroupMutableMetadata
impl Sync for GroupMutableMetadata
impl Unpin for GroupMutableMetadata
impl UnsafeUnpin for GroupMutableMetadata
impl UnwindSafe for GroupMutableMetadata
Blanket Implementations§
§impl<T> AggregateExpressionMethods for T
impl<T> AggregateExpressionMethods for T
§fn aggregate_distinct(self) -> Self::Outputwhere
Self: DistinctDsl,
fn aggregate_distinct(self) -> Self::Outputwhere
Self: DistinctDsl,
DISTINCT modifier for aggregate functions Read more§fn aggregate_all(self) -> Self::Outputwhere
Self: AllDsl,
fn aggregate_all(self) -> Self::Outputwhere
Self: AllDsl,
ALL modifier for aggregate functions Read more§fn aggregate_filter<P>(self, f: P) -> Self::Outputwhere
P: AsExpression<Bool>,
Self: FilterDsl<<P as AsExpression<Bool>>::Expression>,
fn aggregate_filter<P>(self, f: P) -> Self::Outputwhere
P: AsExpression<Bool>,
Self: FilterDsl<<P as AsExpression<Bool>>::Expression>,
§fn aggregate_order<O>(self, o: O) -> Self::Outputwhere
Self: OrderAggregateDsl<O>,
fn aggregate_order<O>(self, o: O) -> Self::Outputwhere
Self: OrderAggregateDsl<O>,
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be
downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further
downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.§impl<T> DowncastSend for T
impl<T> DowncastSend for T
§impl<T> DowncastSync for T
impl<T> DowncastSync for T
§impl<T> FutureExt for T
impl<T> FutureExt for T
§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
§impl<T> Identity for Twhere
T: ?Sized,
impl<T> Identity for Twhere
T: ?Sized,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request§impl<T> IntoSql for T
impl<T> IntoSql for T
§impl<L> LayerExt<L> for L
impl<L> LayerExt<L> for L
§fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
Layered].