pub struct ClusterFarm { /* private fields */ }Expand description
Cluster farm implementation
Implementations§
Source§impl ClusterFarm
impl ClusterFarm
Sourcepub async fn new(
farm_id: FarmId,
total_sectors_count: u16,
nats_client: NatsClient,
) -> Result<Self>
pub async fn new( farm_id: FarmId, total_sectors_count: u16, nats_client: NatsClient, ) -> Result<Self>
Create a new instance using information from previously received
ClusterFarmerIdentifyBroadcast
Trait Implementations§
Source§impl Debug for ClusterFarm
impl Debug for ClusterFarm
Source§impl Farm for ClusterFarm
impl Farm for ClusterFarm
Source§fn total_sectors_count(&self) -> u16
fn total_sectors_count(&self) -> u16
Number of sectors in this farm
Source§fn plotted_sectors(&self) -> StdArc<dyn PlottedSectors + 'static> ⓘ
fn plotted_sectors(&self) -> StdArc<dyn PlottedSectors + 'static> ⓘ
Get plotted sectors instance
Source§fn piece_reader(&self) -> StdArc<dyn PieceReader + 'static> ⓘ
fn piece_reader(&self) -> StdArc<dyn PieceReader + 'static> ⓘ
Get piece reader to read plotted pieces later
Source§fn on_sector_update(
&self,
callback: HandlerFn<(SectorIndex, SectorUpdate)>,
) -> Box<dyn HandlerId>
fn on_sector_update( &self, callback: HandlerFn<(SectorIndex, SectorUpdate)>, ) -> Box<dyn HandlerId>
Subscribe to sector updates
Source§fn on_farming_notification(
&self,
callback: HandlerFn<FarmingNotification>,
) -> Box<dyn HandlerId>
fn on_farming_notification( &self, callback: HandlerFn<FarmingNotification>, ) -> Box<dyn HandlerId>
Subscribe to farming notifications
Auto Trait Implementations§
impl !RefUnwindSafe for ClusterFarm
impl !UnwindSafe for ClusterFarm
impl Forget for ClusterFarm
impl Freeze for ClusterFarmwhere
*const u8 is !null: Freeze,
PhantomData<u8>: Freeze,
*const ArcInner<Inner> is !null: Freeze,
PhantomData<Inner>: Freeze,
*const ArcInner<Handlers> is !null: Freeze,
PhantomData<Handlers>: Freeze,
*const Header is !null: Freeze,
PhantomData<()>: Freeze,
impl Move for ClusterFarm
impl Send for ClusterFarm
impl Sync for ClusterFarm
impl Unpin for ClusterFarmwhere
*const u8 is !null: Unpin,
*const ArcInner<Inner> is !null: Unpin,
Arc<Shared<Option<ServerInfo>>>: Unpin,
Arc<Shared<State>>: Unpin,
Arc<Chan<Command, Semaphore>>: Unpin,
Box<dyn Future<Output = Result<OwnedPermit<Command>, PollSendError<Command>>> + Send>: Unpin,
Arc<AtomicU64>: Unpin,
Arc<str>: Unpin,
Arc<Atomic<usize>>: Unpin,
Arc<Statistics>: Unpin,
*const ArcInner<Handlers> is !null: Unpin,
Arc<Mutex<RawMutex, Inner<Arc<dyn Fn(&(SectorIndex, SectorUpdate)) + Sync + Send>>>>: Unpin,
Box<[u16; 65536]>: Unpin,
Arc<Mutex<RawMutex, Inner<Arc<dyn Fn(&FarmingNotification) + Sync + Send>>>>: Unpin,
Arc<FarmingError>: Unpin,
Arc<Mutex<RawMutex, Inner<Arc<dyn Fn(&SolutionResponse) + Sync + Send>>>>: Unpin,
JoinHandle<()>: Unpin,
impl UnsafeUnpin for ClusterFarmwhere
*const u8 is !null: UnsafeUnpin,
PhantomData<u8>: UnsafeUnpin,
*const ArcInner<Inner> is !null: UnsafeUnpin,
PhantomData<Inner>: UnsafeUnpin,
*const ArcInner<Handlers> is !null: UnsafeUnpin,
PhantomData<Handlers>: UnsafeUnpin,
*const Header is !null: UnsafeUnpin,
PhantomData<()>: 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