pub struct OwnedCountersFile { /* private fields */ }Expand description
Heap-allocated CountersFile that owns its backing buffer.
Produced by CountersFile::boxed for use cases that don’t need
cross-process sharing (tests, in-process metrics).
Derefs to &CountersFile so all the usual register /
snapshot / etc. methods work directly.
Methods from Deref<Target = CountersFile>§
Sourcepub fn header(&self) -> &CountersHeader
pub fn header(&self) -> &CountersHeader
Header reference.
Sourcepub fn register(
&self,
id: u32,
flags: u32,
label: &str,
) -> Option<CounterHandle>
pub fn register( &self, id: u32, flags: u32, label: &str, ) -> Option<CounterHandle>
Reserve a new slot, populate id, flags, and label, and
return a writer handle. Returns None when the slot capacity is
exhausted.
Sourcepub fn snapshot(&self) -> Vec<CounterSnapshot>
pub fn snapshot(&self) -> Vec<CounterSnapshot>
Snapshot all in-use slots — (id, flags, value, label) tuples.
Intended for external readers and tests.
Trait Implementations§
Source§impl Debug for OwnedCountersFile
impl Debug for OwnedCountersFile
Source§impl Deref for OwnedCountersFile
impl Deref for OwnedCountersFile
Source§type Target = CountersFile
type Target = CountersFile
The resulting type after dereferencing.
Source§fn deref(&self) -> &CountersFile
fn deref(&self) -> &CountersFile
Dereferences the value.
Source§impl Drop for OwnedCountersFile
impl Drop for OwnedCountersFile
impl Send for OwnedCountersFile
impl Sync for OwnedCountersFile
Auto Trait Implementations§
impl Freeze for OwnedCountersFile
impl RefUnwindSafe for OwnedCountersFile
impl Unpin for OwnedCountersFile
impl UnsafeUnpin for OwnedCountersFile
impl UnwindSafe for OwnedCountersFile
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