pub struct Group {
pub id: String,
pub name: String,
pub creator_did: String,
pub epoch: u64,
pub members: Vec<Member>,
pub relay_url: String,
pub slot_id: String,
pub slot_token: String,
pub creator_sig: String,
}Fields§
§id: String§name: String§creator_did: String§epoch: u64Bumped on every roster mutation (add/remove). Orders revocations (T17).
members: Vec<Member>§relay_url: StringThe shared group-room slot (I2). The creator allocates one relay slot; its token is the room key, distributed only to vouched members. Everyone posts + pulls this one slot. Empty until the room is allocated.
slot_id: String§slot_token: StringShared room key — read+write bearer credential for the group slot. SECRET: held only by vouched members; a leak compromises the room (revocation = rotate the slot, the I3 kick path).
creator_sig: StringCreator’s Ed25519 signature (base64) over the canonical roster sans this field. Empty until signed.
Implementations§
Source§impl Group
impl Group
Sourcepub fn new(
id: String,
name: String,
creator_handle: String,
creator_did: String,
) -> Self
pub fn new( id: String, name: String, creator_handle: String, creator_did: String, ) -> Self
New group with the creator as the sole initial member. Unsigned — call
Group::sign with the creator’s private key.
Sourcepub fn set_room(
&mut self,
relay_url: String,
slot_id: String,
slot_token: String,
)
pub fn set_room( &mut self, relay_url: String, slot_id: String, slot_token: String, )
Attach the relay-room coords (the shared group slot). Does NOT bump epoch — set as part of the create transaction, before signing.
Sourcepub fn set_member_keys(
&mut self,
did: &str,
key_id: String,
key: String,
) -> Result<()>
pub fn set_member_keys( &mut self, did: &str, key_id: String, key: String, ) -> Result<()>
Attach a member’s signing key by DID. Does NOT bump epoch — set as part of the add transaction, before signing. Errors if the DID isn’t present.
Sourcepub fn contains_did(&self, did: &str) -> bool
pub fn contains_did(&self, did: &str) -> bool
True if did is in the roster (any tier).
Sourcepub fn other_member_handles(&self, self_did: &str) -> Vec<String>
pub fn other_member_handles(&self, self_did: &str) -> Vec<String>
Member handles excluding self — the fan-out target for a group send.
Sourcepub fn add_member(
&mut self,
handle: String,
did: String,
tier: GroupTier,
) -> Result<()>
pub fn add_member( &mut self, handle: String, did: String, tier: GroupTier, ) -> Result<()>
Add a member at tier. Bumps epoch and INVALIDATES the signature
(re-sign before persisting). Errors if the DID is already present.
Sourcepub fn remove_member(&mut self, did: &str) -> Result<String>
pub fn remove_member(&mut self, did: &str) -> Result<String>
Remove a member by DID (kick). Bumps epoch (orders the revocation)
and invalidates the signature. Refuses to remove the creator. Returns
the removed member’s handle.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Group
impl<'de> Deserialize<'de> for Group
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>,
impl Eq for Group
impl StructuralPartialEq for Group
Auto Trait Implementations§
impl Freeze for Group
impl RefUnwindSafe for Group
impl Send for Group
impl Sync for Group
impl Unpin for Group
impl UnsafeUnpin for Group
impl UnwindSafe for Group
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.