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) -> Arc<dyn PlottedSectors + 'static>
fn plotted_sectors(&self) -> Arc<dyn PlottedSectors + 'static>
Get plotted sectors instance
Source§fn piece_reader(&self) -> Arc<dyn PieceReader + 'static>
fn piece_reader(&self) -> Arc<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
Source§fn on_solution(
&self,
callback: HandlerFn<SolutionResponse>,
) -> Box<dyn HandlerId>
fn on_solution( &self, callback: HandlerFn<SolutionResponse>, ) -> Box<dyn HandlerId>
Subscribe to new solution notification
Auto Trait Implementations§
impl Freeze for ClusterFarm
impl !RefUnwindSafe for ClusterFarm
impl Send for ClusterFarm
impl Sync for ClusterFarm
impl Unpin for ClusterFarm
impl !UnwindSafe for ClusterFarm
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<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