pub struct NodeInner { /* private fields */ }
Expand description
Represents points with attributes and timeseries. These can be any point as long as they’ll be on the network and connection to each other.
The attributes can be any format. There is a special type of attribute timeseries to deal with timeseries data that has been provided by the system. But users are free to make their own attributes and plugins + functions that can work with those attributes.
Since attributes are loaded using TOML file, simple attributes can be stored and parse from strings, and complex ones can be saved in different files and their path can be stored as node attributes.
Here is an example node attribute file. Here we have string, float, int and boolean values, as well as a timeseries definition.
[attrs]
stn="smithland"
nat_7q10=12335.94850131619
orsanco_7q10=16900
lock=true
...
[timeseries]
natural={path="../test.csv", dtype="float", ...}
Implementations§
source§impl NodeInner
impl NodeInner
pub fn index(&self) -> usize
pub fn set_index(&mut self, ind: usize)
pub fn name(&self) -> &str
pub fn set_name(&mut self, name: &str)
pub fn order(&self) -> usize
pub fn set_order(&mut self, ord: usize)
pub fn level(&self) -> usize
pub fn set_level(&mut self, level: usize)
pub fn attr(&self, key: &str) -> Option<Value>
pub fn has_attr(&self, key: &str) -> bool
pub fn set_attr<T: ToString>(&mut self, key: T, value: Value)
pub fn extend_attrs(&mut self, table: Table)
pub fn load_attr(&mut self, file: &Path) -> Result<()>
pub fn set_timeseries(&mut self, name: &str, ts: LoadedTimeSeries)
pub fn has_timeseries(&self, name: &str) -> bool
pub fn list_timeseries(&self) -> Vec<&str>
pub fn timeseries(&mut self, name: &str) -> Result<&LoadedTimeSeries>
pub fn input(&self, index: usize) -> Option<&Node>
pub fn order_inputs(&mut self)
pub fn inputs(&self) -> impl Iterator<Item = &Node>
pub fn output(&self) -> Option<Node>
pub fn add_input(&mut self, inp: &Node)
pub fn set_output(&mut self, output: &Node)
pub fn unset_output(&mut self)
pub fn render(&self, templ: &Template) -> Result<String>
pub fn print(&self)
pub fn print_attrs(&self)
Auto Trait Implementations§
impl Freeze for NodeInner
impl !RefUnwindSafe for NodeInner
impl !Send for NodeInner
impl !Sync for NodeInner
impl Unpin for NodeInner
impl !UnwindSafe for NodeInner
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more