Trait InteractionExtracellularGradient
pub trait InteractionExtracellularGradient<Cell, ConcGradientExtracellular> {
// Required method
fn sense_gradient(
cell: &mut Cell,
gradient: &ConcGradientExtracellular,
) -> Result<(), CalcError>;
}
Expand description
Defines how the cell uses the extracellular gradient.
This trait can also be derived with the CellAgent derive macro.
use cellular_raza_concepts::{reactions_old::InteractionExtracellularGradient,
CalcError, CellAgent
};
struct DoNothingGradient;
impl<C, G> InteractionExtracellularGradient<C, G> for DoNothingGradient {
fn sense_gradient(
cell: &mut C,
gradient: &G,
) -> Result<(), CalcError> {
Ok(())
}
}
#[derive(CellAgent)]
struct MyAgent {
#[ExtracellularGradient]
gradient: DoNothingGradient,
}
Required Methods§
fn sense_gradient(
cell: &mut Cell,
gradient: &ConcGradientExtracellular,
) -> Result<(), CalcError>
fn sense_gradient( cell: &mut Cell, gradient: &ConcGradientExtracellular, ) -> Result<(), CalcError>
The cell-agent senses the gradient and changes the behaviour of the cell.
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.