#[derive(FromDoc)]
{
// Attributes available to this derive:
#[zvec]
}
Expand description
Derive a FromDoc impl that constructs Self from a
zvec::DocRef<'_>.
Mirrors IntoDoc’s attribute set:
| key | effect |
|---|---|
pk | Field takes the document’s primary key via DocRef::pk_copy. |
rename = "other" | Read the zvec-side field name "other" instead of the Rust ident. |
skip | Don’t read from the doc; initialise via Default::default(). |
binary | Read the field as Vec<u8> / binary. |
vector_fp32 | Read as Vec<f32> via get_vector_fp32. |
vector_fp64 | Read as Vec<f64> via get_vector_fp64. |
vector_int8 | Read as Vec<i8> via get_vector_int8. |
vector_int16 | Read as Vec<i16> via get_vector_int16. |
Option<T> fields tolerate missing documents (returns None);
non-Option fields error with ErrorCode::InvalidArgument when the
doc is missing them.