Struct nadi_core::node::NodeInner

source ·
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

source

pub fn index(&self) -> usize

source

pub fn set_index(&mut self, ind: usize)

source

pub fn name(&self) -> &str

source

pub fn set_name(&mut self, name: &str)

source

pub fn order(&self) -> usize

source

pub fn set_order(&mut self, ord: usize)

source

pub fn level(&self) -> usize

source

pub fn set_level(&mut self, level: usize)

source

pub fn attr(&self, key: &str) -> Option<Value>

source

pub fn has_attr(&self, key: &str) -> bool

source

pub fn set_attr<T: ToString>(&mut self, key: T, value: Value)

source

pub fn extend_attrs(&mut self, table: Table)

source

pub fn load_attr(&mut self, file: &Path) -> Result<()>

source

pub fn set_timeseries(&mut self, name: &str, ts: LoadedTimeSeries)

source

pub fn has_timeseries(&self, name: &str) -> bool

source

pub fn list_timeseries(&self) -> Vec<&str>

source

pub fn timeseries(&mut self, name: &str) -> Result<&LoadedTimeSeries>

source

pub fn input(&self, index: usize) -> Option<&Node>

source

pub fn order_inputs(&mut self)

source

pub fn inputs(&self) -> impl Iterator<Item = &Node>

source

pub fn output(&self) -> Option<Node>

source

pub fn add_input(&mut self, inp: &Node)

source

pub fn set_output(&mut self, output: &Node)

source

pub fn unset_output(&mut self)

source

pub fn render(&self, templ: &Template) -> Result<String>

source

pub fn print(&self)

source

pub fn print_attrs(&self)

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>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

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.