pub struct Snapshot<'a, 'b> { /* private fields */ }Implementations§
Source§impl<'a, 'b> Snapshot<'a, 'b>
impl<'a, 'b> Snapshot<'a, 'b>
Sourcepub fn new(destination: &'a Path, memory_ranges: Vec<Range<u64>>) -> Self
pub fn new(destination: &'a Path, memory_ranges: Vec<Range<u64>>) -> Self
Create a new memory snapshot.
The default version implements the LiME format.
Sourcepub fn max_disk_usage_percentage(
self,
max_disk_usage_percentage: Option<f64>,
) -> Self
pub fn max_disk_usage_percentage( self, max_disk_usage_percentage: Option<f64>, ) -> Self
Specify the maximum disk usage to stay under as a percentage
This is an estimation, calculated at start time
Sourcepub fn max_disk_usage(self, max_disk_usage: Option<NonZeroU64>) -> Self
pub fn max_disk_usage(self, max_disk_usage: Option<NonZeroU64>) -> Self
Specify the maximum disk space in MB to use
This is an estimation, calculated at start time
Sourcepub fn source(self, source: Option<&'b Source>) -> Self
pub fn source(self, source: Option<&'b Source>) -> Self
Specify the source for creating the snapshot
Sourcepub fn create(&self) -> Result<(), Error>
pub fn create(&self) -> Result<(), Error>
Create a memory snapshot
§Errors
Returns an error if:
- No source is available for creating the snapshot
- There is a failure reading from the specified source
- The estimated disk usage exceeds the specified limits
- Failed to create or write to the destination file
Auto Trait Implementations§
impl<'a, 'b> Freeze for Snapshot<'a, 'b>
impl<'a, 'b> RefUnwindSafe for Snapshot<'a, 'b>
impl<'a, 'b> Send for Snapshot<'a, 'b>
impl<'a, 'b> Sync for Snapshot<'a, 'b>
impl<'a, 'b> Unpin for Snapshot<'a, 'b>
impl<'a, 'b> UnwindSafe for Snapshot<'a, 'b>
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