pub struct Journal { /* private fields */ }Implementations§
Source§impl Journal
impl Journal
pub fn stable_file_name( directory: &Path, adapter_name: &str, ops: &[Op], ) -> PathBuf
Sourcepub fn load_or_create(
directory: &Path,
adapter_name: &str,
ops: &[Op],
) -> Result<Self>
pub fn load_or_create( directory: &Path, adapter_name: &str, ops: &[Op], ) -> Result<Self>
tries to load a Journal from file_path, otherwise creates a new one.
in either case, the new Journal instance will be backed by the file at file_path.
delete ops will not be saved in the journal.
Sourcepub fn new_ephemeral(ops: &[Op]) -> Self
pub fn new_ephemeral(ops: &[Op]) -> Self
creates a journal without a backing file set
pub fn done_ops(&self) -> Vec<(Uid, TypeName, u64)>
pub fn done_ops_count(&self) -> usize
pub fn is_completed(&self) -> bool
Sourcepub fn mark_op_as_done(&mut self, op: &Op) -> Result<()>
pub fn mark_op_as_done(&mut self, op: &Op) -> Result<()>
will mark the first op that is not done (will fail if there’s no such op). uses a linear search from the start.
pub fn save(&mut self) -> Result<()>
pub fn delete_backing_file(&mut self) -> Result<()>
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Journal
impl<'de> Deserialize<'de> for Journal
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 Journal
impl RefUnwindSafe for Journal
impl Send for Journal
impl Sync for Journal
impl Unpin for Journal
impl UnsafeUnpin for Journal
impl UnwindSafe for Journal
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