Trait jlrs::layout::valid_layout::ValidLayout
source · [−]pub unsafe trait ValidLayout {
const IS_REF: bool = false;
fn valid_layout(ty: Value<'_, '_>) -> bool;
}
Expand description
Trait used to check if a Rust type and Julia type have matching layouts. All wrappers generated by JlrsReflect.jl derive this trait. In this case all fields are checked recursively to determine if the value can be unboxed as that type.
Provided Associated Constants
Must be true
if the Rust type is a pointer wrapper type, i.e. if Self
implements
WrapperRef
, false
otherwise.
Required Methods
fn valid_layout(ty: Value<'_, '_>) -> bool
fn valid_layout(ty: Value<'_, '_>) -> bool
Check if the layout of the implementor is compatible with the layout of ty
. This
argument is a Value
to account for the fact that a field type can be a Union
,
UnionAll
or Union{}
.