pub struct Runtime { /* private fields */ }Implementations§
Source§impl Runtime
impl Runtime
pub fn new( unit: Unit, domain: Domain, current_time: f64, time_step: f64, ) -> Result<Self>
pub fn create_particles<'a>( &'a mut self, particle_name: &str, count: usize, uniform_members: &UniformMembers, num_threads: usize, ) -> Result<ParticleBorrowMut<'a>>
Sourcepub fn define_constant_i64<S: Into<String>>(
&mut self,
name: S,
value: i64,
) -> Result<()>
pub fn define_constant_i64<S: Into<String>>( &mut self, name: S, value: i64, ) -> Result<()>
Define a named constant of type i64
Sourcepub fn define_constant_f64<S: Into<String>>(
&mut self,
name: S,
value: f64,
) -> Result<()>
pub fn define_constant_f64<S: Into<String>>( &mut self, name: S, value: f64, ) -> Result<()>
Define a named constant of type f64
Sourcepub fn define_constant_usize<S: Into<String>>(
&mut self,
name: S,
value: usize,
) -> Result<()>
pub fn define_constant_usize<S: Into<String>>( &mut self, name: S, value: usize, ) -> Result<()>
Define a named constant of type usize
pub fn enable_interaction( &mut self, name: &str, details: InteractionDetails, ) -> Result<()>
Sourcepub fn get_time_step(&self) -> f64
pub fn get_time_step(&self) -> f64
Get the current time step
Sourcepub fn set_time_step(&mut self, time_step: f64)
pub fn set_time_step(&mut self, time_step: f64)
Set the current time step
Sourcepub fn get_memory_usage(&self) -> usize
pub fn get_memory_usage(&self) -> usize
Get an (estimate) of the memory currently allocated This includes:
- Memory allocated for particle data
Sourcepub fn compile(self, simulation_name: &str) -> Result<CompiledRuntime>
pub fn compile(self, simulation_name: &str) -> Result<CompiledRuntime>
Verify and compile runtime for a given simulation
Sourcepub fn borrow_particle_mut(
&self,
particle_name: &str,
) -> Result<ParticleBorrowMut<'_>>
pub fn borrow_particle_mut( &self, particle_name: &str, ) -> Result<ParticleBorrowMut<'_>>
Borrow a particles data
Auto Trait Implementations§
impl Freeze for Runtime
impl RefUnwindSafe for Runtime
impl Send for Runtime
impl Sync for Runtime
impl Unpin for Runtime
impl UnwindSafe for Runtime
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
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more