chore: actually impl clone regardless of trait (#6514)

This commit is contained in:
Matthias Seitz
2024-02-09 17:26:08 +01:00
committed by GitHub
parent 1127af6841
commit 3ae2611c9c

View File

@ -24,7 +24,7 @@ use tracing::{debug, info, trace, warn};
type PayloadFuture<P> = Pin<Box<dyn Future<Output = Result<P, PayloadBuilderError>> + Send + Sync>>;
/// A communication channel to the [PayloadBuilderService] that can retrieve payloads.
#[derive(Debug, Clone)]
#[derive(Debug)]
pub struct PayloadStore<Engine: EngineTypes> {
inner: PayloadBuilderHandle<Engine>,
}
@ -67,6 +67,15 @@ where
}
}
impl<Engine> Clone for PayloadStore<Engine>
where
Engine: EngineTypes,
{
fn clone(&self) -> Self {
Self { inner: self.inner.clone() }
}
}
impl<Engine> From<PayloadBuilderHandle<Engine>> for PayloadStore<Engine>
where
Engine: EngineTypes,
@ -79,7 +88,7 @@ where
/// A communication channel to the [PayloadBuilderService].
///
/// This is the API used to create new payloads and to get the current state of existing ones.
#[derive(Debug, Clone)]
#[derive(Debug)]
pub struct PayloadBuilderHandle<Engine: EngineTypes> {
/// Sender half of the message channel to the [PayloadBuilderService].
to_service: mpsc::UnboundedSender<PayloadServiceCommand<Engine>>,
@ -163,6 +172,15 @@ where
}
}
impl<Engine> Clone for PayloadBuilderHandle<Engine>
where
Engine: EngineTypes,
{
fn clone(&self) -> Self {
Self { to_service: self.to_service.clone() }
}
}
/// A service that manages payload building tasks.
///
/// This type is an endless future that manages the building of payloads.