pub struct SystemMonitor { /* private fields */ }Expand description
A !Send + !Sync native system-monitor owner.
Its typed native owner is declared before the retained Report, ensuring
native destruction precedes release of the report it may still use. A live
monitor is stopped and waited before native deletion.
Implementations§
Source§impl SystemMonitor
impl SystemMonitor
Sourcepub fn new(
report: Rc<Report>,
config: Option<&SystemMonitorConfig>,
) -> Result<Self>
pub fn new( report: Rc<Report>, config: Option<&SystemMonitorConfig>, ) -> Result<Self>
Creates a monitor without starting its native worker.
Sourcepub fn report(&self) -> &Rc<Report>
pub fn report(&self) -> &Rc<Report>
Returns the report retained for the monitor’s native lifetime.
Sourcepub fn stop(&mut self) -> Result<()>
pub fn stop(&mut self) -> Result<()>
Requests monitor shutdown. Call Self::wait_for_termination before
relying on the final Stopped state.
Sourcepub fn wait_for_termination(&mut self) -> Result<()>
pub fn wait_for_termination(&mut self) -> Result<()>
Waits until the native worker has stopped.
Trait Implementations§
Source§impl Drop for SystemMonitor
impl Drop for SystemMonitor
Auto Trait Implementations§
impl !RefUnwindSafe for SystemMonitor
impl !Send for SystemMonitor
impl !Sync for SystemMonitor
impl !UnwindSafe for SystemMonitor
impl Freeze for SystemMonitor
impl Unpin for SystemMonitor
impl UnsafeUnpin for SystemMonitor
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