Skip to main content

Graph

Struct Graph 

Source
pub struct Graph { /* private fields */ }

Implementations§

Source§

impl Graph

Source

pub fn rebound(&self, to: &dyn Fn(&str) -> Option<Expr>) -> Graph

Every binding of a parameter to answers, by a ref or a default, bound to that answer.

Source

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

Source

pub fn skipped(&self) -> &[Skipped]

Source

pub fn expr(&self, path: &str) -> Option<&Expr>

Source

pub fn defined(&self, path: &str) -> Option<&Arc<Defined>>

Source

pub fn source(&self, path: &str) -> Option<&Arc<Defined>>

Source

pub fn source_expr(&self, path: &str) -> Option<Expr>

Source

pub fn sourced(&self) -> Graph

Each node as its file holds it, what only a song made gone.

Source

pub fn text(&self, path: &str) -> Option<&str>

Source

pub fn generation(&self, path: &str) -> Option<u64>

Source

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

What an invocation binding nothing for a name gets, in written order. A caller’s own binding wins, so this is only ever consulted for names the invocation left out.

Source

pub fn span(&self, path: &str) -> Option<FileSpan>

Source

pub fn score(&self, path: &str) -> Option<&Score>

The events a score file holds, None for every node an equation or a number writes.

Source

pub fn scale(&self, path: &str) -> Option<&Scale>

The cents a scale file holds: data a score’s degrees read, never a signal.

Source

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

Source

pub fn tempo(&self) -> Option<Tempo>

What variables/bpm and variables/meter hold, where this composition declares them.

Source

pub fn define(&mut self, path: &str, expr: Expr) -> bool

Adds a node no file backs — an ad-hoc expression read in this graph’s namespace. false when path is taken, so a probe can never shadow a composition’s own file.

Source

pub fn defining(&self, body: Expr) -> Held

A node no file backs, its reads of reserved variables already lowered.

Source

pub fn held(&self, path: &str) -> Option<Held>

Source

pub fn set(&mut self, path: &str, held: Option<Held>) -> Option<Held>

Source

pub fn holds_as(&self, path: &str, other: &Graph) -> bool

Source

pub fn read_as(&self, path: &str, other: &Graph) -> bool

Source

pub fn reaching(&self, roots: &[String]) -> BTreeSet<String>

Source

pub fn adopt(&mut self, from: &Graph, roots: &[String]) -> Vec<String>

Source

pub fn define_settled( &mut self, beside: Option<&Graph>, path: &str, expr: Expr, ) -> Result<bool, Vec<Refusal>>

Source§

impl Graph

Source

pub fn free_parameters(&self, path: &str) -> Vec<String>

free_parameters of the node at path, a bareword call naming a node this graph defines.

Source§

impl Graph

Source

pub fn values(&self, beside: Option<&Graph>) -> Result<Values, Vec<Refusal>>

Each reserved variable’s value, read off the node this graph holds, else beside’s.

Source

pub fn lower_reserved( &mut self, beside: Option<&Graph>, ) -> Result<(), Vec<Refusal>>

Every read of a reserved variable lowered to its value: a b literal or span to seconds, a deg call to the tonic’s ref times its ratio. Beside a graph lowered before, each of its nodes that read a variable under another value than it holds now is read again from its text and lowered here.

Source§

impl Graph

Source

pub fn song(&self, root: &str) -> Result<Song, Vec<Refusal>>

Steps 3 to 7 short of the spans: every line root reaches placed on the tempo curve, every lane swept, and each node no score sits under lowered with the lanes reaching it.

Source§

impl Graph

Source

pub fn apply(&mut self, lowered: Lowered)

Each node’s body a song lowered, kept beside its source.

Trait Implementations§

Source§

impl Clone for Graph

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Debug for Graph

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl Freeze for Graph

§

impl RefUnwindSafe for Graph

§

impl Send for Graph

§

impl Sync for Graph

§

impl Unpin for Graph

§

impl UnsafeUnpin for Graph

§

impl UnwindSafe for Graph

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

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.