pub trait ParseServerJobDeclarationMessageswhere
Self: Sized,{
// Required methods
fn handle_allocate_mining_job_token_success(
&mut self,
message: AllocateMiningJobTokenSuccess<'_>
) -> Result<SendTo, Error>;
fn handle_declare_mining_job_success(
&mut self,
message: DeclareMiningJobSuccess<'_>
) -> Result<SendTo, Error>;
fn handle_declare_mining_job_error(
&mut self,
message: DeclareMiningJobError<'_>
) -> Result<SendTo, Error>;
fn handle_identify_transactions(
&mut self,
message: IdentifyTransactions
) -> Result<SendTo, Error>;
fn handle_provide_missing_transactions(
&mut self,
message: ProvideMissingTransactions<'_>
) -> Result<SendTo, Error>;
// Provided methods
fn handle_message_job_declaration(
self_: Arc<Mutex<Self>>,
message_type: u8,
payload: &mut [u8]
) -> Result<SendTo, Error> { ... }
fn handle_message_job_declaration_deserialized(
self_: Arc<Mutex<Self>>,
message: Result<JobDeclaration<'_>, Error>
) -> Result<SendTo, Error> { ... }
}
Expand description
A trait implemented by a downstream to handle SV2 job declaration messages.
Required Methods§
sourcefn handle_allocate_mining_job_token_success(
&mut self,
message: AllocateMiningJobTokenSuccess<'_>
) -> Result<SendTo, Error>
fn handle_allocate_mining_job_token_success( &mut self, message: AllocateMiningJobTokenSuccess<'_> ) -> Result<SendTo, Error>
When upstream send AllocateMiningJobTokenSuccess self should use the received token to negotiate the next job
fn handle_declare_mining_job_success( &mut self, message: DeclareMiningJobSuccess<'_> ) -> Result<SendTo, Error>
fn handle_declare_mining_job_error( &mut self, message: DeclareMiningJobError<'_> ) -> Result<SendTo, Error>
fn handle_identify_transactions( &mut self, message: IdentifyTransactions ) -> Result<SendTo, Error>
fn handle_provide_missing_transactions( &mut self, message: ProvideMissingTransactions<'_> ) -> Result<SendTo, Error>
Provided Methods§
sourcefn handle_message_job_declaration(
self_: Arc<Mutex<Self>>,
message_type: u8,
payload: &mut [u8]
) -> Result<SendTo, Error>
fn handle_message_job_declaration( self_: Arc<Mutex<Self>>, message_type: u8, payload: &mut [u8] ) -> Result<SendTo, Error>
Used to parse job declaration message and route to the message’s respected handler function
fn handle_message_job_declaration_deserialized( self_: Arc<Mutex<Self>>, message: Result<JobDeclaration<'_>, Error> ) -> Result<SendTo, Error>
Object Safety§
This trait is not object safe.