提交 196d847c authored 作者: Serhij S's avatar Serhij S

impl clone correctly

上级 d193c99b
......@@ -272,7 +272,6 @@ where
/// The context type is used to give workers access to the controller's hub, state, and shared
/// variables.
#[derive(Clone)]
pub struct Context<D, V>
where
D: DataDeliveryPolicy + Clone + Send + Sync + 'static,
......@@ -283,6 +282,20 @@ where
variables: Arc<RwLock<V>>,
}
impl<D, V> Clone for Context<D, V>
where
D: DataDeliveryPolicy + Clone + Send + Sync + 'static,
V: Send,
{
fn clone(&self) -> Self {
Self {
hub: self.hub.clone(),
state: self.state.clone(),
variables: self.variables.clone(),
}
}
}
impl<D, V> Context<D, V>
where
D: DataDeliveryPolicy + Clone + Send + Sync + 'static,
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论