Trait VerbArgument

Source
pub trait VerbArgument: Clone {
    // Required method
    fn from_value(value: &KdlEntry) -> Option<Self>;

    // Provided method
    fn get_error_type_name() -> &'static str { ... }
}
Expand description

A type that can be used as an argument of Verbs and Conditions

Required Methods§

Source

fn from_value(value: &KdlEntry) -> Option<Self>

Convert from a KdlEntry to the value

Implementations are free to accept more than a single way of interpreting values. E.g. a string and a integer.

Provided Methods§

Source

fn get_error_type_name() -> &'static str

A human-readable typename

This is shown only in error-messages

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl VerbArgument for bool

Source§

fn from_value(value: &KdlEntry) -> Option<Self>

Source§

impl VerbArgument for f64

Source§

fn from_value(value: &KdlEntry) -> Option<Self>

Source§

impl VerbArgument for usize

Source§

fn from_value(value: &KdlEntry) -> Option<Self>

Source§

impl VerbArgument for String

Source§

fn from_value(value: &KdlEntry) -> Option<Self>

Implementors§