pub struct Journal { /* private fields */ }Expand description
Holds a nonblocking exclusive resource-directory lock. Dispatch is unavailable after reopen until a new request has been durably prepared. Directory must be provisioned by Core; this store never discovers or migrates another lease.
Implementations§
Source§impl Journal
impl Journal
Sourcepub fn open_reserved(
root: &Path,
request: &Request,
plan: &CreatePlan,
) -> Result<Self, Invalid>
pub fn open_reserved( root: &Path, request: &Request, plan: &CreatePlan, ) -> Result<Self, Invalid>
Reopen a transferred lease only with the exact trusted reservation inputs. Even pending Create is consumed as unknown; no automatic second dispatch.
Source§impl Journal
impl Journal
pub fn create(root: &Path, create: &Request) -> Result<Self, Invalid>
pub fn open(root: &Path, create: &Request) -> Result<Self, Invalid>
Sourcepub fn retain_unknown(&mut self) -> Result<(), Invalid>
pub fn retain_unknown(&mut self) -> Result<(), Invalid>
Close a dropped/incomplete dispatch as unknown without replaying it. The mutable borrow prevents use while a Dispatch token is still held.
pub fn phase(&self) -> Phase
pub fn revision(&self) -> u64
pub fn target(&self) -> Result<Target, Invalid>
pub fn begin( &mut self, request: &Request, purpose: Purpose, ) -> Result<Dispatch<'_>, Invalid>
Sourcepub fn dispatch(&mut self) -> Result<Dispatch<'_>, Invalid>
pub fn dispatch(&mut self) -> Result<Dispatch<'_>, Invalid>
Only the initial just-created record can use this without begin(). Reopened records never have ready=true; borrowing then dropping a token cannot authorize a second dispatch.
Sourcepub fn finish_release(&mut self) -> Result<(), Invalid>
pub fn finish_release(&mut self) -> Result<(), Invalid>
Evidence is already committed in the verified-absent record. Write its tombstone durably before unlinking active, then fsync the directory. This method is idempotent after a crash; it never removes the lease/evidence.