pub struct EventGenerator { /* private fields */ }
Expand description

Holds on to all the data needed to generate a infinite series of events and should not need be modified after creation.
Actual generated events come from the iterator Iter obtained through EventGenerator::iter().

Generated events come in the form of JSON, you will need to deserialize them on your own.
The produced JSON will at least include the “meta”, “data” and “links” fields each with their non optional fields :

{
   "meta":{
      "id":"206f25df-f6a8-545b-7492-996f84e897ee",
      "type":"Event",
      "version":"1.0.0",
      "time":1632257822
   },
   "data":{
   
   },
   "links":[
      {
         "type":"Link0",
         "target":"13588b40-3c04-30f0-6437-f9712c17bc09"
      }
   ]
}

(“data” is always empty for now)

Implementations

Constructs a new EventGenerator,

  • seed : seeds the random generator used to generate random events.
  • max_links : the upper limit on how many links a generated event can have, however links marked required ignore this limit.
  • history_max : the upper limit on how many events will be kept to act as an event history from which new links are created.
  • event_set : the events and links that should be generated

Creates a new infinite event iterator. Every Iter made from the same EventGenerator generate the same sequence of events.

Trait Implementations

Returns the “default value” for a type. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.