Skip to main content

Journal

Struct Journal 

Source
pub struct Journal<'a> { /* private fields */ }
Expand description

The sayings of one investigation, kept in a store.

tree is what lets several investigations share one store without seeing each other, and it is in the name for the same reason a study’s is: a name is the one part of this that cannot be refactored later.

Implementations§

Source§

impl<'a> Journal<'a>

Source

pub fn of(tree: impl Into<String>, kept: &'a dyn Store) -> Self

Source

pub fn say( &self, commit: &str, verdict: Option<Verdict>, who: &str, prose: &str, ) -> Result<u32, Trouble>

Says something about a commit, and returns which slot it landed in.

Claims rather than binds, so two people saying something at the same moment both get heard: whoever is told the slot is taken asks for the next one, exactly as a worker does with a trial.

Source

pub fn all(&self) -> Result<Vec<Saying>, Trouble>

Everything anybody said in this investigation, oldest first.

A scan and no fetches: the prose stays a digest until somebody asks to read it.

Source

pub fn verdicts(&self) -> Result<BTreeMap<String, Verdict>, Trouble>

What each commit’s verdict is: the last one anybody claimed.

Notes in between are not verdicts and do not overwrite one — somebody writing down what they saw has not thereby changed their mind.

Source

pub fn read(&self, saying: &Saying) -> Result<String, Trouble>

The prose of one saying.

Auto Trait Implementations§

§

impl<'a> Freeze for Journal<'a>

§

impl<'a> !RefUnwindSafe for Journal<'a>

§

impl<'a> Send for Journal<'a>

§

impl<'a> Sync for Journal<'a>

§

impl<'a> Unpin for Journal<'a>

§

impl<'a> UnsafeUnpin for Journal<'a>

§

impl<'a> !UnwindSafe for Journal<'a>

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 = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.