pub struct NullDatamodel;Expand description
The null datamodel: no data, and only In('id') conditions. Every other condition, value
expression, assignment, script and foreach is an evaluation error. Inline content (of
<content>) is not an expression and is passed through as a string.
Implementations§
Source§impl NullDatamodel
impl NullDatamodel
Trait Implementations§
Source§impl Clone for NullDatamodel
impl Clone for NullDatamodel
impl Copy for NullDatamodel
Source§impl Datamodel for NullDatamodel
impl Datamodel for NullDatamodel
Source§fn snapshot(&self) -> Value
fn snapshot(&self) -> Value
The null datamodel has no state: its snapshot is the empty value (undefined).
Source§fn init_session(&mut self, _info: &SessionInfo) -> Result<(), EvalError>
fn init_session(&mut self, _info: &SessionInfo) -> Result<(), EvalError>
Prepare a fresh session: set the system variables
_sessionid, _name and
_ioprocessors. Called once before any other operation.Source§fn set_environment(&mut self, _env: &Environment)
fn set_environment(&mut self, _env: &Environment)
Set the sources of nondeterminism for the input about to be processed.
Source§fn declare(&mut self, _id: &str) -> Result<(), EvalError>
fn declare(&mut self, _id: &str) -> Result<(), EvalError>
Create a data item with an undefined value.
Source§fn eval_cond(
&mut self,
expr: &str,
states: &dyn StateQuery,
) -> Result<bool, EvalError>
fn eval_cond( &mut self, expr: &str, states: &dyn StateQuery, ) -> Result<bool, EvalError>
Evaluate a condition. Must not change the datamodel ([[openspec:datamodel#Guard Purity]]).
Source§fn eval_value(
&mut self,
_expr: &str,
_states: &dyn StateQuery,
) -> Result<Value, EvalError>
fn eval_value( &mut self, _expr: &str, _states: &dyn StateQuery, ) -> Result<Value, EvalError>
Evaluate a value expression.
Source§fn eval_content(&mut self, content: &str) -> Result<Value, EvalError>
fn eval_content(&mut self, content: &str) -> Result<Value, EvalError>
Interpret inline content (of
<data>, <assign>, <content>) as a value.Source§fn assign_expr(
&mut self,
_location: &str,
_expr: &str,
_states: &dyn StateQuery,
) -> Result<(), EvalError>
fn assign_expr( &mut self, _location: &str, _expr: &str, _states: &dyn StateQuery, ) -> Result<(), EvalError>
Assign the value of an expression to a location (
<assign location expr>).Source§fn assign_value(
&mut self,
_location: &str,
_value: Value,
) -> Result<(), EvalError>
fn assign_value( &mut self, _location: &str, _value: Value, ) -> Result<(), EvalError>
Assign a value to a location. The location must already exist.
Source§fn bind_var(&mut self, _name: &str, _value: Value) -> Result<(), EvalError>
fn bind_var(&mut self, _name: &str, _value: Value) -> Result<(), EvalError>
Bind a variable, declaring it when it does not exist (used by
foreach item and index).Source§fn is_location(&mut self, _location: &str) -> bool
fn is_location(&mut self, _location: &str) -> bool
Whether
location is a legal, existing location (used by foreach and idlocation).Source§fn exec_script(
&mut self,
_script: &str,
_states: &dyn StateQuery,
) -> Result<(), EvalError>
fn exec_script( &mut self, _script: &str, _states: &dyn StateQuery, ) -> Result<(), EvalError>
Execute a script.
Source§fn foreach_items(
&mut self,
_array: &str,
_states: &dyn StateQuery,
) -> Result<Vec<Value>, EvalError>
fn foreach_items( &mut self, _array: &str, _states: &dyn StateQuery, ) -> Result<Vec<Value>, EvalError>
Evaluate a
foreach array expression to its items, shallow-copied, in index order.Source§fn restore(&mut self, snapshot: &Value) -> Result<(), EvalError>
fn restore(&mut self, snapshot: &Value) -> Result<(), EvalError>
Restore a state produced by
Datamodel::snapshot.Source§fn check_event(&self, _event: &Event) -> Result<(), EvalError>
fn check_event(&self, _event: &Event) -> Result<(), EvalError>
Whether
event’s payload has the type the chart declares for it. A datamodel without
declared event types accepts every payload (the default). The interpreter does not call
this: a host calls it, through admit, before it hands an event to the session.Source§impl Debug for NullDatamodel
impl Debug for NullDatamodel
Source§impl Default for NullDatamodel
impl Default for NullDatamodel
impl Eq for NullDatamodel
Source§impl PartialEq for NullDatamodel
impl PartialEq for NullDatamodel
impl StructuralPartialEq for NullDatamodel
Auto Trait Implementations§
impl Forget for NullDatamodel
impl Freeze for NullDatamodel
impl Move for NullDatamodel
impl RefUnwindSafe for NullDatamodel
impl Send for NullDatamodel
impl Sync for NullDatamodel
impl Unpin for NullDatamodel
impl UnsafeUnpin for NullDatamodel
impl UnwindSafe for NullDatamodel
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