pub struct StationLoadSampler { /* private fields */ }Expand description
Runtime helper that derives StationLoadSample from existing low-level state.
Implementations§
Source§impl StationLoadSampler
impl StationLoadSampler
Sourcepub const fn new(config: StationLoadSamplerConfig) -> Self
pub const fn new(config: StationLoadSamplerConfig) -> Self
Creates a station load sampler.
Sourcepub const fn config(&self) -> StationLoadSamplerConfig
pub const fn config(&self) -> StationLoadSamplerConfig
Returns the sampler configuration.
Sourcepub fn sample_station(
&self,
station: &Station,
index: Option<&CellIndex>,
queued_events: usize,
subscribers: usize,
) -> StationLoadSample
pub fn sample_station( &self, station: &Station, index: Option<&CellIndex>, queued_events: usize, subscribers: usize, ) -> StationLoadSample
Samples one station from its storage, optional index, queued event count, and caller-provided subscriber estimate.
Sourcepub fn sample_all(
&self,
stations: &StationSet,
indexes: &StationIndexSet,
router: &EventRouter,
subscriber_counts: &[(StationId, usize)],
) -> Vec<StationLoadSample>
pub fn sample_all( &self, stations: &StationSet, indexes: &StationIndexSet, router: &EventRouter, subscriber_counts: &[(StationId, usize)], ) -> Vec<StationLoadSample>
Samples every station in deterministic station-set order.
subscriber_counts is explicit integration input: SectorSync can use it
for load decisions, but does not own gateway/client/session business state.
Counts with the same station id are aggregated with saturating arithmetic.
Because the event router and subscriber input are station-scoped, their
pressure stays on the station sample instead of being invented per cell.
Trait Implementations§
Source§impl Clone for StationLoadSampler
impl Clone for StationLoadSampler
Source§fn clone(&self) -> StationLoadSampler
fn clone(&self) -> StationLoadSampler
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for StationLoadSampler
Source§impl Debug for StationLoadSampler
impl Debug for StationLoadSampler
Source§impl Default for StationLoadSampler
impl Default for StationLoadSampler
impl Eq for StationLoadSampler
Source§impl PartialEq for StationLoadSampler
impl PartialEq for StationLoadSampler
impl StructuralPartialEq for StationLoadSampler
Auto Trait Implementations§
impl Freeze for StationLoadSampler
impl RefUnwindSafe for StationLoadSampler
impl Send for StationLoadSampler
impl Sync for StationLoadSampler
impl Unpin for StationLoadSampler
impl UnsafeUnpin for StationLoadSampler
impl UnwindSafe for StationLoadSampler
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