pub trait ContinuousBoundary: Sync {
// Required methods
fn dim(&self) -> usize;
fn apply_position(&self, r: &mut [f64]) -> Result<(), BoundaryError>;
// Provided methods
fn may_fail_after_validation(&self) -> bool { ... }
fn apply_position_velocity(
&self,
r: &mut [f64],
v: &mut [f64],
) -> Result<(), BoundaryError> { ... }
fn apply_positions(
&self,
positions: &mut [f64],
) -> Result<(), BoundaryError> { ... }
fn apply_positions_velocities(
&self,
positions: &mut [f64],
velocities: &mut [f64],
) -> Result<(), BoundaryError> { ... }
fn apply_position_with_velocity_flip_mask(
&self,
r: &mut [f64],
flip_mask: &mut [u8],
) -> Result<(), BoundaryError> { ... }
}Required Methods§
fn dim(&self) -> usize
fn apply_position(&self, r: &mut [f64]) -> Result<(), BoundaryError>
Provided Methods§
Sourcefn may_fail_after_validation(&self) -> bool
fn may_fail_after_validation(&self) -> bool
Whether correctly dimensioned vectors can still produce an error.
The conservative default lets particle adapters stage fallible custom
transformations and commit only on success. Override with false only
when both position and position/velocity methods cannot fail after shape
validation. This is an error-atomicity contract, not a memory-safety one.
fn apply_position_velocity( &self, r: &mut [f64], v: &mut [f64], ) -> Result<(), BoundaryError>
fn apply_positions(&self, positions: &mut [f64]) -> Result<(), BoundaryError>
fn apply_positions_velocities( &self, positions: &mut [f64], velocities: &mut [f64], ) -> Result<(), BoundaryError>
fn apply_position_with_velocity_flip_mask( &self, r: &mut [f64], flip_mask: &mut [u8], ) -> Result<(), BoundaryError>
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".