GroupState

Struct GroupState 

Source
pub struct GroupState<'a, Provider> { /* private fields */ }
Available on (32-bit or 64-bit) and (crate features test-utils) only.
Expand description

All of the state for a group and its members

Implementations§

Source§

impl<Provider: OpenMlsProvider> GroupState<'_, Provider>

Source§

impl<'a, Provider: OpenMlsProvider> GroupState<'a, Provider>

Source

pub fn new_from_party( group_id: GroupId, pre_group_state: PreGroupPartyState<'a, Provider>, mls_group_create_config: MlsGroupCreateConfig, ) -> Result<Self, GroupError<Provider>>

Create a new GroupState from a single party

Source

pub fn members_mut<const N: usize>( &mut self, names: &[&'static str; N], ) -> [&mut MemberState<'a, Provider>; N]

Get mutable references to specified MemberStates as a fixed-size array, in the order of the names provided in names. At least one member must be requested.

Source

pub fn deliver_and_apply( &mut self, message: MlsMessageIn, ) -> Result<(), GroupError<Provider>>

Deliver_and_apply a message to all parties

Source

pub fn deliver_and_apply_if( &mut self, message: MlsMessageIn, condition: impl Fn(&MemberState<'a, Provider>) -> bool, ) -> Result<(), GroupError<Provider>>

Deliver_and_apply a message to all parties if a provided condition is met

Source

pub fn deliver_and_apply_welcome( &mut self, recipient: PreGroupPartyState<'a, Provider>, mls_group_join_config: MlsGroupJoinConfig, welcome: Welcome, tree: Option<RatchetTreeIn>, ) -> Result<(), GroupError<Provider>>

Deliver_and_apply a welcome to a single party, and initialize a group for that party

Source

pub fn untrack_member(&mut self, name: &'static str)

Drop a member from the internal hashmap. This does not delete the member from any MlsGroup

Source

pub fn add_member( &mut self, add_config: AddMemberConfig<'a, Provider>, ) -> Result<(), GroupError<Provider>>

Source

pub fn group_id(&self) -> GroupId

Returns a copy of the GroupId

Auto Trait Implementations§

§

impl<'a, Provider> Freeze for GroupState<'a, Provider>

§

impl<'a, Provider> RefUnwindSafe for GroupState<'a, Provider>
where Provider: RefUnwindSafe,

§

impl<'a, Provider> Send for GroupState<'a, Provider>
where Provider: Sync,

§

impl<'a, Provider> Sync for GroupState<'a, Provider>
where Provider: Sync,

§

impl<'a, Provider> Unpin for GroupState<'a, Provider>

§

impl<'a, Provider> UnwindSafe for GroupState<'a, Provider>
where Provider: RefUnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> Classify for T

§

type Classified = T

§

fn classify(self) -> T

§

impl<T> Declassify for T

§

type Declassified = T

§

fn declassify(self) -> T

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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> Pointable for T

§

const ALIGN: usize

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V