pub struct BrowserOptimizer { /* private fields */ }Expand description
Browser memory optimizer
Implementations§
Source§impl BrowserOptimizer
impl BrowserOptimizer
pub fn new() -> Self
Sourcepub fn get_browsers(&self) -> Vec<&BrowserInfo>
pub fn get_browsers(&self) -> Vec<&BrowserInfo>
Get all detected browsers
Sourcepub fn get_browser(&self, name: &str) -> Option<&BrowserInfo>
pub fn get_browser(&self, name: &str) -> Option<&BrowserInfo>
Get browser by name
Sourcepub fn total_memory_mb(&self) -> f64
pub fn total_memory_mb(&self) -> f64
Get total browser memory usage
Sourcepub fn total_cpu_percent(&self) -> f32
pub fn total_cpu_percent(&self) -> f32
Get total browser CPU usage
Sourcepub fn highest_memory_browser(&self) -> Option<&BrowserInfo>
pub fn highest_memory_browser(&self) -> Option<&BrowserInfo>
Get browser with highest memory usage
Sourcepub fn get_suggestions(&self) -> Vec<(String, OptimizationAction, String)>
pub fn get_suggestions(&self) -> Vec<(String, OptimizationAction, String)>
Get optimization suggestions for all browsers
pub fn trim_browser_memory(&self, browser_name: &str) -> OptimizationResult
Sourcepub fn print_summary(&self)
pub fn print_summary(&self)
Print browser summary
Trait Implementations§
Auto Trait Implementations§
impl Freeze for BrowserOptimizer
impl RefUnwindSafe for BrowserOptimizer
impl Send for BrowserOptimizer
impl Sync for BrowserOptimizer
impl Unpin for BrowserOptimizer
impl UnwindSafe for BrowserOptimizer
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 more