Skip to main content

Journal

Struct Journal 

Source
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

Source

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

Source

pub fn create(root: &Path, create: &Request) -> Result<Self, Invalid>

Source

pub fn open(root: &Path, create: &Request) -> Result<Self, Invalid>

Source

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.

Source

pub fn phase(&self) -> Phase

Source

pub fn revision(&self) -> u64

Source

pub fn target(&self) -> Result<Target, Invalid>

Source

pub fn begin( &mut self, request: &Request, purpose: Purpose, ) -> Result<Dispatch<'_>, Invalid>

Source

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.

Source

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.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.