Method
new
(property_type: Cow<'a, PropertyTypeReference>, required: bool)
Source from the content-addressed store, hash-verified
| 30 | |
| 31 | impl<'a> PropertyObjectPropertyDistribution<'a> { |
| 32 | fn new(property_type: Cow<'a, PropertyTypeReference>, required: bool) -> Self { |
| 33 | Self { |
| 34 | probability: Bernoulli::new(if required { 1.0 } else { 0.5 }).unwrap_or_else(|error| { |
| 35 | unreachable!("Bernoulli distribution should always be able to be created: {error}") |
| 36 | }), |
| 37 | property_type, |
| 38 | } |
| 39 | } |
| 40 | } |
| 41 | |
| 42 | #[derive(Debug, Clone)] |
Callers
nothing calls this directly
Tested by
no test coverage detected