pub trait FlussoDocument: DeserializeOwned {
const INDEX: &'static str;
const SCHEMA_HASH: &'static str;
// Provided methods
fn physical_index() -> String { ... }
fn query() -> Search<Self> { ... }
fn get(
client: &Client,
id: impl Display,
) -> impl Future<Output = Result<Option<Self>>> { ... }
}Expand description
A document type bound to a flusso-maintained index — the trait that
#[derive(FlussoDocument)] implements.
The derive supplies INDEX and SCHEMA_HASH
(the physical index is {INDEX}_{SCHEMA_HASH}, exactly what the OpenSearch
sink writes); query and get are provided.
DeserializeOwned is required so search hits and fetched documents decode.
Required Associated Constants§
Sourceconst SCHEMA_HASH: &'static str
const SCHEMA_HASH: &'static str
The schema hash this binding was generated from (the physical-index suffix).
Provided Methods§
Sourcefn physical_index() -> String
fn physical_index() -> String
The physical index this binding addresses — {INDEX}_{SCHEMA_HASH},
exactly what the sink writes. Useful for logging, admin, and
hand-written FlussoMultiDocument impls
dispatching hits by their _index.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".