Skip to main content

ConsoleValue

Trait ConsoleValue 

Source
pub trait ConsoleValue: Sized {
    // Required methods
    fn to_text(&self) -> String;
    fn from_text(text: &str) -> Option<Self>;
}
Expand description

A value a console variable holds.

Required Methods§

Source

fn to_text(&self) -> String

The value as the console writes it.

Source

fn from_text(text: &str) -> Option<Self>

The value from the console’s text.

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 ConsoleValue for String

Source§

fn to_text(&self) -> String

Source§

fn from_text(text: &str) -> Option<Self>

Source§

impl ConsoleValue for bool

Source§

fn to_text(&self) -> String

Source§

fn from_text(text: &str) -> Option<Self>

Source§

impl ConsoleValue for f32

Source§

fn to_text(&self) -> String

Source§

fn from_text(text: &str) -> Option<Self>

Source§

impl ConsoleValue for i32

Source§

fn to_text(&self) -> String

Source§

fn from_text(text: &str) -> Option<Self>

Implementors§