Define public method `to_shared` for dyn Composite
This commit is contained in:
parent
0660e25bdb
commit
2a7cae30b8
|
@ -23,6 +23,8 @@ pub use user_settings::*;
|
||||||
pub use voice_state::*;
|
pub use voice_state::*;
|
||||||
pub use webhook::*;
|
pub use webhook::*;
|
||||||
|
|
||||||
|
use crate::gateway::Shared;
|
||||||
|
|
||||||
#[cfg(feature = "client")]
|
#[cfg(feature = "client")]
|
||||||
use crate::gateway::Updateable;
|
use crate::gateway::Updateable;
|
||||||
|
|
||||||
|
@ -121,4 +123,11 @@ pub trait Composite<T: Updateable + Clone + Debug> {
|
||||||
}
|
}
|
||||||
vec
|
vec
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn to_shared(self) -> Shared<Self>
|
||||||
|
where
|
||||||
|
Self: Sized,
|
||||||
|
{
|
||||||
|
Arc::new(RwLock::new(self))
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue