pub struct Ctl { /* private fields */ }
Expand description
Ctl
is a handle to the kstat library.
Users instantiate a control handle and access the kstat’s it contains, for example via the
Ctl::iter
method.
Implementations§
Source§impl Ctl
impl Ctl
Sourcepub fn update(self) -> Result<Self, Error>
pub fn update(self) -> Result<Self, Error>
Synchronize this Ctl
with the kernel’s view of the data.
A Ctl
is really a snapshot of the kernel’s internal list of kstats. This method consumes
and updates a control object, bringing it into sync with the kernel’s copy.
Sourcepub fn iter(&self) -> Iter<'_> ⓘ
pub fn iter(&self) -> Iter<'_> ⓘ
Return an iterator over the Kstat
s in self
.
Note that this will only return Kstat
s which are successfully read. For example, it will
ignore those with non-UTF-8 names.
Trait Implementations§
impl Send for Ctl
The Ctl
wraps a raw pointer allocated by the libkstat(3KSTAT)
library.
This itself isn’t thread-safe, but doesn’t refer to any thread-local state.
So it’s safe to send across threads.
Auto Trait Implementations§
impl Freeze for Ctl
impl RefUnwindSafe for Ctl
impl !Sync for Ctl
impl Unpin for Ctl
impl UnwindSafe for Ctl
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