Trait Content

Source
pub trait Content: Debug {
    // Required methods
    fn get_script(&self) -> Option<&str>;
    fn get_name(&self) -> Option<&str>;
    fn get_carrier_ids(&mut self) -> Vec<NodeID>;
    fn get_causes_by_id(&self, id: NodeID) -> Option<&Vec<Vec<NodeID>>>;
    fn get_effects_by_id(&self, id: NodeID) -> Option<&Vec<Vec<NodeID>>>;
}
Expand description

An abstraction over script formats: various ways c-e structures are described in text.

This trait is implemented by intermediate representation types, YamlContent and ascesis::*.

Note: types implementing Content trait shouldn’t own ContextHandles, because Content trait objects are owned by CEStructure structs, along with ContextHandles themselves.

Required Methods§

Source

fn get_script(&self) -> Option<&str>

Script is a content description in text, for example, YAML-formatted string or Ascesis source.

Source

fn get_name(&self) -> Option<&str>

Source

fn get_carrier_ids(&mut self) -> Vec<NodeID>

Source

fn get_causes_by_id(&self, id: NodeID) -> Option<&Vec<Vec<NodeID>>>

Source

fn get_effects_by_id(&self, id: NodeID) -> Option<&Vec<Vec<NodeID>>>

Implementations on Foreign Types§

Source§

impl Content for String

Implementors§