diff --git a/src/types/entities/mod.rs b/src/types/entities/mod.rs index d5d70e6..5b498d6 100644 --- a/src/types/entities/mod.rs +++ b/src/types/entities/mod.rs @@ -134,6 +134,7 @@ pub trait IntoShared { fn into_shared(self) -> Shared; } +#[cfg(feature = "client")] impl IntoShared for T { fn into_shared(self) -> Shared { Arc::new(RwLock::new(self)) diff --git a/src/types/mod.rs b/src/types/mod.rs index c4cc190..9ff2c09 100644 --- a/src/types/mod.rs +++ b/src/types/mod.rs @@ -28,4 +28,7 @@ mod utils; /// /// While `T` does not have to implement `Composite` to be used with `Shared`, /// the primary use of `Shared` is with types that implement `Composite`. +#[cfg(feature = "client")] pub type Shared = Arc>; +#[cfg(not(feature = "client"))] +pub type Shared = T;