pub struct GpuPlotter<PG> { /* private fields */ }Expand description
GPU plotter
Implementations§
Source§impl<PG> GpuPlotter<PG>
impl<PG> GpuPlotter<PG>
Sourcepub fn new(
piece_getter: PG,
downloading_semaphore: StdArc<Semaphore>,
gpu_records_encoders: Vec<GpuRecordsEncoder>,
global_mutex: Arc<AsyncMutex<()>>,
erasure_coding: ErasureCoding,
registry: Option<&mut Registry>,
) -> Result<Self, TryFromIntError>
pub fn new( piece_getter: PG, downloading_semaphore: StdArc<Semaphore>, gpu_records_encoders: Vec<GpuRecordsEncoder>, global_mutex: Arc<AsyncMutex<()>>, erasure_coding: ErasureCoding, registry: Option<&mut Registry>, ) -> Result<Self, TryFromIntError>
Create a new instance.
Returns an error if empty list of encoders is provided.
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> Debug for GpuPlotter<PG>
impl<PG> Debug for GpuPlotter<PG>
Source§impl<PG> Drop for GpuPlotter<PG>
impl<PG> Drop for GpuPlotter<PG>
Source§impl<PG> Plotter for GpuPlotter<PG>
impl<PG> Plotter for GpuPlotter<PG>
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> !RefUnwindSafe for GpuPlotter<PG>
impl<PG> !UnwindSafe for GpuPlotter<PG>
impl<PG> Forget for GpuPlotter<PG>
impl<PG> Freeze for GpuPlotter<PG>where
PG: Freeze,
*const ArcInner<Semaphore> is !null: Freeze,
PhantomData<ArcInner<Semaphore>>: Freeze,
*const ArcInner<(Mutex<RawMutex, Vec<GpuRecordsEncoder>>, Event)> is !null: Freeze,
PhantomData<(Mutex<RawMutex, Vec<GpuRecordsEncoder>>, 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<GpuPlotterMetrics> is !null: Freeze,
PhantomData<GpuPlotterMetrics>: Freeze,
impl<PG> Move for GpuPlotter<PG>
impl<PG> Send for GpuPlotter<PG>where
PG: Send,
Arc<Semaphore>: Send,
Arc<(Mutex<RawMutex, Vec<GpuRecordsEncoder>>, 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<GpuPlotterMetrics>: Send,
impl<PG> Sync for GpuPlotter<PG>where
PG: Sync,
Arc<Semaphore>: Sync,
Arc<(Mutex<RawMutex, Vec<GpuRecordsEncoder>>, 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<GpuPlotterMetrics>: Sync,
impl<PG> Unpin for GpuPlotter<PG>where
PG: Unpin,
Arc<Semaphore>: Unpin,
*const ArcInner<(Mutex<RawMutex, Vec<GpuRecordsEncoder>>, Event)> is !null: Unpin,
Align1<u8>: Unpin,
*const u8 is !null: Unpin,
Arc<Device>: Unpin,
Arc<Mutex<RawMutex, HashSet<WeakMapContext>>>: Unpin,
Arc<Queue>: Unpin,
*const ArcInner<Mutex<RawMutex, Option<BufferAsyncError>>> is !null: Unpin,
Arc<Buffer>: Unpin,
Arc<Mutex<RawMutex, MapContext>>: Unpin,
Arc<BindGroup>: Unpin,
Arc<ComputePipeline>: Unpin,
Box<Record>: Unpin,
Arc<Registry>: Unpin,
&'static str: Unpin,
String: Unpin,
InternalBitFlags: Unpin,
InternalBitFlags: Unpin,
*const ArcInner<Mutex<()>> is !null: Unpin,
Align8<usize>: Unpin,
Align8<*mut Inner<()>>: Unpin,
NonZero<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<GpuPlotterMetrics> is !null: Unpin,
Arc<Mutex<RawMutex, Inner>>: Unpin,
Arc<Atomic<u64>>: Unpin,
Arc<Atomic<i64>>: Unpin,
impl<PG> UnsafeUnpin for GpuPlotter<PG>where
PG: UnsafeUnpin,
*const ArcInner<Semaphore> is !null: UnsafeUnpin,
PhantomData<ArcInner<Semaphore>>: UnsafeUnpin,
*const ArcInner<(Mutex<RawMutex, Vec<GpuRecordsEncoder>>, Event)> is !null: UnsafeUnpin,
PhantomData<(Mutex<RawMutex, Vec<GpuRecordsEncoder>>, 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<GpuPlotterMetrics> is !null: UnsafeUnpin,
PhantomData<GpuPlotterMetrics>: 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