Signed-off-by: kjuulh <contact@kjuulh.io>
This commit is contained in:
parent
af57ef6cc8
commit
843139591c
@ -27,11 +27,11 @@ pub trait Component {
|
|||||||
|
|
||||||
#[derive(Clone)]
|
#[derive(Clone)]
|
||||||
pub struct ConcreteComponent {
|
pub struct ConcreteComponent {
|
||||||
inner: Arc<dyn Component + 'static>,
|
inner: Arc<dyn Component + Send + 'static>,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl std::ops::Deref for ConcreteComponent {
|
impl std::ops::Deref for ConcreteComponent {
|
||||||
type Target = Arc<dyn Component + 'static>;
|
type Target = Arc<dyn Component + 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 + 'static>(t: T) -> Self {
|
pub fn new<T: Component + 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 + 'static> IntoComponent for T {
|
impl<T: Component + 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