Trait Voxel

Source
pub trait Voxel<Ind, Pos, Vel, Force>:
    Send
    + Sync
    + Clone
    + Serialize
    + for<'a> Deserialize<'a> {
    // Required method
    fn get_index(&self) -> Ind;

    // Provided method
    fn custom_force_on_cell(
        &self,
        _pos: &Pos,
        _vel: &Vel,
    ) -> Option<Result<Force, CalcError>> { ... }
}
Expand description

The Domain trait generalizes over the Voxel generic parameter which

Required Methods§

Source

fn get_index(&self) -> Ind

Gets the Index of the voxel.

Provided Methods§

Source

fn custom_force_on_cell( &self, _pos: &Pos, _vel: &Vel, ) -> Option<Result<Force, CalcError>>

Voxels can exert custom forces on cells. In the future this function will probably be part of a different Trait.

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.

Implementors§