Trait subspace_farmer::plotter::Plotter

source ·
pub trait Plotter: Debug {
    // Required methods
    fn has_free_capacity<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = Result<bool, String>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn plot_sector<'life0, 'async_trait>(
        &'life0 self,
        public_key: PublicKey,
        sector_index: SectorIndex,
        farmer_protocol_info: FarmerProtocolInfo,
        pieces_in_sector: u16,
        replotting: bool,
        progress_sender: Sender<SectorPlottingProgress>,
    ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn try_plot_sector<'life0, 'async_trait>(
        &'life0 self,
        public_key: PublicKey,
        sector_index: SectorIndex,
        farmer_protocol_info: FarmerProtocolInfo,
        pieces_in_sector: u16,
        replotting: bool,
        progress_sender: Sender<SectorPlottingProgress>,
    ) -> Pin<Box<dyn Future<Output = bool> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
}
Expand description

Abstract plotter implementation

Required Methods§

source

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

Whether plotter has free capacity to encode more sectors

source

fn plot_sector<'life0, 'async_trait>( &'life0 self, public_key: PublicKey, sector_index: SectorIndex, farmer_protocol_info: FarmerProtocolInfo, pieces_in_sector: u16, replotting: bool, progress_sender: Sender<SectorPlottingProgress>, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Plot one sector, sending sector plotting events via provided stream.

Future returns once plotting is successfully scheduled (for backpressure purposes).

source

fn try_plot_sector<'life0, 'async_trait>( &'life0 self, public_key: PublicKey, sector_index: SectorIndex, farmer_protocol_info: FarmerProtocolInfo, pieces_in_sector: u16, replotting: bool, progress_sender: Sender<SectorPlottingProgress>, ) -> Pin<Box<dyn Future<Output = bool> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Try to plot one sector, sending sector plotting events via provided stream.

Returns true if plotting started successfully and false if there is no capacity to start plotting immediately.

Implementations on Foreign Types§

source§

impl<P> Plotter for Arc<P>
where P: Plotter + Send + Sync,

source§

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

source§

fn plot_sector<'life0, 'async_trait>( &'life0 self, public_key: PublicKey, sector_index: SectorIndex, farmer_protocol_info: FarmerProtocolInfo, pieces_in_sector: u16, replotting: bool, progress_sender: Sender<SectorPlottingProgress>, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

source§

fn try_plot_sector<'life0, 'async_trait>( &'life0 self, public_key: PublicKey, sector_index: SectorIndex, farmer_protocol_info: FarmerProtocolInfo, pieces_in_sector: u16, replotting: bool, progress_sender: Sender<SectorPlottingProgress>, ) -> Pin<Box<dyn Future<Output = bool> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Implementors§

source§

impl Plotter for ClusterPlotter

source§

impl Plotter for PoolPlotter

source§

impl<PG, GRE> Plotter for GpuPlotter<PG, GRE>
where PG: PieceGetter + Clone + Send + Sync + 'static, GRE: GpuRecordsEncoder + 'static,

source§

impl<PG, PosTable> Plotter for CpuPlotter<PG, PosTable>
where PG: PieceGetter + Clone + Send + Sync + 'static, PosTable: Table,