pub struct Graph { /* private fields */ }Implementations§
Source§impl Graph
impl Graph
Sourcepub fn rebound(&self, to: &dyn Fn(&str) -> Option<Expr>) -> Graph
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.
pub fn defines(&self, path: &str) -> bool
pub fn skipped(&self) -> &[Skipped]
pub fn expr(&self, path: &str) -> Option<&Expr>
pub fn defined(&self, path: &str) -> Option<&Arc<Defined>>
pub fn source(&self, path: &str) -> Option<&Arc<Defined>>
pub fn source_expr(&self, path: &str) -> Option<Expr>
pub fn text(&self, path: &str) -> Option<&str>
pub fn generation(&self, path: &str) -> Option<u64>
Sourcepub fn defaults(&self, path: &str) -> &[(String, Expr)]
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.
pub fn span(&self, path: &str) -> Option<FileSpan>
Sourcepub fn score(&self, path: &str) -> Option<&Score>
pub fn score(&self, path: &str) -> Option<&Score>
The events a score file holds, None for every node an equation or a number writes.
Sourcepub fn scale(&self, path: &str) -> Option<&Scale>
pub fn scale(&self, path: &str) -> Option<&Scale>
The cents a scale file holds: data a score’s degrees read, never a signal.
pub fn paths(&self) -> impl Iterator<Item = &str>
Sourcepub fn tempo(&self) -> Option<Tempo>
pub fn tempo(&self) -> Option<Tempo>
What variables/bpm and variables/meter hold, where this composition declares them.
Sourcepub fn define(&mut self, path: &str, expr: Expr) -> bool
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.
Sourcepub fn defining(&self, body: Expr) -> Held
pub fn defining(&self, body: Expr) -> Held
A node no file backs, its reads of reserved variables already lowered.
pub fn held(&self, path: &str) -> Option<Held>
pub fn set(&mut self, path: &str, held: Option<Held>) -> Option<Held>
pub fn holds_as(&self, path: &str, other: &Graph) -> bool
pub fn read_as(&self, path: &str, other: &Graph) -> bool
pub fn reaching(&self, roots: &[String]) -> BTreeSet<String>
pub fn adopt(&mut self, from: &Graph, roots: &[String]) -> Vec<String>
pub fn define_settled( &mut self, beside: Option<&Graph>, path: &str, expr: Expr, ) -> Result<bool, Vec<Refusal>>
Source§impl Graph
impl Graph
Sourcepub fn free_parameters(&self, path: &str) -> Vec<String>
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
impl Graph
Sourcepub fn values(&self, beside: Option<&Graph>) -> Result<Values, Vec<Refusal>>
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.
Sourcepub fn lower_reserved(
&mut self,
beside: Option<&Graph>,
) -> Result<(), Vec<Refusal>>
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.