mirror of
https://github.com/hl-archive-node/nanoreth.git
synced 2025-12-06 10:59:55 +00:00
chore: actually impl clone regardless of trait (#6514)
This commit is contained in:
@ -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.
|
||||
|
||||
Reference in New Issue
Block a user