Struct rush_core::Rush

source ·
pub struct Rush { /* private fields */ }

Implementations§

source§

impl Rush

source

pub fn new() -> Self

source

pub fn register_rule<C: CalcNode + Send + Sync + 'static, E: Exec + Send + Sync + 'static, T: Into<String>>( self, name: T, nodes: Vec<C>, exec: E ) -> Self

source

pub fn delete_rule<T: AsRef<str>>(&mut self, name: T)

source

pub fn raw_register_function<S: Into<String>, F: Function>( self, name: S, function: F ) -> Self

source

pub fn register_function<S: Into<String>, Args, Out, F>( self, name: S, function: F ) -> Selfwhere F: HostFunction<Args, Out> + 'static, Out: Serialize,

source

pub fn delete_function<S: AsRef<str>>(self, name: S) -> Self

source

pub fn execute(&self, obj: &Value, list: Vec<String>) -> Result<Value>

source§

impl Rush

source

pub fn set_env<E: Into<Env>>(self, env: E) -> Self

Trait Implementations§

source§

impl AsyncRuleFlow for Rush

source§

fn async_flow<'life0, 'async_trait, Obj, Out>( &'life0 self, obj: Obj ) -> Pin<Box<dyn Future<Output = Result<Out>> + Send + 'async_trait>>where Obj: 'async_trait + Serialize + Send, Out: 'async_trait + for<'a> Deserialize<'a>, Self: 'async_trait, 'life0: 'async_trait,

source§

impl Debug for Rush

source§

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

Formats the value using the given formatter. Read more
source§

impl Display for Rush

source§

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

Formats the value using the given formatter. Read more
source§

impl<C, E, I: IntoIterator<Item = (String, Vec<C>, E)>> From<I> for Rushwhere C: CalcNode + 'static, E: Exec + 'static,

source§

fn from(value: I) -> Self

Converts to this type from the input type.
source§

impl From<Rush> for MultiRush

source§

fn from(value: Rush) -> Self

Converts to this type from the input type.
source§

impl RuleFlow for Rush

source§

fn flow<Obj: Serialize, Out: Deserialize<'static>>( &self, obj: Obj ) -> Result<Out>

source§

fn version(&self) -> i32

Auto Trait Implementations§

§

impl !RefUnwindSafe for Rush

§

impl Send for Rush

§

impl Sync for Rush

§

impl Unpin for Rush

§

impl !UnwindSafe for Rush

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere 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 Twhere 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> PFArc<T> for T

source§

fn arc(self) -> Arc<T>

source§

impl<T> PFBox<T> for T

source§

fn to_box(self) -> Box<T>

source§

impl<Ok, T> PFErr<Ok> for T

source§

fn err(self) -> Result<Ok, Self>where Self: Sized,

source§

impl<Err, T> PFOk<Err> for T

source§

fn ok(self) -> Result<Self, Err>where Self: Sized,

source§

impl<T> PFSome<T> for T

source§

fn some(self) -> Option<T>

source§

impl<T> ToString for Twhere 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 Twhere 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 Twhere 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.