From 22e8ca2a974fef2aaa74205e17f917bdfcb0b3f8 Mon Sep 17 00:00:00 2001 From: bitfl0wer Date: Sun, 21 Jan 2024 17:07:54 +0100 Subject: [PATCH] Define public method `to_shared` for dyn Composite --- src/types/entities/mod.rs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/types/entities/mod.rs b/src/types/entities/mod.rs index 8343628..8a06c35 100644 --- a/src/types/entities/mod.rs +++ b/src/types/entities/mod.rs @@ -23,6 +23,8 @@ pub use user_settings::*; pub use voice_state::*; pub use webhook::*; +use crate::gateway::Shared; + #[cfg(feature = "client")] use crate::gateway::Updateable; @@ -121,4 +123,11 @@ pub trait Composite { } vec } + + fn to_shared(self) -> Shared + where + Self: Sized, + { + Arc::new(RwLock::new(self)) + } }