pub struct LeaderScheduleCache {
pub cached_schedules: RwLock<(HashMap<Epoch, Arc<LeaderSchedule>>, VecDeque<u64>)>,
/* private fields */
}Fields§
§cached_schedules: RwLock<(HashMap<Epoch, Arc<LeaderSchedule>>, VecDeque<u64>)>Implementations§
Source§impl LeaderScheduleCache
impl LeaderScheduleCache
pub fn new_from_bank(bank: &Bank) -> Self
pub fn new(epoch_schedule: EpochSchedule, root_bank: &Bank) -> Self
pub fn set_max_schedules(&mut self, max_schedules: usize)
pub fn max_schedules(&self) -> usize
pub fn set_root(&self, root_bank: &Bank)
pub fn slot_leader_at(&self, slot: Slot, bank: Option<&Bank>) -> Option<Pubkey>
Sourcepub fn next_leader_slot(
&self,
pubkey: &Pubkey,
current_slot: Slot,
bank: &Bank,
blockstore: Option<&Blockstore>,
max_slot_range: u64,
) -> Option<(Slot, Slot)>
pub fn next_leader_slot( &self, pubkey: &Pubkey, current_slot: Slot, bank: &Bank, blockstore: Option<&Blockstore>, max_slot_range: u64, ) -> Option<(Slot, Slot)>
Returns the (next slot, last slot) consecutive range of slots after the given current_slot that the given node will be leader.
pub fn set_fixed_leader_schedule( &mut self, fixed_schedule: Option<FixedSchedule>, )
pub fn get_epoch_leader_schedule( &self, epoch: Epoch, ) -> Option<Arc<LeaderSchedule>>
Trait Implementations§
Source§impl Default for LeaderScheduleCache
impl Default for LeaderScheduleCache
Source§fn default() -> LeaderScheduleCache
fn default() -> LeaderScheduleCache
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl !Freeze for LeaderScheduleCache
impl RefUnwindSafe for LeaderScheduleCache
impl Send for LeaderScheduleCache
impl Sync for LeaderScheduleCache
impl Unpin for LeaderScheduleCache
impl UnwindSafe for LeaderScheduleCache
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§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 moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request