Trait DataObjectConstraint

pub trait DataObjectConstraint:
    Sized
    + Debug
    + Display
    + PartialEq
    + Clone
    + Send
    + Sync {
    type DataArg<'a>: Debug + Display + PartialEq + Clone + Send + Sync;

    // Required method
    fn as_arg(&self) -> Self::DataArg<'_>;
}
Expand description

Used for statically defining the allowed types stored in DataObjects.

Required Associated Types§

type DataArg<'a>: Debug + Display + PartialEq + Clone + Send + Sync

Specifies the type of an argument that provides a value to the DataObject. Generally, this type matches Self except for KanziString.

Required Methods§

fn as_arg(&self) -> Self::DataArg<'_>

Converts Self to a type accepted by DataObject::set_value.

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§

§

impl DataObjectConstraint for bool

§

type DataArg<'a> = bool

§

fn as_arg(&self) -> <bool as DataObjectConstraint>::DataArg<'_>

§

impl DataObjectConstraint for f64

§

type DataArg<'a> = f64

§

fn as_arg(&self) -> <f64 as DataObjectConstraint>::DataArg<'_>

§

impl DataObjectConstraint for i32

§

type DataArg<'a> = i32

§

fn as_arg(&self) -> <i32 as DataObjectConstraint>::DataArg<'_>

Implementors§