MCPcopy Create free account
hub / github.com/hashintel/hash / new

Method new

tests/graph/test-data/rust/src/seeding/distributions/property.rs:32–39  ·  view source on GitHub ↗
(property_type: Cow<'a, PropertyTypeReference>, required: bool)

Source from the content-addressed store, hash-verified

30
31impl<'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

Calls 8

ErrInterface · 0.85
OkInterface · 0.85
expandMethod · 0.80
is_emptyMethod · 0.45
try_collect_reportsMethod · 0.45
mapMethod · 0.45
iterMethod · 0.45
into_iterMethod · 0.45

Tested by

no test coverage detected