Struct lava_api_mock::State
source · [−]pub struct State { /* private fields */ }Expand description
The data backing a mock Lava instance
This is a persian_rug::Context containing all of the different
data types that make up the database of a Lava instance.
Implementations
sourceimpl State
impl State
sourcepub fn make_device_type_generator(
) -> impl GeneratorWithPersianRug<State, Output = Proxy<DeviceType<State>>>
pub fn make_device_type_generator(
) -> impl GeneratorWithPersianRug<State, Output = Proxy<DeviceType<State>>>
A DeviceType GeneratorWithPersianRug that uses
dependencies already in the State.
This generator is equivalent to the default, except that it
draws Alias, Architecture, BitWidth, Core and
ProcessorFamily instances from those already in the
containing State at the point of generation.
sourcepub fn make_user_generator(
) -> impl GeneratorWithPersianRug<State, Output = Proxy<User<State>>>
pub fn make_user_generator(
) -> impl GeneratorWithPersianRug<State, Output = Proxy<User<State>>>
A User GeneratorWithPersianRug that uses
dependencies already in the State.
This generator is equivalent to the default, except that it
draws Group instances from those already in the containing
State at the point of generation.
sourcepub fn make_device_generator(
) -> impl GeneratorWithPersianRug<State, Output = Proxy<Device<State>>>
pub fn make_device_generator(
) -> impl GeneratorWithPersianRug<State, Output = Proxy<Device<State>>>
A Device GeneratorWithPersianRug that uses
dependencies already in the State.
This generator is equivalent to the default, except that it
draws DeviceType, User, Group,
Tag and Worker instances from those already in
the containing State at the point of generation.
sourcepub fn make_job_generator(
) -> impl GeneratorWithPersianRug<State, Output = Proxy<Job<State>>>
pub fn make_job_generator(
) -> impl GeneratorWithPersianRug<State, Output = Proxy<Job<State>>>
A Job GeneratorWithPersianRug that uses
dependencies already in the State.
This generator is equivalent to the default, except that it
draws User, Group, DeviceType, Tag and
Device instances from those already in the
containing State at the point of generation.
sourcepub fn new_populated(pop: PopulationParams) -> Self
pub fn new_populated(pop: PopulationParams) -> Self
Create a new State with some initial data.
Here, pop is a PopulationParams which gives the initial
number of each type of object. The object generators are
customised to draw their references from the other objects in
the state.
You can obtain new instances of themodified generators from
make_device_generator,
make_device_type_generator,
make_job_generator and
make_user_generator if you
need to create more objects in a similar fashion.
Note that because tests are per-job objects, the counts in
PopulationParams for TestCase, TestSet and
TestSuite are used to make custom objects for each job.
The tests are not provided automatically when jobs are generated
by the underlying GeneratorWithPersianRug provided by
make_job_generator.
Trait Implementations
sourceimpl Context for State
impl Context for State
sourcefn add<T>(&mut self, what: T) -> Proxy<T>where
State: Owner<T>,
T: Contextual<Context = Self>,
fn add<T>(&mut self, what: T) -> Proxy<T>where
State: Owner<T>,
T: Contextual<Context = Self>,
Proxy for it.sourcefn get<T>(&self, what: &Proxy<T>) -> &Twhere
State: Owner<T>,
T: Contextual<Context = Self>,
fn get<T>(&self, what: &Proxy<T>) -> &Twhere
State: Owner<T>,
T: Contextual<Context = Self>,
Proxy.sourcefn get_mut<T>(&mut self, what: &Proxy<T>) -> &mut Twhere
State: Owner<T>,
T: Contextual<Context = Self>,
fn get_mut<T>(&mut self, what: &Proxy<T>) -> &mut Twhere
State: Owner<T>,
T: Contextual<Context = Self>,
Proxy.sourcefn get_iter<T>(&self) -> TableIterator<'_, T>where
State: Owner<T>,
T: Contextual<Context = Self>,
fn get_iter<T>(&self) -> TableIterator<'_, T>where
State: Owner<T>,
T: Contextual<Context = Self>,
sourcefn get_iter_mut<T>(&mut self) -> TableMutIterator<'_, T>where
State: Owner<T>,
T: Contextual<Context = Self>,
fn get_iter_mut<T>(&mut self) -> TableMutIterator<'_, T>where
State: Owner<T>,
T: Contextual<Context = Self>,
sourcefn get_proxy_iter<T>(&self) -> TableProxyIterator<'_, T>where
State: Owner<T>,
T: Contextual<Context = Self>,
fn get_proxy_iter<T>(&self) -> TableProxyIterator<'_, T>where
State: Owner<T>,
T: Contextual<Context = Self>,
sourceimpl Owner<Alias<State>> for State
impl Owner<Alias<State>> for State
sourcefn add(&mut self, what: Alias<State>) -> Proxy<Alias<State>>
fn add(&mut self, what: Alias<State>) -> Proxy<Alias<State>>
Proxy for it.sourcefn get(&self, what: &Proxy<Alias<State>>) -> &Alias<State>
fn get(&self, what: &Proxy<Alias<State>>) -> &Alias<State>
Proxy for it.sourcefn get_mut(&mut self, what: &Proxy<Alias<State>>) -> &mut Alias<State>
fn get_mut(&mut self, what: &Proxy<Alias<State>>) -> &mut Alias<State>
Proxy for it. sourcefn get_iter(&self) -> TableIterator<'_, Alias<State>>
fn get_iter(&self) -> TableIterator<'_, Alias<State>>
sourcefn get_iter_mut(&mut self) -> TableMutIterator<'_, Alias<State>>
fn get_iter_mut(&mut self) -> TableMutIterator<'_, Alias<State>>
sourcefn get_proxy_iter(&self) -> TableProxyIterator<'_, Alias<State>>
fn get_proxy_iter(&self) -> TableProxyIterator<'_, Alias<State>>
sourceimpl Owner<Architecture<State>> for State
impl Owner<Architecture<State>> for State
sourcefn add(&mut self, what: Architecture<State>) -> Proxy<Architecture<State>>
fn add(&mut self, what: Architecture<State>) -> Proxy<Architecture<State>>
Proxy for it.sourcefn get(&self, what: &Proxy<Architecture<State>>) -> &Architecture<State>
fn get(&self, what: &Proxy<Architecture<State>>) -> &Architecture<State>
Proxy for it.sourcefn get_mut(
&mut self,
what: &Proxy<Architecture<State>>
) -> &mut Architecture<State>
fn get_mut(
&mut self,
what: &Proxy<Architecture<State>>
) -> &mut Architecture<State>
Proxy for it. sourcefn get_iter(&self) -> TableIterator<'_, Architecture<State>>
fn get_iter(&self) -> TableIterator<'_, Architecture<State>>
sourcefn get_iter_mut(&mut self) -> TableMutIterator<'_, Architecture<State>>
fn get_iter_mut(&mut self) -> TableMutIterator<'_, Architecture<State>>
sourcefn get_proxy_iter(&self) -> TableProxyIterator<'_, Architecture<State>>
fn get_proxy_iter(&self) -> TableProxyIterator<'_, Architecture<State>>
sourceimpl Owner<BitWidth<State>> for State
impl Owner<BitWidth<State>> for State
sourcefn add(&mut self, what: BitWidth<State>) -> Proxy<BitWidth<State>>
fn add(&mut self, what: BitWidth<State>) -> Proxy<BitWidth<State>>
Proxy for it.sourcefn get(&self, what: &Proxy<BitWidth<State>>) -> &BitWidth<State>
fn get(&self, what: &Proxy<BitWidth<State>>) -> &BitWidth<State>
Proxy for it.sourcefn get_mut(&mut self, what: &Proxy<BitWidth<State>>) -> &mut BitWidth<State>
fn get_mut(&mut self, what: &Proxy<BitWidth<State>>) -> &mut BitWidth<State>
Proxy for it. sourcefn get_iter(&self) -> TableIterator<'_, BitWidth<State>>
fn get_iter(&self) -> TableIterator<'_, BitWidth<State>>
sourcefn get_iter_mut(&mut self) -> TableMutIterator<'_, BitWidth<State>>
fn get_iter_mut(&mut self) -> TableMutIterator<'_, BitWidth<State>>
sourcefn get_proxy_iter(&self) -> TableProxyIterator<'_, BitWidth<State>>
fn get_proxy_iter(&self) -> TableProxyIterator<'_, BitWidth<State>>
sourceimpl Owner<Core<State>> for State
impl Owner<Core<State>> for State
sourcefn add(&mut self, what: Core<State>) -> Proxy<Core<State>>
fn add(&mut self, what: Core<State>) -> Proxy<Core<State>>
Proxy for it.sourcefn get(&self, what: &Proxy<Core<State>>) -> &Core<State>
fn get(&self, what: &Proxy<Core<State>>) -> &Core<State>
Proxy for it.sourcefn get_mut(&mut self, what: &Proxy<Core<State>>) -> &mut Core<State>
fn get_mut(&mut self, what: &Proxy<Core<State>>) -> &mut Core<State>
Proxy for it. sourcefn get_iter(&self) -> TableIterator<'_, Core<State>>
fn get_iter(&self) -> TableIterator<'_, Core<State>>
sourcefn get_iter_mut(&mut self) -> TableMutIterator<'_, Core<State>>
fn get_iter_mut(&mut self) -> TableMutIterator<'_, Core<State>>
sourcefn get_proxy_iter(&self) -> TableProxyIterator<'_, Core<State>>
fn get_proxy_iter(&self) -> TableProxyIterator<'_, Core<State>>
sourceimpl Owner<Device<State>> for State
impl Owner<Device<State>> for State
sourcefn add(&mut self, what: Device<State>) -> Proxy<Device<State>>
fn add(&mut self, what: Device<State>) -> Proxy<Device<State>>
Proxy for it.sourcefn get(&self, what: &Proxy<Device<State>>) -> &Device<State>
fn get(&self, what: &Proxy<Device<State>>) -> &Device<State>
Proxy for it.sourcefn get_mut(&mut self, what: &Proxy<Device<State>>) -> &mut Device<State>
fn get_mut(&mut self, what: &Proxy<Device<State>>) -> &mut Device<State>
Proxy for it. sourcefn get_iter(&self) -> TableIterator<'_, Device<State>>
fn get_iter(&self) -> TableIterator<'_, Device<State>>
sourcefn get_iter_mut(&mut self) -> TableMutIterator<'_, Device<State>>
fn get_iter_mut(&mut self) -> TableMutIterator<'_, Device<State>>
sourcefn get_proxy_iter(&self) -> TableProxyIterator<'_, Device<State>>
fn get_proxy_iter(&self) -> TableProxyIterator<'_, Device<State>>
sourceimpl Owner<DeviceType<State>> for State
impl Owner<DeviceType<State>> for State
sourcefn add(&mut self, what: DeviceType<State>) -> Proxy<DeviceType<State>>
fn add(&mut self, what: DeviceType<State>) -> Proxy<DeviceType<State>>
Proxy for it.sourcefn get(&self, what: &Proxy<DeviceType<State>>) -> &DeviceType<State>
fn get(&self, what: &Proxy<DeviceType<State>>) -> &DeviceType<State>
Proxy for it.sourcefn get_mut(&mut self, what: &Proxy<DeviceType<State>>) -> &mut DeviceType<State>
fn get_mut(&mut self, what: &Proxy<DeviceType<State>>) -> &mut DeviceType<State>
Proxy for it. sourcefn get_iter(&self) -> TableIterator<'_, DeviceType<State>>
fn get_iter(&self) -> TableIterator<'_, DeviceType<State>>
sourcefn get_iter_mut(&mut self) -> TableMutIterator<'_, DeviceType<State>>
fn get_iter_mut(&mut self) -> TableMutIterator<'_, DeviceType<State>>
sourcefn get_proxy_iter(&self) -> TableProxyIterator<'_, DeviceType<State>>
fn get_proxy_iter(&self) -> TableProxyIterator<'_, DeviceType<State>>
sourceimpl Owner<Group<State>> for State
impl Owner<Group<State>> for State
sourcefn add(&mut self, what: Group<State>) -> Proxy<Group<State>>
fn add(&mut self, what: Group<State>) -> Proxy<Group<State>>
Proxy for it.sourcefn get(&self, what: &Proxy<Group<State>>) -> &Group<State>
fn get(&self, what: &Proxy<Group<State>>) -> &Group<State>
Proxy for it.sourcefn get_mut(&mut self, what: &Proxy<Group<State>>) -> &mut Group<State>
fn get_mut(&mut self, what: &Proxy<Group<State>>) -> &mut Group<State>
Proxy for it. sourcefn get_iter(&self) -> TableIterator<'_, Group<State>>
fn get_iter(&self) -> TableIterator<'_, Group<State>>
sourcefn get_iter_mut(&mut self) -> TableMutIterator<'_, Group<State>>
fn get_iter_mut(&mut self) -> TableMutIterator<'_, Group<State>>
sourcefn get_proxy_iter(&self) -> TableProxyIterator<'_, Group<State>>
fn get_proxy_iter(&self) -> TableProxyIterator<'_, Group<State>>
sourceimpl Owner<Job<State>> for State
impl Owner<Job<State>> for State
sourcefn add(&mut self, what: Job<State>) -> Proxy<Job<State>>
fn add(&mut self, what: Job<State>) -> Proxy<Job<State>>
Proxy for it.sourcefn get(&self, what: &Proxy<Job<State>>) -> &Job<State>
fn get(&self, what: &Proxy<Job<State>>) -> &Job<State>
Proxy for it.sourcefn get_mut(&mut self, what: &Proxy<Job<State>>) -> &mut Job<State>
fn get_mut(&mut self, what: &Proxy<Job<State>>) -> &mut Job<State>
Proxy for it. sourcefn get_iter(&self) -> TableIterator<'_, Job<State>>
fn get_iter(&self) -> TableIterator<'_, Job<State>>
sourcefn get_iter_mut(&mut self) -> TableMutIterator<'_, Job<State>>
fn get_iter_mut(&mut self) -> TableMutIterator<'_, Job<State>>
sourcefn get_proxy_iter(&self) -> TableProxyIterator<'_, Job<State>>
fn get_proxy_iter(&self) -> TableProxyIterator<'_, Job<State>>
sourceimpl Owner<ProcessorFamily<State>> for State
impl Owner<ProcessorFamily<State>> for State
sourcefn add(&mut self, what: ProcessorFamily<State>) -> Proxy<ProcessorFamily<State>>
fn add(&mut self, what: ProcessorFamily<State>) -> Proxy<ProcessorFamily<State>>
Proxy for it.sourcefn get(&self, what: &Proxy<ProcessorFamily<State>>) -> &ProcessorFamily<State>
fn get(&self, what: &Proxy<ProcessorFamily<State>>) -> &ProcessorFamily<State>
Proxy for it.sourcefn get_mut(
&mut self,
what: &Proxy<ProcessorFamily<State>>
) -> &mut ProcessorFamily<State>
fn get_mut(
&mut self,
what: &Proxy<ProcessorFamily<State>>
) -> &mut ProcessorFamily<State>
Proxy for it. sourcefn get_iter(&self) -> TableIterator<'_, ProcessorFamily<State>>
fn get_iter(&self) -> TableIterator<'_, ProcessorFamily<State>>
sourcefn get_iter_mut(&mut self) -> TableMutIterator<'_, ProcessorFamily<State>>
fn get_iter_mut(&mut self) -> TableMutIterator<'_, ProcessorFamily<State>>
sourcefn get_proxy_iter(&self) -> TableProxyIterator<'_, ProcessorFamily<State>>
fn get_proxy_iter(&self) -> TableProxyIterator<'_, ProcessorFamily<State>>
sourceimpl Owner<Tag<State>> for State
impl Owner<Tag<State>> for State
sourcefn add(&mut self, what: Tag<State>) -> Proxy<Tag<State>>
fn add(&mut self, what: Tag<State>) -> Proxy<Tag<State>>
Proxy for it.sourcefn get(&self, what: &Proxy<Tag<State>>) -> &Tag<State>
fn get(&self, what: &Proxy<Tag<State>>) -> &Tag<State>
Proxy for it.sourcefn get_mut(&mut self, what: &Proxy<Tag<State>>) -> &mut Tag<State>
fn get_mut(&mut self, what: &Proxy<Tag<State>>) -> &mut Tag<State>
Proxy for it. sourcefn get_iter(&self) -> TableIterator<'_, Tag<State>>
fn get_iter(&self) -> TableIterator<'_, Tag<State>>
sourcefn get_iter_mut(&mut self) -> TableMutIterator<'_, Tag<State>>
fn get_iter_mut(&mut self) -> TableMutIterator<'_, Tag<State>>
sourcefn get_proxy_iter(&self) -> TableProxyIterator<'_, Tag<State>>
fn get_proxy_iter(&self) -> TableProxyIterator<'_, Tag<State>>
sourceimpl Owner<TestCase<State>> for State
impl Owner<TestCase<State>> for State
sourcefn add(&mut self, what: TestCase<State>) -> Proxy<TestCase<State>>
fn add(&mut self, what: TestCase<State>) -> Proxy<TestCase<State>>
Proxy for it.sourcefn get(&self, what: &Proxy<TestCase<State>>) -> &TestCase<State>
fn get(&self, what: &Proxy<TestCase<State>>) -> &TestCase<State>
Proxy for it.sourcefn get_mut(&mut self, what: &Proxy<TestCase<State>>) -> &mut TestCase<State>
fn get_mut(&mut self, what: &Proxy<TestCase<State>>) -> &mut TestCase<State>
Proxy for it. sourcefn get_iter(&self) -> TableIterator<'_, TestCase<State>>
fn get_iter(&self) -> TableIterator<'_, TestCase<State>>
sourcefn get_iter_mut(&mut self) -> TableMutIterator<'_, TestCase<State>>
fn get_iter_mut(&mut self) -> TableMutIterator<'_, TestCase<State>>
sourcefn get_proxy_iter(&self) -> TableProxyIterator<'_, TestCase<State>>
fn get_proxy_iter(&self) -> TableProxyIterator<'_, TestCase<State>>
sourceimpl Owner<TestSet<State>> for State
impl Owner<TestSet<State>> for State
sourcefn add(&mut self, what: TestSet<State>) -> Proxy<TestSet<State>>
fn add(&mut self, what: TestSet<State>) -> Proxy<TestSet<State>>
Proxy for it.sourcefn get(&self, what: &Proxy<TestSet<State>>) -> &TestSet<State>
fn get(&self, what: &Proxy<TestSet<State>>) -> &TestSet<State>
Proxy for it.sourcefn get_mut(&mut self, what: &Proxy<TestSet<State>>) -> &mut TestSet<State>
fn get_mut(&mut self, what: &Proxy<TestSet<State>>) -> &mut TestSet<State>
Proxy for it. sourcefn get_iter(&self) -> TableIterator<'_, TestSet<State>>
fn get_iter(&self) -> TableIterator<'_, TestSet<State>>
sourcefn get_iter_mut(&mut self) -> TableMutIterator<'_, TestSet<State>>
fn get_iter_mut(&mut self) -> TableMutIterator<'_, TestSet<State>>
sourcefn get_proxy_iter(&self) -> TableProxyIterator<'_, TestSet<State>>
fn get_proxy_iter(&self) -> TableProxyIterator<'_, TestSet<State>>
sourceimpl Owner<TestSuite<State>> for State
impl Owner<TestSuite<State>> for State
sourcefn add(&mut self, what: TestSuite<State>) -> Proxy<TestSuite<State>>
fn add(&mut self, what: TestSuite<State>) -> Proxy<TestSuite<State>>
Proxy for it.sourcefn get(&self, what: &Proxy<TestSuite<State>>) -> &TestSuite<State>
fn get(&self, what: &Proxy<TestSuite<State>>) -> &TestSuite<State>
Proxy for it.sourcefn get_mut(&mut self, what: &Proxy<TestSuite<State>>) -> &mut TestSuite<State>
fn get_mut(&mut self, what: &Proxy<TestSuite<State>>) -> &mut TestSuite<State>
Proxy for it. sourcefn get_iter(&self) -> TableIterator<'_, TestSuite<State>>
fn get_iter(&self) -> TableIterator<'_, TestSuite<State>>
sourcefn get_iter_mut(&mut self) -> TableMutIterator<'_, TestSuite<State>>
fn get_iter_mut(&mut self) -> TableMutIterator<'_, TestSuite<State>>
sourcefn get_proxy_iter(&self) -> TableProxyIterator<'_, TestSuite<State>>
fn get_proxy_iter(&self) -> TableProxyIterator<'_, TestSuite<State>>
sourceimpl Owner<User<State>> for State
impl Owner<User<State>> for State
sourcefn add(&mut self, what: User<State>) -> Proxy<User<State>>
fn add(&mut self, what: User<State>) -> Proxy<User<State>>
Proxy for it.sourcefn get(&self, what: &Proxy<User<State>>) -> &User<State>
fn get(&self, what: &Proxy<User<State>>) -> &User<State>
Proxy for it.sourcefn get_mut(&mut self, what: &Proxy<User<State>>) -> &mut User<State>
fn get_mut(&mut self, what: &Proxy<User<State>>) -> &mut User<State>
Proxy for it. sourcefn get_iter(&self) -> TableIterator<'_, User<State>>
fn get_iter(&self) -> TableIterator<'_, User<State>>
sourcefn get_iter_mut(&mut self) -> TableMutIterator<'_, User<State>>
fn get_iter_mut(&mut self) -> TableMutIterator<'_, User<State>>
sourcefn get_proxy_iter(&self) -> TableProxyIterator<'_, User<State>>
fn get_proxy_iter(&self) -> TableProxyIterator<'_, User<State>>
sourceimpl Owner<Worker<State>> for State
impl Owner<Worker<State>> for State
sourcefn add(&mut self, what: Worker<State>) -> Proxy<Worker<State>>
fn add(&mut self, what: Worker<State>) -> Proxy<Worker<State>>
Proxy for it.sourcefn get(&self, what: &Proxy<Worker<State>>) -> &Worker<State>
fn get(&self, what: &Proxy<Worker<State>>) -> &Worker<State>
Proxy for it.sourcefn get_mut(&mut self, what: &Proxy<Worker<State>>) -> &mut Worker<State>
fn get_mut(&mut self, what: &Proxy<Worker<State>>) -> &mut Worker<State>
Proxy for it.