MCPcopy Create free account
hub / github.com/cosdata/cosdata / from

Method from

src/models/schema_traits.rs:17–24  ·  view source on GitHub ↗
(metric: DistanceMetric)

Source from the content-addressed store, hash-verified

15// Implement From and Into traits to convert between the wrapper and real type
16impl From<DistanceMetric> for DistanceMetricSchema {
17 fn from(metric: DistanceMetric) -> Self {
18 match metric {
19 DistanceMetric::Cosine => DistanceMetricSchema::Cosine,
20 DistanceMetric::Euclidean => DistanceMetricSchema::Euclidean,
21 DistanceMetric::Hamming => DistanceMetricSchema::Hamming,
22 DistanceMetric::DotProduct => DistanceMetricSchema::DotProduct,
23 }
24 }
25}
26
27impl From<DistanceMetricSchema> for DistanceMetric {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected