pub fn new(
        default_mgc: ManagedGroupConfig,
        number_of_clients: usize,
        use_codec: CodecUse,
    ) -> Self {
        let mut clients = HashMap::new();
        for i in 0..number_of_clients {
            let identity = i.to_be_bytes().to_vec();
            // For now, everyone supports all ciphersuites.
            let crypto = OpenMlsRustCrypto::default();
            let mut credentials = HashMap::new();
            for ciphersuite in Config::supported_ciphersuite_names() {
                let cb = CredentialBundle::new(
                    identity.clone(),
                    CredentialType::Basic,
                    SignatureScheme::from(*ciphersuite),
                    &crypto,
                )
                .unwrap();
                let credential = cb.credential().clone();
                crypto
                    .key_store()
                    .store(cb.credential().signature_key(), &cb)
                    .unwrap();
                credentials.insert(*ciphersuite, credential);
            }
            let client = Client {
                identity: identity.clone(),
                credentials,
                crypto,
                groups: RefCell::new(HashMap::new()),
            };
            clients.insert(identity, RefCell::new(client));
        }
        let groups = RefCell::new(HashMap::new());
        let waiting_for_welcome = RefCell::new(HashMap::new());
        ManagedTestSetup {
            clients: RefCell::new(clients),
            groups,
            waiting_for_welcome,
            default_mgc,
            use_codec,
        }
    }
/// Create a new `ManagedTestSetup` with the given default
/// `ManagedGroupConfig` and the given number of clients. For lifetime
/// reasons, `create_clients` has to be called in addition with the same
/// number of clients.
Create a new `ManagedTestSetup` with the given default
`ManagedGroupConfig` and the given number of clients. For lifetime
reasons, `create_clients` has to be called in addition with the same
number of clients.
Create a new ` ManagedTestSetup ` with the given default ` ManagedGroupConfig ` and the given number of clients . For lifetime reasons ` create_clients ` has to be called in addition with the same number of clients .
pub fn new(
        default_mgc: ManagedGroupConfig,
        number_of_clients: usize,
        use_codec: CodecUse,
    ) -> Self {
        let mut clients = HashMap::new();
        for i in 0..number_of_clients {
            let identity = i.to_be_bytes().to_vec();
            // For now, everyone supports all ciphersuites.
            let crypto = OpenMlsRustCrypto::default();
            let mut credentials = HashMap::new();
            for ciphersuite in Config::supported_ciphersuite_names() {
                let cb = CredentialBundle::new(
                    identity.clone(),
                    CredentialType::Basic,
                    SignatureScheme::from(*ciphersuite),
                    &crypto,
                )
                .unwrap();
                let credential = cb.credential().clone();
                crypto
                    .key_store()
                    .store(cb.credential().signature_key(), &cb)
                    .unwrap();
                credentials.insert(*ciphersuite, credential);
            }
            let client = Client {
                identity: identity.clone(),
                credentials,
                crypto,
                groups: RefCell::new(HashMap::new()),
            };
            clients.insert(identity, RefCell::new(client));
        }
        let groups = RefCell::new(HashMap::new());
        let waiting_for_welcome = RefCell::new(HashMap::new());
        ManagedTestSetup {
            clients: RefCell::new(clients),
            groups,
            waiting_for_welcome,
            default_mgc,
            use_codec,
        }
    }
pub fn new ( default_mgc : ManagedGroupConfig , number_of_clients : usize , use_codec : CodecUse , ) -> Self { let mut clients = HashMap :: new ( ) ; for i in 0 .. number_of_clients { let identity = i . to_be_bytes ( ) . to_vec ( ) ; // For now, everyone supports all ciphersuites. let crypto = OpenMlsRustCrypto :: default ( ) ; let mut credentials = HashMap :: new ( ) ; for ciphersuite in Config :: supported_ciphersuite_names ( ) { let cb = CredentialBundle :: new ( identity . clone ( ) , CredentialType :: Basic , SignatureScheme :: from ( * ciphersuite ) , & crypto , ) . unwrap ( ) ; let credential = cb . credential ( ) . clone ( ) ; crypto . key_store ( ) . store ( cb . credential ( ) . signature_key ( ) , & cb ) . unwrap ( ) ; credentials . insert ( * ciphersuite , credential ) ; } let client = Client { identity : identity . clone ( ) , credentials , crypto , groups : RefCell :: new ( HashMap :: new ( ) ) , } ; clients . insert ( identity , RefCell :: new ( client ) ) ; } let groups = RefCell :: new ( HashMap :: new ( ) ) ; let waiting_for_welcome = RefCell :: new ( HashMap :: new ( ) ) ; ManagedTestSetup { clients : RefCell :: new ( clients ) , groups , waiting_for_welcome , default_mgc , use_codec , } }
Create a new `ManagedTestSetup` with the given default
`ManagedGroupConfig` and the given number of clients.
Create a new ` ManagedTestSetup ` with the given default ` ManagedGroupConfig ` and the given number of clients .
default_mgc
ManagedGroupConfig
number_of_clients
usize
use_codec
CodecUse
default_mgc
ManagedGroupConfig
number_of_clients
usize
use_codec
CodecUse