mirror of
https://github.com/mat-1/azalea.git
synced 2025-08-02 14:26:04 +00:00
Add set_state
and set_swarm_state
(#76)
* Add set_state and set_swarm_state * Add [must_use], Remove set_state, and change state to swarm_state * Forgot the other must_use * I'm not good at this
This commit is contained in:
parent
cbc6af81fb
commit
adfbb97af8
2 changed files with 12 additions and 0 deletions
|
@ -106,6 +106,12 @@ where
|
||||||
self.handler = Some(handler);
|
self.handler = Some(handler);
|
||||||
self
|
self
|
||||||
}
|
}
|
||||||
|
/// Set the client state instead of initializing defaults.
|
||||||
|
#[must_use]
|
||||||
|
pub fn set_state(mut self, state: S) -> Self {
|
||||||
|
self.state = state;
|
||||||
|
self
|
||||||
|
}
|
||||||
/// Add a plugin to the client.
|
/// Add a plugin to the client.
|
||||||
#[must_use]
|
#[must_use]
|
||||||
pub fn add_plugin<T: Plugin>(mut self, plugin: T) -> Self {
|
pub fn add_plugin<T: Plugin>(mut self, plugin: T) -> Self {
|
||||||
|
|
|
@ -199,6 +199,12 @@ where
|
||||||
self.swarm_handler = Some(handler);
|
self.swarm_handler = Some(handler);
|
||||||
self
|
self
|
||||||
}
|
}
|
||||||
|
/// Set the swarm state instead of initializing defaults.
|
||||||
|
#[must_use]
|
||||||
|
pub fn set_swarm_state(mut self, swarm_state: SS) -> Self {
|
||||||
|
self.swarm_state = swarm_state;
|
||||||
|
self
|
||||||
|
}
|
||||||
|
|
||||||
/// Add a plugin to the swarm.
|
/// Add a plugin to the swarm.
|
||||||
#[must_use]
|
#[must_use]
|
||||||
|
|
Loading…
Add table
Reference in a new issue