pub struct NothingSpace;Expand description
A no-op space for non-spatial models.
Agents using NothingSpace must have Position = (). All spatial methods
(add, remove, nearby) are trivial no-ops that return empty results.
Trait Implementations§
Source§impl Clone for NothingSpace
impl Clone for NothingSpace
Source§fn clone(&self) -> NothingSpace
fn clone(&self) -> NothingSpace
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for NothingSpace
impl Debug for NothingSpace
Source§impl Default for NothingSpace
impl Default for NothingSpace
Source§fn default() -> NothingSpace
fn default() -> NothingSpace
Returns the “default value” for a type. Read more
Source§impl<A> SpaceInteraction<A> for NothingSpacewhere
A: PositionedAgent<Position = ()>,
impl<A> SpaceInteraction<A> for NothingSpacewhere
A: PositionedAgent<Position = ()>,
Source§type Error = Infallible
type Error = Infallible
Error type for space operations.
Source§fn random_position<R: RngCore>(&self, _rng: &mut R) -> A::Position
fn random_position<R: RngCore>(&self, _rng: &mut R) -> A::Position
Generate a random valid position within this space.
Source§fn add_agent(&mut self, _agent: &A) -> Result<(), Self::Error>
fn add_agent(&mut self, _agent: &A) -> Result<(), Self::Error>
Register an agent with the space at its current position.
impl Copy for NothingSpace
impl Space for NothingSpace
Auto Trait Implementations§
impl Freeze for NothingSpace
impl RefUnwindSafe for NothingSpace
impl Send for NothingSpace
impl Sync for NothingSpace
impl Unpin for NothingSpace
impl UnsafeUnpin for NothingSpace
impl UnwindSafe for NothingSpace
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