Skip to main content

MeshIndex

Trait MeshIndex 

Source
pub trait MeshIndex: Copy + Default {
    // Required methods
    fn to_u64(self) -> u64;
    fn from_usize(v: usize) -> Self;
    fn from_i32(v: i32) -> Self;
}
Expand description

Index parameter of a MeshGLP (u32 or u64), mirroring the I template parameter of the C++ MeshGLP. The kernel itself indexes with 32 bits for both instantiations (as the C++ does — its import casts every index to uint32_t), so u64 indices wider than 32 bits truncate on import exactly like the C++ static_cast.

Required Methods§

Source

fn to_u64(self) -> u64

Source

fn from_usize(v: usize) -> Self

Source

fn from_i32(v: i32) -> Self

Conversion from the kernel’s int indices on export. Matches C++ integral conversion: bit-pattern for u32, sign-extension for u64.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl MeshIndex for u32

Source§

fn to_u64(self) -> u64

Source§

fn from_usize(v: usize) -> Self

Source§

fn from_i32(v: i32) -> Self

Source§

impl MeshIndex for u64

Source§

fn to_u64(self) -> u64

Source§

fn from_usize(v: usize) -> Self

Source§

fn from_i32(v: i32) -> Self

Implementors§