pub struct SaveCtx<'a> {
pub actor: Option<&'a str>,
pub expect_version: Option<&'a str>,
}Expand description
Who is writing, and what they believe the vault currently is.
A struct rather than two positional Option<&str> arguments: silently
swapping an actor id for a version hash would disable the concurrency check
while still compiling and still passing tests.
Fields§
§actor: Option<&'a str>User id responsible for the change, recorded in the audit log.
None for contexts where the owner is implicit.
expect_version: Option<&'a str>The version the caller last read. When set, the write is refused unless
the stored vault is still at that version. None writes unconditionally
— only correct when nothing else can be writing.
Trait Implementations§
impl<'a> Copy for SaveCtx<'a>
Auto Trait Implementations§
impl<'a> Freeze for SaveCtx<'a>
impl<'a> RefUnwindSafe for SaveCtx<'a>
impl<'a> Send for SaveCtx<'a>
impl<'a> Sync for SaveCtx<'a>
impl<'a> Unpin for SaveCtx<'a>
impl<'a> UnsafeUnpin for SaveCtx<'a>
impl<'a> UnwindSafe for SaveCtx<'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