Placed

Struct Placed 

Source
pub struct Placed {
    pub program: Program,
    pub roles: Roles,
    pub wire_id: String,
    pub placement: Solution,
    pub graph: Graph,
    pub render: Decision,
    pub kind: Kind,
}
Expand description

A program with its signal graph sliced into the roles the runtime drives.

Fields§

§program: Program§roles: Roles§wire_id: String

A content-derived id for the command channel, per §4.3: “a stable, content-derived operation id (sha256(module, name, signature)[..16]) — not a URL a human maintains, and stable across refactors that don’t change the signature.”

§placement: Solution

How stage 7 placed the program, kept so that beck explain place prints the derivation rather than re-deriving it from a second, drifting copy.

§graph: Graph

The signal graph itself, kept so that beck explain flow, the incremental analysis and any later view engine read what the slicer read rather than re-deriving it.

§render: Decision

Where this program’s component renders, and what follows (crate::render). Decided here because the fact it turns on — whether the sliced view reads the session — is this module’s to know.

§kind: Kind

Whether this is an application or a library — a module with no merge point, whose Placed::roles are placeholders rather than a slice of anything.

A library used to have no Placed at all, which meant it had no way to run its own tests (docs/22 §22.6, docs/25 §25.6 item 1): every SICP exercise is a library, and so is every domain module a real project would most want unit tests for. It has one now — but a placeholder role is a lie a caller must not be able to tell by accident, so the flag is on the struct and Placed::is_application is what the paths that drive a program ask.

Implementations§

Source§

impl Placed

Source

pub fn is_application(&self) -> bool

Source

pub fn library(program: Program, graph: Graph, wire_id: String) -> Placed

A module with no merge point, wrapped so that the parts of the toolchain that do not need one can still reach it.

The four roles are placeholders and they are chosen to be inert rather than plausible: the fold returns its accumulator unchanged, validate refuses everything, the view renders nothing and the initial state is unit. Nothing should ever call them — Kind::Library is the flag that says so, and beck test refuses a given, a when or a page expectation against a library by name rather than running one of these and reporting a confusing pass.

Trait Implementations§

Source§

impl Clone for Placed

Source§

fn clone(&self) -> Placed

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Placed

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl Freeze for Placed

§

impl RefUnwindSafe for Placed

§

impl Send for Placed

§

impl Sync for Placed

§

impl Unpin for Placed

§

impl UnwindSafe for Placed

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.