Struct dmntk_feel::FeelScope

source ·
pub struct FeelScope { /* private fields */ }
Expand description

The FEEL scope.

Implementations§

source§

impl FeelScope

source

pub fn contexts(&self) -> Vec<FeelContext>

Temporary - remove

source

pub fn new() -> Self

Creates a new and empty FeelScope.

source

pub fn push(&self, ctx: FeelContext)

Pushes a context on the top of the scope stack.

source

pub fn append(&self, other: FeelScope)

Appends the content of another scope at the end of this scope.

source

pub fn pop(&self) -> Option<FeelContext>

Takes and returns a context from the top of the stack.

source

pub fn peek(&self) -> Option<FeelContext>

Peeks a context from the top of the stack. If the stack is empty, the default context is returned.

source

pub fn get_value(&self, name: &Name) -> Option<Value>

Returns a value of an entry with specified name. Entries are searched from the last to the first context, (from top to bottom of the stack).

source

pub fn search(&self, names: &[Name]) -> Option<Value>

Searches for a value under so called qualified name build from multiple names passed as an argument.

source

pub fn search_entry(&self, qname: &QualifiedName) -> Option<Value>

Searches for a value of an entry pointed by specified qualified name.

source

pub fn set_value(&self, name: &Name, value: Value)

Sets a specified value for entry name in FeelContext placed on the top of the scope stack.

source

pub fn set_name(&self, name: Name)

Sets a null value for entry name in FeelContext placed on the top of the scope stack.

Trait Implementations§

source§

impl Default for FeelScope

source§

fn default() -> Self

Creates a default FeelScope containing single default FeelContext.

source§

impl Display for FeelScope

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Converts FeelScope to text.

source§

impl From<FeelContext> for FeelScope

source§

fn from(ctx: FeelContext) -> Self

Creates a FeelScope from FeelContext.

source§

impl Jsonify for FeelScope

source§

fn jsonify(&self) -> String

Converts this FeelScope to JSON text.

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> ToString for T
where T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
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.