pub struct Rewinder<'a> { /* private fields */ }Expand description
Struct to apply all the diffs from a specified timestamp to a resource.
See Manager::rewind_from_last_commit for more info.
Implementations§
source§impl<'a> Rewinder<'a>
impl<'a> Rewinder<'a>
sourcepub fn rewind_with_modify_diff(
&mut self,
resource: &str,
data: impl Into<Vec<u8>>,
diff_modification: impl FnMut(&Difference) -> Cow<'_, Difference>,
) -> Result<Vec<u8>, RewindError>
pub fn rewind_with_modify_diff( &mut self, resource: &str, data: impl Into<Vec<u8>>, diff_modification: impl FnMut(&Difference) -> Cow<'_, Difference>, ) -> Result<Vec<u8>, RewindError>
Rewinds the resource back up to the most recent version.
diff_modification can be used to change the diff just before it’s applied.
§Errors
Passes errors from [Difference::apply].
sourcepub fn rewind(
&mut self,
resource: &str,
data: impl Into<Vec<u8>>,
) -> Result<Vec<u8>, RewindError>
pub fn rewind( &mut self, resource: &str, data: impl Into<Vec<u8>>, ) -> Result<Vec<u8>, RewindError>
Rewinds the resource back up to the most recent version.
§Errors
Passes errors from [Difference::apply].
sourcepub fn events(&self) -> impl DoubleEndedIterator<Item = &Event> + '_
pub fn events(&self) -> impl DoubleEndedIterator<Item = &Event> + '_
Get an iterator over the events stored in this rewinder. The first item is the oldest one. The last is the most recent.
sourcepub fn last_change_to_resource(&self, resource: &str) -> SystemTime
pub fn last_change_to_resource(&self, resource: &str) -> SystemTime
Trait Implementations§
Auto Trait Implementations§
impl<'a> Freeze for Rewinder<'a>
impl<'a> RefUnwindSafe for Rewinder<'a>
impl<'a> Send for Rewinder<'a>
impl<'a> Sync for Rewinder<'a>
impl<'a> Unpin for Rewinder<'a>
impl<'a> UnwindSafe for Rewinder<'a>
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,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit)