pub struct ControlPlane { /* private fields */ }Expand description
The control plane of chaos mode. Please see the crate-level documentation.
Implementations§
Source§impl ControlPlane
impl ControlPlane
Sourcepub fn set_fuel(&mut self, fuel: u8)
pub fn set_fuel(&mut self, fuel: u8)
Set the fuel limit. Zero is interpreted as the
fuel limit being deactivated, consistent with the cranelift setting
control_plane_fuel.
Sourcepub fn get_decision(&mut self) -> bool
pub fn get_decision(&mut self) -> bool
Returns a pseudo-random boolean if the control plane was constructed
with arbitrary.
The default value false will always be returned if the
pseudo-random data is exhausted or the control plane was constructed
with default.
Sourcepub fn get_arbitrary<T: for<'a> Arbitrary<'a> + Default>(&mut self) -> T
pub fn get_arbitrary<T: for<'a> Arbitrary<'a> + Default>(&mut self) -> T
Returns an arbitrary value if the control plane was constructed with
arbitrary.
The default value will always be returned if the pseudo-random data is
exhausted or the control plane was constructed with default.
Sourcepub fn shuffle<T>(&mut self, slice: &mut [T])
pub fn shuffle<T>(&mut self, slice: &mut [T])
Shuffles the items in the slice into a pseudo-random permutation if
the control plane was constructed with arbitrary.
The default operation, to leave the slice unchanged, will always be
performed if the pseudo-random data is exhausted or the control
plane was constructed with default.
Sourcepub fn shuffled<T>(
&mut self,
iter: impl Iterator<Item = T>,
) -> impl Iterator<Item = T>
pub fn shuffled<T>( &mut self, iter: impl Iterator<Item = T>, ) -> impl Iterator<Item = T>
Returns a new iterator over the same items as the input iterator in
a pseudo-random order if the control plane was constructed with
arbitrary.
The default value, an iterator with an unchanged order, will always
be returned if the pseudo-random data is exhausted or the control
plane was constructed with default.
Trait Implementations§
Source§impl Arbitrary<'_> for ControlPlane
impl Arbitrary<'_> for ControlPlane
Source§fn arbitrary<'a>(u: &mut Unstructured<'a>) -> Result<Self>
fn arbitrary<'a>(u: &mut Unstructured<'a>) -> Result<Self>
Self from the given unstructured data. Read more§fn arbitrary_take_rest(u: Unstructured<'a>) -> Result<Self, Error>
fn arbitrary_take_rest(u: Unstructured<'a>) -> Result<Self, Error>
Self from the entirety of the given
unstructured data. Read more