pub struct GroupMutableMetadata {
pub attributes: HashMap<String, String>,
pub admin_list: Vec<String>,
pub super_admin_list: Vec<String>,
}Expand description
Represents the mutable metadata for a group.
This struct is stored as an MLS Unknown Group Context Extension.
Fields§
§attributes: HashMap<String, String>Map to store various metadata attributes (e.g., group name, description). Allows libxmtp to receive attributes from updated versions not yet captured in MetadataField.
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§
Source§impl GroupMutableMetadata
impl GroupMutableMetadata
Sourcepub fn new(
attributes: HashMap<String, String>,
admin_list: Vec<String>,
super_admin_list: Vec<String>,
) -> Self
pub fn new( attributes: HashMap<String, String>, admin_list: Vec<String>, super_admin_list: Vec<String>, ) -> Self
Creates a new GroupMutableMetadata instance.
Sourcepub fn new_default(
creator_inbox_id: String,
commit_log_signer: Option<Secret>,
opts: GroupMetadataOptions,
) -> Self
pub fn new_default( creator_inbox_id: String, commit_log_signer: Option<Secret>, opts: GroupMetadataOptions, ) -> Self
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, ) -> Self
Sourcepub 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.
Sourcepub 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.
Sourcepub 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.
Trait Implementations§
Source§impl Clone for GroupMutableMetadata
impl Clone for GroupMutableMetadata
Source§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 moreSource§impl Debug for GroupMutableMetadata
impl Debug for GroupMutableMetadata
Source§impl PartialEq for GroupMutableMetadata
impl PartialEq for GroupMutableMetadata
Source§fn eq(&self, other: &GroupMutableMetadata) -> bool
fn eq(&self, other: &GroupMutableMetadata) -> bool
self and other values to be equal, and is used by ==.Source§impl TryFrom<&Extensions<GroupContext>> for GroupMutableMetadata
impl TryFrom<&Extensions<GroupContext>> for GroupMutableMetadata
Source§impl TryFrom<&MlsGroup> for GroupMutableMetadata
impl TryFrom<&MlsGroup> for GroupMutableMetadata
Source§impl TryFrom<GroupMutableMetadata> for Vec<u8>
impl TryFrom<GroupMutableMetadata> for Vec<u8>
Source§fn try_from(value: GroupMutableMetadata) -> Result<Self, Self::Error>
fn try_from(value: GroupMutableMetadata) -> Result<Self, Self::Error>
Converts GroupMutableMetadata to a byte vector for storage as an MLS Unknown Group Context Extension.
Source§type Error = GroupMutableMetadataError
type Error = GroupMutableMetadataError
Source§impl TryFrom<GroupMutableMetadataV1> for GroupMutableMetadata
impl TryFrom<GroupMutableMetadataV1> for GroupMutableMetadata
Source§fn try_from(value: GroupMutableMetadataProto) -> Result<Self, Self::Error>
fn try_from(value: GroupMutableMetadataProto) -> Result<Self, Self::Error>
Converts a GroupMutableMetadataProto to GroupMutableMetadata.
Source§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> 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].