Skip to main content

VariableType

Trait VariableType 

Source
pub trait VariableType {
    type Output;

    // Required methods
    fn get_var(name: &str) -> Self::Output;
    fn set_var(name: &str, var: Self);
}
Expand description

Typ, der an Script-Variablen gebunden werden kann.

Type that can be bound to script variables.

Required Associated Types§

Source

type Output

Rückgabetyp beim Lesen der Variable.

Return type when reading the variable.

Required Methods§

Source

fn get_var(name: &str) -> Self::Output

Liest die Variable mit dem angegebenen Namen.

Reads the variable with the given name.

Source

fn set_var(name: &str, var: Self)

Schreibt die Variable mit dem angegebenen Namen.

Writes the variable with the given name.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl VariableType for &str

Source§

type Output = String

Source§

fn get_var(name: &str) -> Self::Output

Source§

fn set_var(name: &str, var: Self)

Source§

impl VariableType for String

Source§

type Output = String

Source§

fn get_var(name: &str) -> Self::Output

Source§

fn set_var(name: &str, var: Self)

Source§

impl VariableType for bool

Source§

type Output = bool

Source§

fn get_var(name: &str) -> Self::Output

Source§

fn set_var(name: &str, var: Self)

Source§

impl VariableType for f32

Source§

type Output = f32

Source§

fn get_var(name: &str) -> Self::Output

Source§

fn set_var(name: &str, var: Self)

Source§

impl VariableType for f64

Source§

type Output = f64

Source§

fn get_var(name: &str) -> Self::Output

Source§

fn set_var(name: &str, var: Self)

Source§

impl VariableType for i8

Source§

type Output = i8

Source§

fn get_var(name: &str) -> Self::Output

Source§

fn set_var(name: &str, var: Self)

Source§

impl VariableType for i16

Source§

type Output = i16

Source§

fn get_var(name: &str) -> Self::Output

Source§

fn set_var(name: &str, var: Self)

Source§

impl VariableType for i32

Source§

type Output = i32

Source§

fn get_var(name: &str) -> Self::Output

Source§

fn set_var(name: &str, var: Self)

Source§

impl VariableType for i64

Source§

type Output = i64

Source§

fn get_var(name: &str) -> Self::Output

Source§

fn set_var(name: &str, var: Self)

Source§

impl VariableType for u8

Source§

type Output = u8

Source§

fn get_var(name: &str) -> Self::Output

Source§

fn set_var(name: &str, var: Self)

Source§

impl VariableType for u16

Source§

type Output = u16

Source§

fn get_var(name: &str) -> Self::Output

Source§

fn set_var(name: &str, var: Self)

Source§

impl VariableType for u32

Source§

type Output = u32

Source§

fn get_var(name: &str) -> Self::Output

Source§

fn set_var(name: &str, var: Self)

Source§

impl VariableType for u64

Source§

type Output = u64

Source§

fn get_var(name: &str) -> Self::Output

Source§

fn set_var(name: &str, var: Self)

Implementors§