pub struct DiskMonitor { /* private fields */ }Expand description
Background disk free-space monitor.
Spawns a polling thread that periodically refreshes disk free space via
sysinfo. The monitored disk defaults to the one containing par-term’s
launch directory; with set_follow_cwd(true) it follows the active
tab/pane’s working directory instead.
Implementations§
Source§impl DiskMonitor
impl DiskMonitor
Sourcepub fn new() -> Self
pub fn new() -> Self
Create a new (stopped) disk monitor, capturing the launch directory.
par-term never chdir’s its own process (the PTY child does), so
std::env::current_dir() here is stable for the whole session.
Sourcepub fn start(&self, poll_interval_secs: f32)
pub fn start(&self, poll_interval_secs: f32)
Start the polling thread. No-op if already running.
Sourcepub fn signal_stop(&self)
pub fn signal_stop(&self)
Signal the polling thread to stop without waiting.
Sourcepub fn is_running(&self) -> bool
pub fn is_running(&self) -> bool
Whether the polling thread is currently running.
Sourcepub fn data(&self) -> DiskMonitorData
pub fn data(&self) -> DiskMonitorData
Get a clone of the current data snapshot.
Sourcepub fn set_cwd(&self, new_cwd: Option<&str>)
pub fn set_cwd(&self, new_cwd: Option<&str>)
Update the active tab’s working directory (called each frame).
Sourcepub fn set_follow_cwd(&self, follow: bool)
pub fn set_follow_cwd(&self, follow: bool)
Toggle between launch-disk (false) and follow-active-CWD (true).
Trait Implementations§
Source§impl Default for DiskMonitor
impl Default for DiskMonitor
Source§impl Drop for DiskMonitor
impl Drop for DiskMonitor
Auto Trait Implementations§
impl !Freeze for DiskMonitor
impl !RefUnwindSafe for DiskMonitor
impl !UnwindSafe for DiskMonitor
impl Send for DiskMonitor
impl Sync for DiskMonitor
impl Unpin for DiskMonitor
impl UnsafeUnpin for DiskMonitor
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
impl<S, T> Duplex<S> for Twhere
T: FromSample<S> + ToSample<S>,
Source§impl<S> FromSample<S> for S
impl<S> FromSample<S> for S
fn from_sample_(s: S) -> S
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> ⓘ
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> ⓘ
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<F, T> IntoSample<T> for Fwhere
T: FromSample<F>,
impl<F, T> IntoSample<T> for Fwhere
T: FromSample<F>,
fn into_sample(self) -> T
Source§impl<T> Pointable for T
impl<T> Pointable for T
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<R, P> ReadPrimitive<R> for P
impl<R, P> ReadPrimitive<R> for P
Source§fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
ReadEndian::read_from_little_endian().