Skip to main content

TangoElement

Trait TangoElement 

Source
pub trait TangoElement: Element {
    const ATTR_KIND: AttrDataKind;
    const CMD_SCALAR_KIND: Option<CommandDataKind>;
    const CMD_ARRAY_KIND: Option<CommandDataKind>;

    // Required methods
    fn wrap(format: ValueFormat<Self>) -> Value;
    fn unwrap(data: Value) -> Result<ValueFormat<Self>, Value>;
    fn unwrap_ref(data: &Value) -> Option<&ValueFormat<Self>>;
}
Expand description

An element type Tango has: which variant of Value holds it, and what kinds it is advertised as, see AttrData and CommandData.

Required Associated Constants§

Source

const ATTR_KIND: AttrDataKind

The kind of an attribute of such values.

Source

const CMD_SCALAR_KIND: Option<CommandDataKind>

The kind of a command argument of one such value, absent if none can be.

Source

const CMD_ARRAY_KIND: Option<CommandDataKind>

The kind of a command argument of an array of such values, absent if none can be.

Required Methods§

Source

fn wrap(format: ValueFormat<Self>) -> Value

Source

fn unwrap(data: Value) -> Result<ValueFormat<Self>, Value>

Source

fn unwrap_ref(data: &Value) -> Option<&ValueFormat<Self>>

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 TangoElement for bool

Source§

impl TangoElement for f32

Source§

impl TangoElement for f64

Source§

impl TangoElement for i16

Source§

impl TangoElement for i32

Source§

impl TangoElement for i64

Source§

impl TangoElement for str

Source§

impl TangoElement for u8

Source§

impl TangoElement for u16

Source§

impl TangoElement for u32

Source§

impl TangoElement for u64

Implementors§