pub trait Type: Debug + Display {
    fn is_scalar(&self) -> bool;
fn is_discrete(&self) -> bool;
fn is_numeric(&self) -> bool;
fn is_composite(&self) -> bool;
fn into_owned<'a>(self) -> OwnedType<'a>
    where
        Self: 'a
;
fn to_owned<'a>(&self) -> OwnedType<'a>
    where
        Self: 'a
;
fn as_any(&self) -> AnyType<'_>; fn is_equal(&self, other: &dyn Type) -> bool { ... }
fn is_implicitly_castable(&self, _into: &dyn Type) -> bool { ... } }
Expand description

An interface for dealing with types.

This is the main type trait, which all types and subtypes implement.

Required methods

Check if this is a scalar type.

Enumeration, integer, floating-point, and physical types are scalar.

Check if this is a discrete type.

Enumeration and integer types are discrete.

Check if this is a numeric type.

Integer, floating-point, and physical types are numeric.

Check if this is a composite type.

Array and record types are composite.

Convert into an owned type.

Clone this type.

Converts from &Type to AnyType.

Provided methods

Check if two types are equal.

Check if the type can be implicitly cast to another.

Trait Implementations

Allocate a value of type T: ToOwned into this arena. Read more

Conditionally allocate a value of type Cow<T>. Read more

Forcefully allocate a value of type Cow<T>. Read more

Immutably borrows from an owned value. Read more

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

Uses borrowed data to replace owned data, usually by cloning. Read more

Implementors