#[derive(IntoDoc)]
{
// Attributes available to this derive:
#[zvec]
}
Expand description
Derive an IntoDoc impl that constructs a zvec::Doc from &self.
§Field attributes
Each field accepts at most one #[zvec(...)] attribute. Recognised
keys:
| key | effect |
|---|---|
pk | Use this field as the document’s primary key (must be a String). |
rename = "other" | Use "other" as the field name in zvec instead of the Rust ident. |
skip | Don’t emit this field at all. |
binary | Treat Vec<u8> as DataType::Binary. |
vector_fp32 | Treat Vec<f32> as DataType::VectorFp32. |
vector_fp64 | Treat Vec<f64> as DataType::VectorFp64. |
vector_int8 | Treat Vec<i8> as DataType::VectorInt8. |
vector_int16 | Treat Vec<i16> as DataType::VectorInt16. |
§Supported field types (without explicit type hint)
String, bool, i32, i64, u32, u64, f32, f64. Each of
these may be wrapped in Option<T> — None emits
Doc::set_field_null(name).
Vec<_>-typed fields require an explicit type hint (see table
above), because the same Rust type can map to several different
zvec DataTypes.