Signed-off-by: kjuulh <contact@kjuulh.io>
This commit is contained in:
parent
843139591c
commit
545439923f
@ -27,11 +27,11 @@ pub trait Component {
|
|||||||
|
|
||||||
#[derive(Clone)]
|
#[derive(Clone)]
|
||||||
pub struct ConcreteComponent {
|
pub struct ConcreteComponent {
|
||||||
inner: Arc<dyn Component + Send + 'static>,
|
inner: Arc<dyn Component + Sync + Send + 'static>,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl std::ops::Deref for ConcreteComponent {
|
impl std::ops::Deref for ConcreteComponent {
|
||||||
type Target = Arc<dyn Component + Send + 'static>;
|
type Target = Arc<dyn Component + Sync + Send + 'static>;
|
||||||
|
|
||||||
fn deref(&self) -> &Self::Target {
|
fn deref(&self) -> &Self::Target {
|
||||||
&self.inner
|
&self.inner
|
||||||
@ -39,7 +39,7 @@ impl std::ops::Deref for ConcreteComponent {
|
|||||||
}
|
}
|
||||||
|
|
||||||
impl ConcreteComponent {
|
impl ConcreteComponent {
|
||||||
pub fn new<T: Component + Send + 'static>(t: T) -> Self {
|
pub fn new<T: Component + Sync + Send + 'static>(t: T) -> Self {
|
||||||
Self { inner: Arc::new(t) }
|
Self { inner: Arc::new(t) }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -54,7 +54,7 @@ impl IntoComponent for ConcreteComponent {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<T: Component + Send + 'static> IntoComponent for T {
|
impl<T: Component + Sync + Send + 'static> IntoComponent for T {
|
||||||
fn into_component(self) -> ConcreteComponent {
|
fn into_component(self) -> ConcreteComponent {
|
||||||
ConcreteComponent::new(self)
|
ConcreteComponent::new(self)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user