Skip to main content

Parameter

Enum Parameter 

Source
pub enum Parameter<S = String> {
    Null,
    Derived,
    Bool(bool),
    LogicalUnknown,
    Integer(S),
    Real(S),
    Text(S),
    Binary(S),
    Enum(S),
    Ref(InstanceId),
    List(Vec<Self>),
    Typed {
        type_name: S,
        value: Box<Self>,
    },
}
Expand description

One generic parameter value.

Variants§

§

Null

$, an omitted value.

§

Derived

*, a derived value.

§

Bool(bool)

.T. or .F..

§

LogicalUnknown

.U., the third logical state.

§

Integer(S)

Integer lexical form, preserved without a fixed precision limit.

§

Real(S)

Real lexical form, preserved without a fixed precision limit.

§

Text(S)

Decoded text.

§

Binary(S)

Binary digits without surrounding quotes.

§

Enum(S)

An enumeration name without surrounding dots.

§

Ref(InstanceId)

A # reference.

§

List(Vec<Self>)

A parenthesized aggregate.

§

Typed

A named parameter wrapper.

Fields

§type_name: S

Wrapper name.

§value: Box<Self>

Wrapped parameter. Multiple source arguments are represented by a Parameter::List.

Implementations§

Source§

impl<S> Parameter<S>

Source

pub fn as_reference(&self) -> Option<InstanceId>

Returns a referenced id when this is Parameter::Ref.

Source

pub fn as_list(&self) -> Option<&[Self]>

Returns aggregate items when this is Parameter::List.

Source

pub fn unwrap_typed(&self) -> &Self

Recursively removes typed wrappers.

Source§

impl<S: AsRef<str>> Parameter<S>

Source

pub fn as_text(&self) -> Option<&str>

Returns text content when this is Parameter::Text.

Source

pub fn as_f64(&self) -> Option<f64>

Returns a numeric approximation, accepting integer and real syntax.

Trait Implementations§

Source§

impl<S: Clone> Clone for Parameter<S>

Source§

fn clone(&self) -> Parameter<S>

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<S: Debug> Debug for Parameter<S>

Source§

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

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

impl<S: PartialEq> PartialEq for Parameter<S>

Source§

fn eq(&self, other: &Parameter<S>) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl<S: PartialEq> StructuralPartialEq for Parameter<S>

Auto Trait Implementations§

§

impl<S> Freeze for Parameter<S>
where S: Freeze, Vec<Parameter<S>>: Freeze, Box<Parameter<S>>: Freeze,

§

impl<S> RefUnwindSafe for Parameter<S>

§

impl<S> Send for Parameter<S>
where S: Send, Vec<Parameter<S>>: Send, Box<Parameter<S>>: Send,

§

impl<S> Sync for Parameter<S>
where S: Sync, Vec<Parameter<S>>: Sync, Box<Parameter<S>>: Sync,

§

impl<S> Unpin for Parameter<S>
where S: Unpin, Vec<Parameter<S>>: Unpin, Box<Parameter<S>>: Unpin,

§

impl<S> UnsafeUnpin for Parameter<S>

§

impl<S> UnwindSafe for Parameter<S>

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

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

Source§

type Error = !

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

Source§

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.