mirror of
https://github.com/mat-1/azalea.git
synced 2025-08-02 14:26:04 +00:00
Add SwarmBuilder::add_account_with_opts (#185)
This commit is contained in:
parent
3cf17cb896
commit
a8125cd198
1 changed files with 16 additions and 3 deletions
|
@ -232,8 +232,8 @@ where
|
||||||
/// clients to have different default states, add them one at a time with
|
/// clients to have different default states, add them one at a time with
|
||||||
/// [`Self::add_account_with_state`].
|
/// [`Self::add_account_with_state`].
|
||||||
///
|
///
|
||||||
/// By default every account will join at the same time, you can add a delay
|
/// By default, every account will join at the same time, you can add a
|
||||||
/// with [`Self::join_delay`].
|
/// delay with [`Self::join_delay`].
|
||||||
#[must_use]
|
#[must_use]
|
||||||
pub fn add_accounts(mut self, accounts: Vec<Account>) -> Self
|
pub fn add_accounts(mut self, accounts: Vec<Account>) -> Self
|
||||||
where
|
where
|
||||||
|
@ -242,8 +242,10 @@ where
|
||||||
for account in accounts {
|
for account in accounts {
|
||||||
self = self.add_account(account);
|
self = self.add_account(account);
|
||||||
}
|
}
|
||||||
|
|
||||||
self
|
self
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Add a single new [`Account`] to the swarm. Use [`Self::add_accounts`] to
|
/// Add a single new [`Account`] to the swarm. Use [`Self::add_accounts`] to
|
||||||
/// add multiple accounts at a time.
|
/// add multiple accounts at a time.
|
||||||
///
|
///
|
||||||
|
@ -254,8 +256,9 @@ where
|
||||||
where
|
where
|
||||||
S: Default,
|
S: Default,
|
||||||
{
|
{
|
||||||
self.add_account_with_state(account, S::default())
|
self.add_account_with_state_and_opts(account, S::default(), JoinOpts::default())
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Add an account with a custom initial state. Use just
|
/// Add an account with a custom initial state. Use just
|
||||||
/// [`Self::add_account`] to use the Default implementation for the state.
|
/// [`Self::add_account`] to use the Default implementation for the state.
|
||||||
#[must_use]
|
#[must_use]
|
||||||
|
@ -263,6 +266,16 @@ where
|
||||||
self.add_account_with_state_and_opts(account, state, JoinOpts::default())
|
self.add_account_with_state_and_opts(account, state, JoinOpts::default())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Add an account with a custom initial state. Use just
|
||||||
|
/// [`Self::add_account`] to use the Default implementation for the state.
|
||||||
|
#[must_use]
|
||||||
|
pub fn add_account_with_opts(self, account: Account, opts: JoinOpts) -> Self
|
||||||
|
where
|
||||||
|
S: Default,
|
||||||
|
{
|
||||||
|
self.add_account_with_state_and_opts(account, S::default(), opts)
|
||||||
|
}
|
||||||
|
|
||||||
/// Same as [`Self::add_account_with_state`], but allow passing in custom
|
/// Same as [`Self::add_account_with_state`], but allow passing in custom
|
||||||
/// join options.
|
/// join options.
|
||||||
#[must_use]
|
#[must_use]
|
||||||
|
|
Loading…
Add table
Reference in a new issue