Skip to main content

StepContext

Struct StepContext 

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

What a step is run with: the part, the runner running it, and its own id — what everything it produces is named after. A step only declares what it produces (StepContext::produce); what takes work is done in the makes.

Implementations§

Source§

impl<'a> StepContext<'a>

Source

pub fn step(&self) -> &'a str

The id of the step.

Source

pub fn runner(&self) -> &'a Runner

The runner running the step: the files around its program.

Source

pub fn reader(&self) -> Reader<'_>

The part as the step sees it so far, recording nothing: what a step that declares one node per element of something asks.

Source

pub fn produce<T: Target, Args: PartialEq + Clone + Debug + 'static>( &mut self, target: &TargetReference<T>, args: &Args, make: Make<Args, T>, ) -> GeopResult<()>

Produces the step’s node of target: reused if it was made from equal args and everything it read reads the same now, else made by make, at once, so that a later node of the step can read it. Fails as make fails, or if the step produced target already, or — for a target that is not a chain (Target::CHAIN) — if a step before produced it, naming both.

Auto Trait Implementations§

§

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

§

impl<'a> !Send for StepContext<'a>

§

impl<'a> !Sync for StepContext<'a>

§

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

§

impl<'a> Freeze for StepContext<'a>

§

impl<'a> Unpin for StepContext<'a>

§

impl<'a> UnsafeUnpin for StepContext<'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, 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.