Skip to main content

Moves

Struct Moves 

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

The reasoning of one investigation, kept in a store.

Implementations§

Source§

impl<'a> Moves<'a>

Source

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

Source

pub fn add(&self, writing: Writing<'_>) -> Result<MoveId, Trouble>

Writes a new move and returns its id.

Claims the slot exactly as a trial does: no coordinator, and whoever finds it taken asks for the next. Two people writing at once get two moves, not one lost.

Source

pub fn went(&self, name: &str) -> Result<MoveId, Trouble>

The move that name reaches. One lookup, no scan.

Source

pub fn reword( &self, id: MoveId, prose: Option<&str>, scope: Option<Scope>, course: Option<Course>, who: &str, ) -> Result<u32, Trouble>

Rewords a move. A new slot, and the last wins: what came before is still there, as in the journal.

What arrives as None stays as it was, so correcting the prose does not wipe the scope or the other way round. The scope has to be correctable: in a decision it says which line is meant, and getting it wrong — reaching a finding, which is not a line, instead of the attempt it came from — leaves the decision reaching no commit at all with nothing warning. A course changes but is never removed: a decision that decides nothing any more is pursue.

Source

pub fn cite(&self, id: MoveId, cited: Cited, who: &str) -> Result<u32, Trouble>

Adds one piece of evidence to a move.

A new drafting and the last wins, as with everything here: evidence arrives after the attempt is written, because the trials run afterwards. Citing the same thing twice does not duplicate it — two people looking at one screen would ask for it, and a list with a trial twice says nothing a list with it once does not.

Source

pub fn hang(&self, child: MoveId, parent: MoveId) -> Result<(), Trouble>

Hangs a move under another.

The cycle is refused here, the only place it is cheap: reading it later means discovering it by having a walk hang.

Source

pub fn say(&self, said: Said) -> Result<(), Trouble>

Says something from a move towards another.

Source

pub fn all(&self) -> Result<BTreeMap<MoveId, Move>, Trouble>

Every move, by id, with its latest drafting.

Source

pub fn under(&self) -> Result<Undernath, Trouble>

The index of who hangs under whom.

Source

pub fn says(&self) -> Result<Vec<Said>, Trouble>

Everything anybody said from one move towards another.

The last wins per (from, to, verb), the same rule a drafting follows in all. Without it a scope could not be corrected: saying it again would leave both edges and the count would take both, so widening a scope would look like saying it twice. Saying it again is the gesture for changing your mind about a scope; withdrawing the verb entirely still has no gesture.

The triple comes from the meta and not the body, so keeping the last one needs no read of the earlier ones.

Source

pub fn decided(&self) -> Result<BTreeMap<String, Course>, Trouble>

What was decided about each commit, derived from the reasoning.

The bridge between the layers, and it runs this way: a commit does not store that it is abandoned. It is reached by going down — decision, its scope, the attempts that scope covers, the commits those attempts cite — so a commit made tomorrow under an abandoned line comes out abandoned with nobody writing anything again.

A decision with no scope is about where it hangs, which is where it parts company with a question or a hypothesis, for which no scope means about everything. In a decision that would be a quiet trap: writing this line is dead while looking at one attempt would mark the whole tree. Abandoning everything means hanging it off the root or naming it.

The last wins: changing your mind is deciding again, and yesterday’s abandonment is still written with its reason.

Source

pub fn courses(&self) -> Result<BTreeMap<MoveId, (MoveId, Course)>, Trouble>

What was decided about each move, and by which decision.

The half of decided that never reaches a commit, and the one the reasoning is drawn from: an attempt nobody ran cites nothing and is still abandoned.

Source

pub fn standing(&self) -> Result<BTreeMap<MoveId, Standing>, Trouble>

How each question and hypothesis stands, counting what reached it.

What was withdrawn does not count, which is what makes a hypothesis go back to open on its own.

Source

pub fn withdrawn(&self) -> Result<BTreeSet<MoveId>, Trouble>

The moves whose evidence was judged wrong, so what they said no longer counts towards a standing.

This is where the two layers meet, and it only runs this way. A verdict is about the code — invalid is deliberately not a Course — and a finding read off a measurement that lied has nothing behind it. Nothing is deleted: the edge is still written and still drawn, and a later sound puts it back, because the journal keeps the last word and a standing is worked out rather than overwritten.

The direct verdict only. A commit under an invalid one inherits doubt and not a judgement — walk already draws that line — and inheriting it needs an ancestry nothing here asks git for.

It reaches up the DAG and not only at the move itself: a finding usually cites the trial it was seen in and hangs under the attempt, and it is the attempt that names the commit. Walking up can only ever pick up an attempt or a finding, since those are the only kinds that cite.

Source

pub fn read(&self, digest: &Digest) -> Result<Option<Vec<u8>>, Trouble>

The prose behind a citation, or whatever was kept there.

Auto Trait Implementations§

§

impl<'a> Freeze for Moves<'a>

§

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

§

impl<'a> Send for Moves<'a>

§

impl<'a> Sync for Moves<'a>

§

impl<'a> Unpin for Moves<'a>

§

impl<'a> UnsafeUnpin for Moves<'a>

§

impl<'a> !UnwindSafe for Moves<'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.