Skip to main content

Instances

Struct Instances 

Source
pub struct Instances { /* private fields */ }
Expand description

One file’s body beside what its parameters stand for: the body is shared, the scope is not. An instance lasts while a root or a reader holds it.

Implementations§

Source§

impl Instances

Source

pub fn render(&self, e: &Expr, cx: Cx<'_>) -> String

The text an instance name and a refusal quote carry, through the one printer.

Source

pub fn exprs(&self) -> BTreeMap<String, Expr>

Every instance’s body with each parameter already standing for what it was bound to.

Source§

impl Instances

Source

pub fn new(rate: u32) -> Instances

Source

pub fn origin(&self, instance: &str) -> Option<&str>

Source

pub fn deps(&self, path: &str) -> &[String]

Source

pub fn paths(&self) -> impl Iterator<Item = &str>

Source

pub fn holds(&self, path: &str) -> bool

Source

pub fn instance_of(&self, target: &str) -> Result<String, EngineError>

A bare file name is the file read as a root, on its own terms; a call site’s instance carries the bindings that made it.

Source

pub fn instances_of<'a>( &'a self, file: &'a str, ) -> impl Iterator<Item = String> + 'a

Source

pub fn at<'a>(&'a self, path: &str) -> Option<(&'a Expr, Cx<'a>)>

Source

pub fn bindings<'a>( &'a self, path: &str, ) -> Option<Vec<(&'a str, &'a Expr, Cx<'a>)>>

Source§

impl Instances

Source

pub fn follow<'a, R>( &'a self, e: &'a Expr, cx: Cx<'a>, go: impl FnOnce(&'a Expr, Cx<'_>) -> R, ) -> Option<R>

A bound name continues in what it stands for; anything else is read where it stands.

Source

pub fn node<'a>(&'a self, e: &'a Expr, cx: Cx<'_>) -> Node<'a>

Source

pub fn reads_self(&self, path: &str) -> bool

Trait Implementations§

Source§

impl Debug for Instances

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.