pub struct LocalSharding { /* private fields */ }Expand description
Number of instance-local shards used by hot-path state.
SINGLE preserves the original layout and behavior.
Larger values are an explicit deployment choice for accounts that
genuinely saturate several worker threads; they trade per-account memory
for less cache-line sharing.
Implementations§
Source§impl LocalSharding
impl LocalSharding
pub const SINGLE: Self
pub const fn new(shards: NonZeroUsize) -> Self
Sourcepub fn available_parallelism() -> Self
pub fn available_parallelism() -> Self
Match the host’s advertised parallelism. This is a control-plane helper; it is never called from the request path.
pub const fn get(self) -> usize
Sourcepub fn occupancy(self) -> ShardOccupancy
pub fn occupancy(self) -> ShardOccupancy
How this layout is holding up against the affinities handed out.
Metrics only, like CapacityOccupancy: no decision reads it, and it
is a control-plane call rather than a request-path one.
Trait Implementations§
Source§impl Clone for LocalSharding
impl Clone for LocalSharding
impl Copy for LocalSharding
Source§impl Debug for LocalSharding
impl Debug for LocalSharding
Source§impl Default for LocalSharding
impl Default for LocalSharding
impl Eq for LocalSharding
Source§impl PartialEq for LocalSharding
impl PartialEq for LocalSharding
impl StructuralPartialEq for LocalSharding
Auto Trait Implementations§
impl Freeze for LocalSharding
impl RefUnwindSafe for LocalSharding
impl Send for LocalSharding
impl Sync for LocalSharding
impl Unpin for LocalSharding
impl UnsafeUnpin for LocalSharding
impl UnwindSafe for LocalSharding
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