Add Event::config
This commit is contained in:
parent
9315e5798c
commit
24e2da9fd3
1 changed files with 12 additions and 0 deletions
|
|
@ -184,6 +184,18 @@ pub enum Event {
|
||||||
Stopped(InstanceConfig),
|
Stopped(InstanceConfig),
|
||||||
}
|
}
|
||||||
|
|
||||||
|
impl Event {
|
||||||
|
pub fn config(&self) -> &InstanceConfig {
|
||||||
|
match self {
|
||||||
|
Self::Connecting(config) => config,
|
||||||
|
Self::Connected(config, _) => config,
|
||||||
|
Self::Packet(config, _, _) => config,
|
||||||
|
Self::Disconnected(config) => config,
|
||||||
|
Self::Stopped(config) => config,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
enum Request {
|
enum Request {
|
||||||
GetConnTx(oneshot::Sender<ConnTx>),
|
GetConnTx(oneshot::Sender<ConnTx>),
|
||||||
Stop,
|
Stop,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue