Skip to main content

Probing

Struct Probing 

Source
pub struct Probing<'a> {
    pub python: &'a Path,
    pub probe: &'a Path,
    pub build: &'a str,
    pub store: Option<&'a Path>,
    pub given: Option<&'a Path>,
    pub recipe: Digest,
}
Expand description

Everything a probe needs that is the same for every commit it is asked about. Held together so a call says only what varies: the checkout.

Fields§

§python: &'a Path§probe: &'a Path§build: &'a str§store: Option<&'a Path>

Handed to the probe so it can say what is already computed. Not the store snapshots are remembered in, though it is usually the same one.

§given: Option<&'a Path>§recipe: Digest

What identifies this probing, everything but the commit: the build, the input, and the probe’s own source.

That last is not belt and braces. A snapshot is a pure function of a commit only given a fixed probe, so the day declared learned to read an object’s attributes, every snapshot taken before it became wrong — in exactly the way this tool exists to catch.

Implementations§

Source§

impl Probing<'_>

Source

pub fn named(&self, commit: &str) -> String

The name this checkout’s snapshot is kept under. Content-addressed and immutable: a commit does not change, so neither does the answer.

Source

pub fn recalled(&self, kept: &dyn Store, commit: &str) -> Option<Snapshot>

What was already probed for this commit, without touching a checkout.

Its own method because a walk asks this of every commit first and only then lays out the ones nobody has an answer for. On a line of exploration that has been looked at once, that is no worktrees at all.

Source

pub fn remembered( &self, kept: &dyn Store, working: &Path, commit: &str, ) -> Result<Snapshot, Trouble>

The snapshot for this checkout, from the store if it is there.

A store that cannot answer is not the end of it, exactly as a keeper that cannot answer is not the end of a run: the probe is asked instead and the trouble is said out loud. A cache gone cold is slow; a cache that stops the tool is broken.

Source

pub fn compared( &self, taken: &HashMap<&str, Snapshot>, pairs: &[(String, String)], ) -> Result<Vec<Findings>, Trouble>

What the edit did, for each of these pairs of (older, newer).

Pairs and not an ordered list, because a step is an edge: two entries next to each other in a walk of three branches are two different lines of exploration, and comparing them would answer confidently about an edit nobody made.

One subprocess for the whole walk — comparing needs no checkout and no graph, only the model and the snapshots. The model is somatize.foreseen’s and nothing here decides what a finding means.

Source

pub fn checked(&self, working: &Path, node: &str) -> Result<Value, Trouble>

Whether an edit survives: it parses, a linter is quiet, the graph still builds, and the node runs on what its predecessors left in the store.

Asked in a checkout that is the same tree a fork would commit, so a green light is about the thing that would land and not about something near it.

Source

pub fn prettified(&self, source: &str) -> Result<Value, Trouble>

The same source, formatted — or the same source back and a reason.

ruff format if this environment has one. Refused rather than half-done when it does not: handing back something that looks formatted and is not is worse than a button that says it cannot.

Source

pub fn taken( &self, working: &Path, commit: &str, ) -> Result<(Snapshot, Vec<u8>), Trouble>

Runs the probe in a checkout and reads what it wrote, with the bytes it wrote — which are what gets kept.

A subprocess and not a library call, and it is why this tool has two languages in it: the graph only exists once the checkout’s own code has been imported and run, against the soma that checkout pins. Reaching into it from here would run one version of the engine over another version’s declarations.

Auto Trait Implementations§

§

impl<'a> Freeze for Probing<'a>

§

impl<'a> RefUnwindSafe for Probing<'a>

§

impl<'a> Send for Probing<'a>

§

impl<'a> Sync for Probing<'a>

§

impl<'a> Unpin for Probing<'a>

§

impl<'a> UnsafeUnpin for Probing<'a>

§

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