pub struct PotentialImpl { /* private fields */ }Expand description
Opaque potential handle wrapping a callback + user data.
Implementations§
Source§impl PotentialImpl
impl PotentialImpl
Sourcepub fn new(
callback: PotentialCallback,
user_data: *mut c_void,
free_fn: Option<FreeFn>,
) -> Self
pub fn new( callback: PotentialCallback, user_data: *mut c_void, free_fn: Option<FreeFn>, ) -> Self
Create a new potential from a callback, user data, and optional destructor.
Sourcepub unsafe fn calculate(
&self,
input: *const rgpot_force_input_t,
output: *mut rgpot_force_out_t,
) -> rgpot_status_t
pub unsafe fn calculate( &self, input: *const rgpot_force_input_t, output: *mut rgpot_force_out_t, ) -> rgpot_status_t
Invoke the underlying callback.
§Safety
The caller must ensure input and output point to valid, properly
sized structures.
Trait Implementations§
Source§impl Drop for PotentialImpl
impl Drop for PotentialImpl
impl Send for PotentialImpl
Auto Trait Implementations§
impl Freeze for PotentialImpl
impl RefUnwindSafe for PotentialImpl
impl !Sync for PotentialImpl
impl Unpin for PotentialImpl
impl UnsafeUnpin for PotentialImpl
impl UnwindSafe for PotentialImpl
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more