MCPcopy Create free account
hub / github.com/apache/datafusion / try_from

Method try_from

datafusion/ffi/src/expr/distribution.rs:49–59  ·  view source on GitHub ↗
(value: &Distribution)

Source from the content-addressed store, hash-verified

47impl TryFrom<&Distribution> for FFI_Distribution {
48 type Error = DataFusionError;
49 fn try_from(value: &Distribution) -> Result<Self, Self::Error> {
50 match value {
51 Distribution::Uniform(d) => Ok(FFI_Distribution::Uniform(d.try_into()?)),
52 Distribution::Exponential(d) => {
53 Ok(FFI_Distribution::Exponential(d.try_into()?))
54 }
55 Distribution::Gaussian(d) => Ok(FFI_Distribution::Gaussian(d.try_into()?)),
56 Distribution::Bernoulli(d) => Ok(FFI_Distribution::Bernoulli(d.try_into()?)),
57 Distribution::Generic(d) => Ok(FFI_Distribution::Generic(d.try_into()?)),
58 }
59 }
60}
61
62impl TryFrom<FFI_Distribution> for Distribution {

Callers

nothing calls this directly

Calls 8

rateMethod · 0.80
positive_tailMethod · 0.80
p_valueMethod · 0.80
medianMethod · 0.80
rangeMethod · 0.45
offsetMethod · 0.45
meanMethod · 0.45
varianceMethod · 0.45

Tested by

no test coverage detected