#[non_exhaustive]pub struct DepthBounded {
pub max_depth: usize,
/* private fields */
}Expand description
At or above max_depth, only chooses expressions that are all terminals,
guaranteeing termination. Below max_depth, behaves like RandomWalk.
Suited for generating “dummy” data for a UI or database seed that is valid but strictly bounded in size.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.max_depth: usizeMaximum expansion depth; at this depth only terminal-only expressions are chosen.
Implementations§
Trait Implementations§
Source§impl Debug for DepthBounded
impl Debug for DepthBounded
Source§impl GenerationStrategy for DepthBounded
impl GenerationStrategy for DepthBounded
Source§fn choose<'p>(
&mut self,
production: &'p Production,
depth: usize,
) -> Option<&'p Expression>
fn choose<'p>( &mut self, production: &'p Production, depth: usize, ) -> Option<&'p Expression>
Choose one of the production’s RHS alternatives. Read more
Auto Trait Implementations§
impl Freeze for DepthBounded
impl RefUnwindSafe for DepthBounded
impl Send for DepthBounded
impl Sync for DepthBounded
impl Unpin for DepthBounded
impl UnwindSafe for DepthBounded
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more