Skip to main content

ConstructionSite

Enum ConstructionSite 

Source
pub enum ConstructionSite {
    Cell(CellSlot),
    Policy {
        cell: CellSlot,
        index: usize,
    },
    Method {
        relationship: RelationshipSlot,
        index: usize,
    },
    Relationship(RelationshipSlot),
}
Expand description

Identifies an authored construction boundary before any live relationship exists.

Method indices precede source specialization; policy indices count registrations on the same local cell. Handles retain definition identity without retaining recipes.

§Examples

use adam_rs::{ConstructionSite, Sheet, TemplateBuilder, TemplateError};
let mut builder = TemplateBuilder::new();
let slot = builder.cell::<i32, _>("value",
    || Err(std::io::Error::other("initialization failed").into()))?;
let template = builder.finish()?;
let error = template.instantiate(&mut Sheet::new(), &[]).unwrap_err();
assert!(matches!(error, TemplateError::Construction {
    site: ConstructionSite::Cell(ref failed), ..
} if failed == &slot));

Variants§

§

Cell(CellSlot)

Constructs one private cell.

§

Policy

Attaches one cell’s filter or requirement, in registration order.

Fields

§cell: CellSlot

Identifies the governed cell.

§index: usize

Identifies the cell-local policy registration.

§

Method

Constructs one authored method before specialization.

Fields

§relationship: RelationshipSlot

Identifies the local relationship.

§index: usize

Identifies the original authored method.

§

Relationship(RelationshipSlot)

Registers the combined relationship after its factories succeed.

Trait Implementations§

Source§

impl Debug for ConstructionSite

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

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

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

fn try_from(value: U) -> Result<T, !>

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.