Struct eiffelvis_gen::generator::EventGenerator
source · [−]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
sourceimpl EventGenerator
impl EventGenerator
sourcepub fn new(
seed: impl Hash,
max_links: usize,
history_max: usize,
event_set: EventSet
) -> Self
pub fn new(
seed: impl Hash,
max_links: usize,
history_max: usize,
event_set: EventSet
) -> Self
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
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for EventGenerator
impl Send for EventGenerator
impl Sync for EventGenerator
impl Unpin for EventGenerator
impl UnwindSafe for EventGenerator
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more