pub struct CheckpointData {
pub file: String,
pub line: usize,
}Expand description
Persisted checkpoint data recording the current file and line position.
Fields§
§file: String§line: usizeImplementations§
Source§impl CheckpointData
impl CheckpointData
Sourcepub async fn load(path: &Utf8PathBuf) -> Result<Option<Self>>
pub async fn load(path: &Utf8PathBuf) -> Result<Option<Self>>
Load a checkpoint from the given path.
Returns Ok(None) if the file does not exist.
Sourcepub fn save_atomic(
checkpoint_path: &Utf8PathBuf,
file: &Utf8PathBuf,
line: usize,
) -> Result<()>
pub fn save_atomic( checkpoint_path: &Utf8PathBuf, file: &Utf8PathBuf, line: usize, ) -> Result<()>
Atomically write a checkpoint file by writing to a temporary file in the same directory and then renaming it into place.
Trait Implementations§
Source§impl Clone for CheckpointData
impl Clone for CheckpointData
Source§fn clone(&self) -> CheckpointData
fn clone(&self) -> CheckpointData
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for CheckpointData
impl Debug for CheckpointData
Source§impl<'de> Deserialize<'de> for CheckpointData
impl<'de> Deserialize<'de> for CheckpointData
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for CheckpointData
impl RefUnwindSafe for CheckpointData
impl Send for CheckpointData
impl Sync for CheckpointData
impl Unpin for CheckpointData
impl UnwindSafe for CheckpointData
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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