pub struct DiskSpaceMonitor { /* private fields */ }Expand description
Background disk-space watchdog. Spawn with DiskSpaceMonitor::spawn.
Implementations§
Source§impl DiskSpaceMonitor
impl DiskSpaceMonitor
pub fn new(path: impl Into<PathBuf>, critical_pct: u8) -> DiskSpaceMonitor
pub fn with_default_threshold(path: impl Into<PathBuf>) -> DiskSpaceMonitor
Sourcepub fn spawn(self)
pub fn spawn(self)
Spawn the monitor as detached background work. When the caller is inside a Tokio runtime this uses that runtime; otherwise it creates a small current-thread runtime for the monitor. The monitor is expected to live for the full server lifetime, so no cancellation handle is exposed.
Auto Trait Implementations§
impl Freeze for DiskSpaceMonitor
impl RefUnwindSafe for DiskSpaceMonitor
impl Send for DiskSpaceMonitor
impl Sync for DiskSpaceMonitor
impl Unpin for DiskSpaceMonitor
impl UnsafeUnpin for DiskSpaceMonitor
impl UnwindSafe for DiskSpaceMonitor
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request