[][src]Enum rule::arg::Arg

pub enum Arg {
    Null,
    Bool(bool),
    Int(i64),
    Float(f64),
    String(String),
    Array(Vec<Arg>),
    Expr(Expr),
}

The argument type. Each argument can be a json primitive type or a Expr.

Variants

Null
Bool(bool)
Int(i64)
Float(f64)
String(String)
Array(Vec<Arg>)
Expr(Expr)

Methods

impl Arg[src]

pub fn as_bool(&self) -> Option<bool>[src]

If the Arg is a bool, returns the associated bool. Returns None otherwise.

pub fn as_str(&self) -> Option<&str>[src]

If the Arg is a String, returns the associated String. Returns None otherwise.

pub fn from_json(val: Json) -> Result<Arg>[src]

pub fn from_json_context_var(val: Json) -> Result<Arg>[src]

pub fn from_context_var(
    args: &Vec<Arg>,
    context: &Map<String, Json>
) -> Result<Arg>
[src]

Trait Implementations

impl Into<String> for Arg[src]

impl Into<i64> for Arg[src]

impl<'a> Into<i64> for &'a Arg[src]

impl Into<f64> for Arg[src]

impl Into<Option<Expr>> for Arg[src]

impl Into<Arg> for Json[src]

impl Into<bool> for Arg[src]

impl<'_> Into<bool> for &'_ Arg[src]

impl<'a> From<&'a Arg> for String[src]

impl Clone for Arg[src]

impl PartialEq<Arg> for Arg[src]

impl PartialOrd<Arg> for Arg[src]

impl Display for Arg[src]

impl Debug for Arg[src]

impl Div<Arg> for Arg[src]

type Output = Arg

The resulting type after applying the / operator.

impl Rem<Arg> for Arg[src]

type Output = Arg

The resulting type after applying the % operator.

impl Sub<Arg> for Arg[src]

type Output = Arg

The resulting type after applying the - operator.

impl Add<Arg> for Arg[src]

type Output = Arg

The resulting type after applying the + operator.

impl<'a> Add<&'a Arg> for Arg[src]

type Output = Arg

The resulting type after applying the + operator.

impl Mul<Arg> for Arg[src]

type Output = Arg

The resulting type after applying the * operator.

impl Neg for Arg[src]

type Output = Arg

The resulting type after applying the - operator.

impl<'a> Neg for &'a Arg[src]

type Output = Arg

The resulting type after applying the - operator.

Auto Trait Implementations

impl Send for Arg

impl Sync for Arg

impl Unpin for Arg

impl UnwindSafe for Arg

impl RefUnwindSafe for Arg

Blanket Implementations

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> From<T> for T[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]