pub trait TypeInterface {
// Required methods
fn bone(&self) -> &Interned<NameBone>;
fn interface(&self) -> impl Iterator<Item = (&Interned<str>, &Ty)>;
fn field_by_bone_offset(&self, idx: usize) -> Option<&Ty>;
// Provided method
fn field_by_name(&self, name: &Interned<str>) -> Option<&Ty> { ... }
}
Expand description
A common type kinds for those types that has fields (Abstracted record type).
Required Methods§
Sourcefn interface(&self) -> impl Iterator<Item = (&Interned<str>, &Ty)>
fn interface(&self) -> impl Iterator<Item = (&Interned<str>, &Ty)>
Iterate over the fields of a record.
Sourcefn field_by_bone_offset(&self, idx: usize) -> Option<&Ty>
fn field_by_bone_offset(&self, idx: usize) -> Option<&Ty>
Get the field by bone offset.
Provided Methods§
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.