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

Method try_from

src/grpc/metadata.rs:18–24  ·  view source on GitHub ↗
(value: proto::FieldValue)

Source from the content-addressed store, hash-verified

16impl TryFrom<proto::FieldValue> for FieldValue {
17 type Error = String;
18 fn try_from(value: proto::FieldValue) -> Result<Self, Self::Error> {
19 match value.value {
20 Some(proto::field_value::Value::IntValue(i)) => Ok(FieldValue::Int(i)),
21 Some(proto::field_value::Value::StringValue(s)) => Ok(FieldValue::String(s)),
22 None => Err("FieldValue must have a value".to_string()),
23 }
24 }
25}
26
27// MetadataField conversions

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected