Trait subspace_farmer::node_client::NodeClient

source ·
pub trait NodeClient:
    Debug
    + Send
    + Sync
    + 'static {
    // Required methods
    fn farmer_app_info<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = Result<FarmerAppInfo, Error>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn subscribe_slot_info<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = Result<Pin<Box<dyn Stream<Item = SlotInfo> + Send + 'static>>, Error>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn submit_solution_response<'life0, 'async_trait>(
        &'life0 self,
        solution_response: SolutionResponse,
    ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn subscribe_reward_signing<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = Result<Pin<Box<dyn Stream<Item = RewardSigningInfo> + Send + 'static>>, Error>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn submit_reward_signature<'life0, 'async_trait>(
        &'life0 self,
        reward_signature: RewardSignatureResponse,
    ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn subscribe_archived_segment_headers<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = Result<Pin<Box<dyn Stream<Item = SegmentHeader> + Send + 'static>>, Error>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn segment_headers<'life0, 'async_trait>(
        &'life0 self,
        segment_indices: Vec<SegmentIndex>,
    ) -> Pin<Box<dyn Future<Output = Result<Vec<Option<SegmentHeader>>, Error>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn piece<'life0, 'async_trait>(
        &'life0 self,
        piece_index: PieceIndex,
    ) -> Pin<Box<dyn Future<Output = Result<Option<Piece>, Error>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn acknowledge_archived_segment_header<'life0, 'async_trait>(
        &'life0 self,
        segment_index: SegmentIndex,
    ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
}
Expand description

Abstraction of the Node Client

Required Methods§

source

fn farmer_app_info<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<FarmerAppInfo, Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Get farmer app info

source

fn subscribe_slot_info<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<Pin<Box<dyn Stream<Item = SlotInfo> + Send + 'static>>, Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Subscribe to slot

source

fn submit_solution_response<'life0, 'async_trait>( &'life0 self, solution_response: SolutionResponse, ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Submit a slot solution

source

fn subscribe_reward_signing<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<Pin<Box<dyn Stream<Item = RewardSigningInfo> + Send + 'static>>, Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Subscribe to block signing request

source

fn submit_reward_signature<'life0, 'async_trait>( &'life0 self, reward_signature: RewardSignatureResponse, ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Submit a block signature

source

fn subscribe_archived_segment_headers<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<Pin<Box<dyn Stream<Item = SegmentHeader> + Send + 'static>>, Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Subscribe to archived segment headers

source

fn segment_headers<'life0, 'async_trait>( &'life0 self, segment_indices: Vec<SegmentIndex>, ) -> Pin<Box<dyn Future<Output = Result<Vec<Option<SegmentHeader>>, Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Get segment headers for the segments

source

fn piece<'life0, 'async_trait>( &'life0 self, piece_index: PieceIndex, ) -> Pin<Box<dyn Future<Output = Result<Option<Piece>, Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Get piece by index.

source

fn acknowledge_archived_segment_header<'life0, 'async_trait>( &'life0 self, segment_index: SegmentIndex, ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Acknowledge segment header.

Implementors§