Module simulon::api

source ·
Expand description

The api to use inside the simulation executor.

Structs

  • A connection to a remote peer. You can establish a connection by either connecting to a peer via the [crate::api::connect] method or by accepting connections from a listener.
  • A connection listener that allows the node to accept connections on a certain port.
  • List of all of the nodes in the simulation. The default instance of this type includes all of the nodes in the current simulation.
  • An iterator over a NodeArray.
  • An address for a node in the simulation. This can be dereferenced to the global index of the node. Global index starts from 0.

Enums

Functions

  • Create a connection to the given remote peer on the provided port.
  • Emit an event from the node. This is part of the metric API and allows you to collect information about when the nodes reach a certain point in the simulation, hence using the same key is not supported.
  • Start a listener on the given port.
  • Returns the current time.
  • Returns a future that will be resolved after the provided duration is passed.
  • Spawns the given future in its own task to be continued.
  • Pass a reference to the registered global state value of type T to the closure.