pub struct Environment<T> { /* private fields */ }Expand description
The simulation environment
Implementations§
Source§impl<T: Clone> Environment<T>
impl<T: Clone> Environment<T>
pub fn new(delay: u64) -> Self
pub fn with_start_time(delay: u64, start_time: u64) -> Self
pub fn now(&self) -> u64
pub fn send(&mut self, delay: u64, dest: u64, msg: T)
pub fn timeout(&mut self, timeout: u64, dest: u64)
pub fn broadcast(&mut self, _sender: u64, msg: T)
Trait Implementations§
Source§impl<T: Default> Default for Environment<T>
impl<T: Default> Default for Environment<T>
Source§fn default() -> Environment<T>
fn default() -> Environment<T>
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl<T> Freeze for Environment<T>
impl<T> RefUnwindSafe for Environment<T>where
T: RefUnwindSafe,
impl<T> Send for Environment<T>where
T: Send,
impl<T> Sync for Environment<T>where
T: Sync,
impl<T> Unpin for Environment<T>where
T: Unpin,
impl<T> UnwindSafe for Environment<T>where
T: UnwindSafe,
Blanket Implementations§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§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