pub struct ControlSnapshot {
pub shutdown: bool,
pub done_count: u32,
pub epoch: u32,
pub metrics: Vec<(u32, u32)>,
pub tenant_fairness: Vec<u32>,
pub priority_fairness: Vec<u32>,
}Expand description
Structured view of the control buffer.
Fields§
§shutdown: boolShutdown flag.
done_count: u32Total drained slots.
epoch: u32Epoch value (batch fences).
metrics: Vec<(u32, u32)>Non-zero opcode metrics.
tenant_fairness: Vec<u32>Per-tenant fairness counters (cumulative).
priority_fairness: Vec<u32>Per-priority fairness counters (cumulative).
Implementations§
Source§impl ControlSnapshot
impl ControlSnapshot
Sourcepub fn decode(control_bytes: &[u8]) -> Self
pub fn decode(control_bytes: &[u8]) -> Self
Decode a structured control-buffer view.
§Panics
If the control buffer is missing any fixed control word.
This used to answer Self::default() on a decode failure, which hands
the caller a snapshot reading zero done-count, zero epoch and no
metrics and is indistinguishable from a healthy idle kernel. That is
the silent fallback Self::decode_into already refuses to make, and
the two shims must not disagree about what a bad buffer means. Callers
that can handle the error use Self::try_decode.
Sourcepub fn decode_into(control_bytes: &[u8], out: &mut Self)
pub fn decode_into(control_bytes: &[u8], out: &mut Self)
Decode a structured control-buffer view into caller-owned storage.
Sourcepub fn try_decode(control_bytes: &[u8]) -> Result<Self, PipelineError>
pub fn try_decode(control_bytes: &[u8]) -> Result<Self, PipelineError>
Strictly decode a structured control-buffer view into owned storage.
§Errors
Returns PipelineError when any fixed control word is missing from
the control snapshot.
Sourcepub fn try_decode_into(
control_bytes: &[u8],
out: &mut Self,
) -> Result<(), PipelineError>
pub fn try_decode_into( control_bytes: &[u8], out: &mut Self, ) -> Result<(), PipelineError>
Strictly decode a structured control-buffer view.
§Errors
Returns PipelineError when any fixed control word is missing from
the control snapshot.
Trait Implementations§
Source§impl Clone for ControlSnapshot
impl Clone for ControlSnapshot
Source§fn clone(&self) -> ControlSnapshot
fn clone(&self) -> ControlSnapshot
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ControlSnapshot
impl Debug for ControlSnapshot
Source§impl Default for ControlSnapshot
impl Default for ControlSnapshot
Source§fn default() -> ControlSnapshot
fn default() -> ControlSnapshot
impl Eq for ControlSnapshot
Source§impl PartialEq for ControlSnapshot
impl PartialEq for ControlSnapshot
impl StructuralPartialEq for ControlSnapshot
Auto Trait Implementations§
impl Freeze for ControlSnapshot
impl RefUnwindSafe for ControlSnapshot
impl Send for ControlSnapshot
impl Sync for ControlSnapshot
impl Unpin for ControlSnapshot
impl UnsafeUnpin for ControlSnapshot
impl UnwindSafe for ControlSnapshot
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.