pub fn remove_members(
        &self,
        action_type: ActionType,
        group_id: &GroupId,
        target_indices: &[usize],
    ) -> Result<(Vec<MlsMessageOut>, Option<Welcome>), ClientError> {
        let mut groups = self.groups.borrow_mut();
        let group = groups
            .get_mut(group_id)
            .ok_or(ClientError::NoMatchingGroup)?;
        let action_results = match action_type {
            ActionType::Commit => {
                let (message, welcome_option) =
                    group.remove_members(&self.crypto, target_indices)?;
                (vec![message], welcome_option)
            }
            ActionType::Proposal => {
                let mut messages = Vec::new();
                for &target_index in target_indices {
                    let message = group.propose_remove_member(&self.crypto, target_index)?;
                    messages.push(message);
                }
                (messages, None)
            }
        };
        Ok(action_results)
    }
/// Have the client either propose or commit (depending on the
/// `action_type`) removing the clients with the given indices from the
/// group with the given group id. Returns an error if no group with the
/// given group id can be found or if an error occurs while performing the
/// remove operation.
Have the client either propose or commit (depending on the
`action_type`) removing the clients with the given indices from the
group with the given group id. Returns an error if no group with the
given group id can be found or if an error occurs while performing the
remove operation.
Have the client either propose or commit ( depending on the ` action_type ` ) removing the clients with the given indices from the group with the given group id . Returns an error if no group with the given group id can be found or if an error occurs while performing the remove operation .
pub fn remove_members(
        &self,
        action_type: ActionType,
        group_id: &GroupId,
        target_indices: &[usize],
    ) -> Result<(Vec<MlsMessageOut>, Option<Welcome>), ClientError> {
        let mut groups = self.groups.borrow_mut();
        let group = groups
            .get_mut(group_id)
            .ok_or(ClientError::NoMatchingGroup)?;
        let action_results = match action_type {
            ActionType::Commit => {
                let (message, welcome_option) =
                    group.remove_members(&self.crypto, target_indices)?;
                (vec![message], welcome_option)
            }
            ActionType::Proposal => {
                let mut messages = Vec::new();
                for &target_index in target_indices {
                    let message = group.propose_remove_member(&self.crypto, target_index)?;
                    messages.push(message);
                }
                (messages, None)
            }
        };
        Ok(action_results)
    }
pub fn remove_members ( & self , action_type : ActionType , group_id : & GroupId , target_indices : & [ usize ] , ) -> Result < ( Vec < MlsMessageOut > , Option < Welcome > ) , ClientError > { let mut groups = self . groups . borrow_mut ( ) ; let group = groups . get_mut ( group_id ) . ok_or ( ClientError :: NoMatchingGroup ) ? ; let action_results = match action_type { ActionType :: Commit => { let ( message , welcome_option ) = group . remove_members ( & self . crypto , target_indices ) ? ; ( vec ! [ message ] , welcome_option ) } ActionType :: Proposal => { let mut messages = Vec :: new ( ) ; for & target_index in target_indices { let message = group . propose_remove_member ( & self . crypto , target_index ) ? ; messages . push ( message ) ; } ( messages , None ) } } ; Ok ( action_results ) }
Have the client either propose or commit (depending on the
`action_type`) removing the clients with the given indices from the
group with the given group id.
Have the client either propose or commit ( depending on the ` action_type ` ) removing the clients with the given indices from the group with the given group id .
&self
action_type
ActionType
group_id
&GroupId
target_indices
&[usize]
&self
action_type
ActionType
group_id
&GroupId
target_indices
&[usize]