Type ::std::any::Type

Overview

Represents a type in the Rune type system.

Methods

fn of_val(value) -> Type

Convert a value into a [Type] object.

Examples

let value1 = 42;
let value2 = 43;
let ty1 = Type::of_val(value1);
let ty2 = Type::of_val(value2);
assert_eq!(ty1, ty2);

Protocols

protocol string_display
println("{}", value)

Formatting a type.

Examples

use std::any;

assert_eq!(format!("{}", any::Type::of_val(42)), "Type(0x1cad9186c9641c4f)");