logos.lang.any

Module lang · package logos-lang

Traits

traitAny

trait Any

Trait for runtime type identification; a blanket impl makes every type Any.

Implemented by: T

Types

structTypeId

struct TypeId

Identifies a type as an opaque, comparable 128-bit nominal UID. Carried as two u64 halves (lo = bits 0..63, hi = bits 64..127); 128 bits keeps cross-type collision probability at 2^-128 (matches Rust’s TypeId) — a collision would make downcast unsound.

Implements: Copy Eq

Fields

hi: u64

High 64 bits (bits 64..127) of the type UID.

lo: u64

Low 64 bits (bits 0..63) of the type UID.

Methods

fn eq(self: &TypeId, other: &TypeId) -> bool
fn ne(self: &TypeId, other: &TypeId) -> bool

Functions

fnany_is

fn any_is(a: &dyn Any) -> bool

Returns whether the erased value a holds a _T — the (dyn Any).is::<T>() analogue. Sound for struct/enum erased values only; see the primitive caveat in the module header.

fntype_id_of

fn type_id_of() -> TypeId

Returns the TypeId of _T — the TypeId::of::<T>() analogue. _T appears only at the type level (via type_uid::<_T>()), never in the signature; the _-prefix keeps the unused-type-param lint quiet. Both halves are folded at mono.