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§
Source§impl 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§
Source§impl Context for State
impl Context for State
Source§fn get_mut<T>(&mut self, what: &Proxy<T>) -> &mut T
fn get_mut<T>(&mut self, what: &Proxy<T>) -> &mut T
Proxy
.Source§fn get_iter<T>(&self) -> TableIterator<'_, T>
fn get_iter<T>(&self) -> TableIterator<'_, T>
Source§fn get_iter_mut<T>(&mut self) -> TableMutIterator<'_, T>
fn get_iter_mut<T>(&mut self) -> TableMutIterator<'_, T>
Source§fn get_proxy_iter<T>(&self) -> TableProxyIterator<'_, T>
fn get_proxy_iter<T>(&self) -> TableProxyIterator<'_, T>
Source§impl Owner<Alias<State>> for State
impl Owner<Alias<State>> for State
Source§fn add(&mut self, what: Alias<State>) -> Proxy<Alias<State>>
fn add(&mut self, what: Alias<State>) -> Proxy<Alias<State>>
Proxy
for it.Source§fn get(&self, what: &Proxy<Alias<State>>) -> &Alias<State>
fn get(&self, what: &Proxy<Alias<State>>) -> &Alias<State>
Proxy
for it.Source§fn 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.Source§fn get_iter(&self) -> TableIterator<'_, Alias<State>>
fn get_iter(&self) -> TableIterator<'_, Alias<State>>
Source§fn get_iter_mut(&mut self) -> TableMutIterator<'_, Alias<State>>
fn get_iter_mut(&mut self) -> TableMutIterator<'_, Alias<State>>
Source§fn get_proxy_iter(&self) -> TableProxyIterator<'_, Alias<State>>
fn get_proxy_iter(&self) -> TableProxyIterator<'_, Alias<State>>
Proxy
objects for the
stored values.Source§impl Owner<Architecture<State>> for State
impl Owner<Architecture<State>> for State
Source§fn add(&mut self, what: Architecture<State>) -> Proxy<Architecture<State>>
fn add(&mut self, what: Architecture<State>) -> Proxy<Architecture<State>>
Proxy
for it.Source§fn get(&self, what: &Proxy<Architecture<State>>) -> &Architecture<State>
fn get(&self, what: &Proxy<Architecture<State>>) -> &Architecture<State>
Proxy
for it.Source§fn 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.Source§fn get_iter(&self) -> TableIterator<'_, Architecture<State>>
fn get_iter(&self) -> TableIterator<'_, Architecture<State>>
Source§fn get_iter_mut(&mut self) -> TableMutIterator<'_, Architecture<State>>
fn get_iter_mut(&mut self) -> TableMutIterator<'_, Architecture<State>>
Source§fn get_proxy_iter(&self) -> TableProxyIterator<'_, Architecture<State>>
fn get_proxy_iter(&self) -> TableProxyIterator<'_, Architecture<State>>
Proxy
objects for the
stored values.Source§impl Owner<BitWidth<State>> for State
impl Owner<BitWidth<State>> for State
Source§fn add(&mut self, what: BitWidth<State>) -> Proxy<BitWidth<State>>
fn add(&mut self, what: BitWidth<State>) -> Proxy<BitWidth<State>>
Proxy
for it.Source§fn get(&self, what: &Proxy<BitWidth<State>>) -> &BitWidth<State>
fn get(&self, what: &Proxy<BitWidth<State>>) -> &BitWidth<State>
Proxy
for it.Source§fn 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.Source§fn get_iter(&self) -> TableIterator<'_, BitWidth<State>>
fn get_iter(&self) -> TableIterator<'_, BitWidth<State>>
Source§fn get_iter_mut(&mut self) -> TableMutIterator<'_, BitWidth<State>>
fn get_iter_mut(&mut self) -> TableMutIterator<'_, BitWidth<State>>
Source§fn get_proxy_iter(&self) -> TableProxyIterator<'_, BitWidth<State>>
fn get_proxy_iter(&self) -> TableProxyIterator<'_, BitWidth<State>>
Proxy
objects for the
stored values.Source§impl Owner<Core<State>> for State
impl Owner<Core<State>> for State
Source§fn add(&mut self, what: Core<State>) -> Proxy<Core<State>>
fn add(&mut self, what: Core<State>) -> Proxy<Core<State>>
Proxy
for it.Source§fn get(&self, what: &Proxy<Core<State>>) -> &Core<State>
fn get(&self, what: &Proxy<Core<State>>) -> &Core<State>
Proxy
for it.Source§fn 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.Source§fn get_iter(&self) -> TableIterator<'_, Core<State>>
fn get_iter(&self) -> TableIterator<'_, Core<State>>
Source§fn get_iter_mut(&mut self) -> TableMutIterator<'_, Core<State>>
fn get_iter_mut(&mut self) -> TableMutIterator<'_, Core<State>>
Source§fn get_proxy_iter(&self) -> TableProxyIterator<'_, Core<State>>
fn get_proxy_iter(&self) -> TableProxyIterator<'_, Core<State>>
Proxy
objects for the
stored values.Source§impl Owner<Device<State>> for State
impl Owner<Device<State>> for State
Source§fn add(&mut self, what: Device<State>) -> Proxy<Device<State>>
fn add(&mut self, what: Device<State>) -> Proxy<Device<State>>
Proxy
for it.Source§fn get(&self, what: &Proxy<Device<State>>) -> &Device<State>
fn get(&self, what: &Proxy<Device<State>>) -> &Device<State>
Proxy
for it.Source§fn 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.Source§fn get_iter(&self) -> TableIterator<'_, Device<State>>
fn get_iter(&self) -> TableIterator<'_, Device<State>>
Source§fn get_iter_mut(&mut self) -> TableMutIterator<'_, Device<State>>
fn get_iter_mut(&mut self) -> TableMutIterator<'_, Device<State>>
Source§fn get_proxy_iter(&self) -> TableProxyIterator<'_, Device<State>>
fn get_proxy_iter(&self) -> TableProxyIterator<'_, Device<State>>
Proxy
objects for the
stored values.Source§impl Owner<DeviceType<State>> for State
impl Owner<DeviceType<State>> for State
Source§fn add(&mut self, what: DeviceType<State>) -> Proxy<DeviceType<State>>
fn add(&mut self, what: DeviceType<State>) -> Proxy<DeviceType<State>>
Proxy
for it.Source§fn get(&self, what: &Proxy<DeviceType<State>>) -> &DeviceType<State>
fn get(&self, what: &Proxy<DeviceType<State>>) -> &DeviceType<State>
Proxy
for it.Source§fn 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.Source§fn get_iter(&self) -> TableIterator<'_, DeviceType<State>>
fn get_iter(&self) -> TableIterator<'_, DeviceType<State>>
Source§fn get_iter_mut(&mut self) -> TableMutIterator<'_, DeviceType<State>>
fn get_iter_mut(&mut self) -> TableMutIterator<'_, DeviceType<State>>
Source§fn get_proxy_iter(&self) -> TableProxyIterator<'_, DeviceType<State>>
fn get_proxy_iter(&self) -> TableProxyIterator<'_, DeviceType<State>>
Proxy
objects for the
stored values.Source§impl Owner<Group<State>> for State
impl Owner<Group<State>> for State
Source§fn add(&mut self, what: Group<State>) -> Proxy<Group<State>>
fn add(&mut self, what: Group<State>) -> Proxy<Group<State>>
Proxy
for it.Source§fn get(&self, what: &Proxy<Group<State>>) -> &Group<State>
fn get(&self, what: &Proxy<Group<State>>) -> &Group<State>
Proxy
for it.Source§fn 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.Source§fn get_iter(&self) -> TableIterator<'_, Group<State>>
fn get_iter(&self) -> TableIterator<'_, Group<State>>
Source§fn get_iter_mut(&mut self) -> TableMutIterator<'_, Group<State>>
fn get_iter_mut(&mut self) -> TableMutIterator<'_, Group<State>>
Source§fn get_proxy_iter(&self) -> TableProxyIterator<'_, Group<State>>
fn get_proxy_iter(&self) -> TableProxyIterator<'_, Group<State>>
Proxy
objects for the
stored values.Source§impl Owner<Job<State>> for State
impl Owner<Job<State>> for State
Source§fn add(&mut self, what: Job<State>) -> Proxy<Job<State>>
fn add(&mut self, what: Job<State>) -> Proxy<Job<State>>
Proxy
for it.Source§fn get(&self, what: &Proxy<Job<State>>) -> &Job<State>
fn get(&self, what: &Proxy<Job<State>>) -> &Job<State>
Proxy
for it.Source§fn 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.Source§fn get_iter(&self) -> TableIterator<'_, Job<State>>
fn get_iter(&self) -> TableIterator<'_, Job<State>>
Source§fn get_iter_mut(&mut self) -> TableMutIterator<'_, Job<State>>
fn get_iter_mut(&mut self) -> TableMutIterator<'_, Job<State>>
Source§fn get_proxy_iter(&self) -> TableProxyIterator<'_, Job<State>>
fn get_proxy_iter(&self) -> TableProxyIterator<'_, Job<State>>
Proxy
objects for the
stored values.Source§impl Owner<ProcessorFamily<State>> for State
impl Owner<ProcessorFamily<State>> for State
Source§fn add(&mut self, what: ProcessorFamily<State>) -> Proxy<ProcessorFamily<State>>
fn add(&mut self, what: ProcessorFamily<State>) -> Proxy<ProcessorFamily<State>>
Proxy
for it.Source§fn get(&self, what: &Proxy<ProcessorFamily<State>>) -> &ProcessorFamily<State>
fn get(&self, what: &Proxy<ProcessorFamily<State>>) -> &ProcessorFamily<State>
Proxy
for it.Source§fn 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.Source§fn get_iter(&self) -> TableIterator<'_, ProcessorFamily<State>>
fn get_iter(&self) -> TableIterator<'_, ProcessorFamily<State>>
Source§fn get_iter_mut(&mut self) -> TableMutIterator<'_, ProcessorFamily<State>>
fn get_iter_mut(&mut self) -> TableMutIterator<'_, ProcessorFamily<State>>
Source§fn get_proxy_iter(&self) -> TableProxyIterator<'_, ProcessorFamily<State>>
fn get_proxy_iter(&self) -> TableProxyIterator<'_, ProcessorFamily<State>>
Proxy
objects for the
stored values.Source§impl Owner<Tag<State>> for State
impl Owner<Tag<State>> for State
Source§fn add(&mut self, what: Tag<State>) -> Proxy<Tag<State>>
fn add(&mut self, what: Tag<State>) -> Proxy<Tag<State>>
Proxy
for it.Source§fn get(&self, what: &Proxy<Tag<State>>) -> &Tag<State>
fn get(&self, what: &Proxy<Tag<State>>) -> &Tag<State>
Proxy
for it.Source§fn 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.Source§fn get_iter(&self) -> TableIterator<'_, Tag<State>>
fn get_iter(&self) -> TableIterator<'_, Tag<State>>
Source§fn get_iter_mut(&mut self) -> TableMutIterator<'_, Tag<State>>
fn get_iter_mut(&mut self) -> TableMutIterator<'_, Tag<State>>
Source§fn get_proxy_iter(&self) -> TableProxyIterator<'_, Tag<State>>
fn get_proxy_iter(&self) -> TableProxyIterator<'_, Tag<State>>
Proxy
objects for the
stored values.Source§impl Owner<TestCase<State>> for State
impl Owner<TestCase<State>> for State
Source§fn add(&mut self, what: TestCase<State>) -> Proxy<TestCase<State>>
fn add(&mut self, what: TestCase<State>) -> Proxy<TestCase<State>>
Proxy
for it.Source§fn get(&self, what: &Proxy<TestCase<State>>) -> &TestCase<State>
fn get(&self, what: &Proxy<TestCase<State>>) -> &TestCase<State>
Proxy
for it.Source§fn 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.Source§fn get_iter(&self) -> TableIterator<'_, TestCase<State>>
fn get_iter(&self) -> TableIterator<'_, TestCase<State>>
Source§fn get_iter_mut(&mut self) -> TableMutIterator<'_, TestCase<State>>
fn get_iter_mut(&mut self) -> TableMutIterator<'_, TestCase<State>>
Source§fn get_proxy_iter(&self) -> TableProxyIterator<'_, TestCase<State>>
fn get_proxy_iter(&self) -> TableProxyIterator<'_, TestCase<State>>
Proxy
objects for the
stored values.Source§impl Owner<TestSet<State>> for State
impl Owner<TestSet<State>> for State
Source§fn add(&mut self, what: TestSet<State>) -> Proxy<TestSet<State>>
fn add(&mut self, what: TestSet<State>) -> Proxy<TestSet<State>>
Proxy
for it.Source§fn get(&self, what: &Proxy<TestSet<State>>) -> &TestSet<State>
fn get(&self, what: &Proxy<TestSet<State>>) -> &TestSet<State>
Proxy
for it.Source§fn 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.Source§fn get_iter(&self) -> TableIterator<'_, TestSet<State>>
fn get_iter(&self) -> TableIterator<'_, TestSet<State>>
Source§fn get_iter_mut(&mut self) -> TableMutIterator<'_, TestSet<State>>
fn get_iter_mut(&mut self) -> TableMutIterator<'_, TestSet<State>>
Source§fn get_proxy_iter(&self) -> TableProxyIterator<'_, TestSet<State>>
fn get_proxy_iter(&self) -> TableProxyIterator<'_, TestSet<State>>
Proxy
objects for the
stored values.Source§impl Owner<TestSuite<State>> for State
impl Owner<TestSuite<State>> for State
Source§fn add(&mut self, what: TestSuite<State>) -> Proxy<TestSuite<State>>
fn add(&mut self, what: TestSuite<State>) -> Proxy<TestSuite<State>>
Proxy
for it.Source§fn get(&self, what: &Proxy<TestSuite<State>>) -> &TestSuite<State>
fn get(&self, what: &Proxy<TestSuite<State>>) -> &TestSuite<State>
Proxy
for it.Source§fn 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.Source§fn get_iter(&self) -> TableIterator<'_, TestSuite<State>>
fn get_iter(&self) -> TableIterator<'_, TestSuite<State>>
Source§fn get_iter_mut(&mut self) -> TableMutIterator<'_, TestSuite<State>>
fn get_iter_mut(&mut self) -> TableMutIterator<'_, TestSuite<State>>
Source§fn get_proxy_iter(&self) -> TableProxyIterator<'_, TestSuite<State>>
fn get_proxy_iter(&self) -> TableProxyIterator<'_, TestSuite<State>>
Proxy
objects for the
stored values.Source§impl Owner<User<State>> for State
impl Owner<User<State>> for State
Source§fn add(&mut self, what: User<State>) -> Proxy<User<State>>
fn add(&mut self, what: User<State>) -> Proxy<User<State>>
Proxy
for it.Source§fn get(&self, what: &Proxy<User<State>>) -> &User<State>
fn get(&self, what: &Proxy<User<State>>) -> &User<State>
Proxy
for it.Source§fn 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.Source§fn get_iter(&self) -> TableIterator<'_, User<State>>
fn get_iter(&self) -> TableIterator<'_, User<State>>
Source§fn get_iter_mut(&mut self) -> TableMutIterator<'_, User<State>>
fn get_iter_mut(&mut self) -> TableMutIterator<'_, User<State>>
Source§fn get_proxy_iter(&self) -> TableProxyIterator<'_, User<State>>
fn get_proxy_iter(&self) -> TableProxyIterator<'_, User<State>>
Proxy
objects for the
stored values.Source§impl Owner<Worker<State>> for State
impl Owner<Worker<State>> for State
Source§fn add(&mut self, what: Worker<State>) -> Proxy<Worker<State>>
fn add(&mut self, what: Worker<State>) -> Proxy<Worker<State>>
Proxy
for it.Source§fn get(&self, what: &Proxy<Worker<State>>) -> &Worker<State>
fn get(&self, what: &Proxy<Worker<State>>) -> &Worker<State>
Proxy
for it.Source§fn 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.Source§fn get_iter(&self) -> TableIterator<'_, Worker<State>>
fn get_iter(&self) -> TableIterator<'_, Worker<State>>
Source§fn get_iter_mut(&mut self) -> TableMutIterator<'_, Worker<State>>
fn get_iter_mut(&mut self) -> TableMutIterator<'_, Worker<State>>
Source§fn get_proxy_iter(&self) -> TableProxyIterator<'_, Worker<State>>
fn get_proxy_iter(&self) -> TableProxyIterator<'_, Worker<State>>
Proxy
objects for the
stored values.