Feature lock Shared, so backend feature gets a facade type
This commit is contained in:
parent
179b8d228a
commit
40bdafd1a3
|
@ -134,6 +134,7 @@ pub trait IntoShared {
|
||||||
fn into_shared(self) -> Shared<Self>;
|
fn into_shared(self) -> Shared<Self>;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[cfg(feature = "client")]
|
||||||
impl<T: Sized> IntoShared for T {
|
impl<T: Sized> IntoShared for T {
|
||||||
fn into_shared(self) -> Shared<Self> {
|
fn into_shared(self) -> Shared<Self> {
|
||||||
Arc::new(RwLock::new(self))
|
Arc::new(RwLock::new(self))
|
||||||
|
|
|
@ -28,4 +28,7 @@ mod utils;
|
||||||
///
|
///
|
||||||
/// While `T` does not have to implement `Composite` to be used with `Shared`,
|
/// While `T` does not have to implement `Composite` to be used with `Shared`,
|
||||||
/// the primary use of `Shared` is with types that implement `Composite`.
|
/// the primary use of `Shared` is with types that implement `Composite`.
|
||||||
|
#[cfg(feature = "client")]
|
||||||
pub type Shared<T> = Arc<RwLock<T>>;
|
pub type Shared<T> = Arc<RwLock<T>>;
|
||||||
|
#[cfg(not(feature = "client"))]
|
||||||
|
pub type Shared<T> = T;
|
||||||
|
|
Loading…
Reference in New Issue