MemoryMonitorExt

Trait MemoryMonitorExt 

Source
pub trait MemoryMonitorExt: IsA<MemoryMonitor> + 'static {
    // Provided method
    fn connect_low_memory_warning<F>(&self, f: F) -> SignalHandlerId
       where F: Fn(&Self, MemoryMonitorWarningLevel) + 'static { ... }
}
Expand description

Trait containing all MemoryMonitor methods.

§Implementors

MemoryMonitor

Provided Methods§

Source

fn connect_low_memory_warning<F>(&self, f: F) -> SignalHandlerId
where F: Fn(&Self, MemoryMonitorWarningLevel) + 'static,

Available on crate feature v2_64 only.

Emitted when the system is running low on free memory.

The signal handler should then take the appropriate action depending on the warning level. See the #GMemoryMonitorWarningLevel documentation for details.

Since the MemoryMonitor is a singleton, this signal will be emitted in the glib::MainContext::default()[global-default main context].

§level

the #GMemoryMonitorWarningLevel warning level

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§