enostr: add PoolEventBuf
to simplify lifetimes in some situations Signed-off-by: William Casarin <jb55@jb55.com>
This commit is contained in:
@@ -18,6 +18,20 @@ pub struct PoolEvent<'a> {
|
|||||||
pub event: ewebsock::WsEvent,
|
pub event: ewebsock::WsEvent,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
impl<'a> PoolEvent<'a> {
|
||||||
|
pub fn into_owned(self) -> PoolEventBuf {
|
||||||
|
PoolEventBuf {
|
||||||
|
relay: self.relay.to_owned(),
|
||||||
|
event: self.event
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
pub struct PoolEventBuf {
|
||||||
|
pub relay: String,
|
||||||
|
pub event: ewebsock::WsEvent,
|
||||||
|
}
|
||||||
|
|
||||||
pub struct PoolRelay {
|
pub struct PoolRelay {
|
||||||
pub relay: Relay,
|
pub relay: Relay,
|
||||||
pub last_ping: Instant,
|
pub last_ping: Instant,
|
||||||
|
|||||||
Reference in New Issue
Block a user