pub struct CpuPlotter<PG, PosTable> { /* private fields */ }Expand description
CPU plotter
Implementations§
Source§impl<PG, PosTable> CpuPlotter<PG, PosTable>
impl<PG, PosTable> CpuPlotter<PG, PosTable>
Sourcepub fn new(
piece_getter: PG,
downloading_semaphore: StdArc<Semaphore>,
plotting_thread_pool_manager: PlottingThreadPoolManager,
record_encoding_concurrency: NonZeroUsize,
global_mutex: Arc<AsyncMutex<()>>,
erasure_coding: ErasureCoding,
registry: Option<&mut Registry>,
) -> Self
pub fn new( piece_getter: PG, downloading_semaphore: StdArc<Semaphore>, plotting_thread_pool_manager: PlottingThreadPoolManager, record_encoding_concurrency: NonZeroUsize, global_mutex: Arc<AsyncMutex<()>>, erasure_coding: ErasureCoding, registry: Option<&mut Registry>, ) -> Self
Create a new instance
Sourcepub fn on_plotting_progress(
&self,
callback: HandlerFn3<Ed25519PublicKey, SectorIndex, SectorPlottingProgress>,
) -> HandlerId
pub fn on_plotting_progress( &self, callback: HandlerFn3<Ed25519PublicKey, SectorIndex, SectorPlottingProgress>, ) -> HandlerId
Subscribe to plotting progress notifications
Trait Implementations§
Source§impl<PG, PosTable> Debug for CpuPlotter<PG, PosTable>
impl<PG, PosTable> Debug for CpuPlotter<PG, PosTable>
Source§impl<PG, PosTable> Drop for CpuPlotter<PG, PosTable>
impl<PG, PosTable> Drop for CpuPlotter<PG, PosTable>
Source§impl<PG, PosTable> Plotter for CpuPlotter<PG, PosTable>
impl<PG, PosTable> Plotter for CpuPlotter<PG, PosTable>
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,
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: Ed25519PublicKey,
shard_commitments_root: ShardCommitmentHash,
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 plot_sector<'life0, 'async_trait>(
&'life0 self,
public_key: Ed25519PublicKey,
shard_commitments_root: ShardCommitmentHash,
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 the provided stream. Read more
Source§fn try_plot_sector<'life0, 'async_trait>(
&'life0 self,
public_key: Ed25519PublicKey,
shard_commitments_root: ShardCommitmentHash,
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,
fn try_plot_sector<'life0, 'async_trait>(
&'life0 self,
public_key: Ed25519PublicKey,
shard_commitments_root: ShardCommitmentHash,
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 the provided stream. Read more
Auto Trait Implementations§
impl<PG, PosTable> !RefUnwindSafe for CpuPlotter<PG, PosTable>
impl<PG, PosTable> !UnwindSafe for CpuPlotter<PG, PosTable>
impl<PG, PosTable> Forget for CpuPlotter<PG, PosTable>
impl<PG, PosTable> Freeze for CpuPlotter<PG, PosTable>where
PG: Freeze,
*const ArcInner<Semaphore> is !null: Freeze,
PhantomData<ArcInner<Semaphore>>: Freeze,
*const ArcInner<(Mutex<RawMutex, Inner>, Event)> is !null: Freeze,
PhantomData<(Mutex<RawMutex, Inner>, Event)>: Freeze,
NonZero<usize>: Freeze,
*const ArcInner<Mutex<()>> is !null: Freeze,
PhantomData<Mutex<()>>: Freeze,
*const ArcInner<Handlers> is !null: Freeze,
PhantomData<Handlers>: Freeze,
*const ArcInner<BoundedInner<AsyncJoinOnDrop<()>>> is !null: Freeze,
PhantomData<ArcInner<BoundedInner<AsyncJoinOnDrop<()>>>>: Freeze,
*const ArcInner<Mutex<SenderTask>> is !null: Freeze,
PhantomData<ArcInner<Mutex<SenderTask>>>: Freeze,
*const Header is !null: Freeze,
PhantomData<()>: Freeze,
*const ArcInner<Atomic<bool>> is !null: Freeze,
PhantomData<Atomic<bool>>: Freeze,
*const ArcInner<CpuPlotterMetrics> is !null: Freeze,
PhantomData<CpuPlotterMetrics>: Freeze,
PhantomData<PosTable>: Freeze,
impl<PG, PosTable> Move for CpuPlotter<PG, PosTable>
impl<PG, PosTable> Send for CpuPlotter<PG, PosTable>where
PosTable: Send,
PG: Send,
Arc<Semaphore>: Send,
Arc<(Mutex<RawMutex, Inner>, Event)>: Send,
NonZero<usize>: Send,
Arc<Mutex<()>>: Send,
Arc<Handlers>: Send,
Arc<BoundedInner<AsyncJoinOnDrop<()>>>: Send,
Arc<Mutex<SenderTask>>: Send,
JoinHandle<()>: Send,
Arc<Atomic<bool>>: Send,
Arc<CpuPlotterMetrics>: Send,
impl<PG, PosTable> Sync for CpuPlotter<PG, PosTable>where
PosTable: Sync,
PG: Sync,
Arc<Semaphore>: Sync,
Arc<(Mutex<RawMutex, Inner>, Event)>: Sync,
NonZero<usize>: Sync,
Arc<Mutex<()>>: Sync,
Arc<Handlers>: Sync,
Arc<BoundedInner<AsyncJoinOnDrop<()>>>: Sync,
Arc<Mutex<SenderTask>>: Sync,
JoinHandle<()>: Sync,
Arc<Atomic<bool>>: Sync,
Arc<CpuPlotterMetrics>: Sync,
impl<PG, PosTable> Unpin for CpuPlotter<PG, PosTable>where
PosTable: Unpin,
PG: Unpin,
Arc<Semaphore>: Unpin,
*const ArcInner<(Mutex<RawMutex, Inner>, Event)> is !null: Unpin,
Align1<u8>: Unpin,
*const u8 is !null: Unpin,
Arc<Registry>: Unpin,
Align8<*mut Inner<()>>: Unpin,
NonZero<usize>: Unpin,
*const ArcInner<Mutex<()>> is !null: Unpin,
Align8<usize>: Unpin,
*const ArcInner<Handlers> is !null: Unpin,
Arc<Mutex<RawMutex, Inner<Arc<dyn Fn(&Ed25519PublicKey, &SectorIndex, &SectorPlottingProgress) + Sync + Send>>>>: Unpin,
Box<[u16; 65536]>: Unpin,
Box<dyn Stream<Item = Result<SharedAlignedBuffer<Align<4096>>, String>> + Sync + Send>: Unpin,
BoundedSenderInner<AsyncJoinOnDrop<()>>: Unpin,
JoinHandle<()>: Unpin,
*const ArcInner<Atomic<bool>> is !null: Unpin,
*const ArcInner<CpuPlotterMetrics> is !null: Unpin,
Arc<Mutex<RawMutex, Inner>>: Unpin,
Arc<Atomic<u64>>: Unpin,
Arc<Atomic<i64>>: Unpin,
impl<PG, PosTable> UnsafeUnpin for CpuPlotter<PG, PosTable>where
PG: UnsafeUnpin,
*const ArcInner<Semaphore> is !null: UnsafeUnpin,
PhantomData<ArcInner<Semaphore>>: UnsafeUnpin,
*const ArcInner<(Mutex<RawMutex, Inner>, Event)> is !null: UnsafeUnpin,
PhantomData<(Mutex<RawMutex, Inner>, Event)>: UnsafeUnpin,
NonZeroUsizeInner: UnsafeUnpin,
*const ArcInner<Mutex<()>> is !null: UnsafeUnpin,
PhantomData<Mutex<()>>: UnsafeUnpin,
*const ArcInner<Handlers> is !null: UnsafeUnpin,
PhantomData<Handlers>: UnsafeUnpin,
*const ArcInner<BoundedInner<AsyncJoinOnDrop<()>>> is !null: UnsafeUnpin,
PhantomData<ArcInner<BoundedInner<AsyncJoinOnDrop<()>>>>: UnsafeUnpin,
*const ArcInner<Mutex<SenderTask>> is !null: UnsafeUnpin,
PhantomData<ArcInner<Mutex<SenderTask>>>: UnsafeUnpin,
*const Header is !null: UnsafeUnpin,
PhantomData<()>: UnsafeUnpin,
*const ArcInner<Atomic<bool>> is !null: UnsafeUnpin,
PhantomData<Atomic<bool>>: UnsafeUnpin,
*const ArcInner<CpuPlotterMetrics> is !null: UnsafeUnpin,
PhantomData<CpuPlotterMetrics>: UnsafeUnpin,
PhantomData<PosTable>: UnsafeUnpin,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more