1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
//! THE MOUNT SEAM: how a RESOURCE hands a wire road one corpus of itself, and the connection that
//! corpus's verbs borrow.
//!
//! ```text
//! Shared<Ft> ──corpus(slot)──► TantivyFulltext ──branded──► SlotHandle<TantivyFulltext, Media>
//! │ │
//! └──connection()──► &TantivyStore ──────────────────────────────────┴──► Connected<'_, …>
//! ```
//!
//! # Why a seam of its own, beside the two store faces that already mint handles
//!
//! [`FulltextStore::fulltext`](super::FulltextStore::fulltext) already takes a corpus name and hands
//! a handle back, and so does its awaited twin. What neither can do is be NAMED by an emitted door:
//! a resource's MODE decides which of the two it wears, the mode is a fact of a `#[ingraph::resource]`
//! declaration in some other crate, and an election that points at that resource is expanded without
//! it. So a door written over `FulltextStore` serves half the resources there are and a door written
//! over `AsyncFulltextStore` serves the other half.
//!
//! This is the MODE-BLIND face over both. The resource's own expansion is what writes it — in TWO
//! TEMPLATES, one per mode, each delegating to the store face that mode wears — so the selection
//! happens exactly where the mode is known, which is the declaration, and every door downstream
//! names one trait.
//!
//! # It carries the CONNECTION, and that is the half a wire door could not reach at all
//!
//! A handle minted here is STATELESS: `FulltextRead::search` reaches its index back through
//! [`Connected`](super::Connected), whose first half is `<Handle as FulltextEngine>::Connection` —
//! the manager the store opened. A door holding only a handle has no value of that type and no way
//! to make one, which is why the emitted resolvers built `Connected::new(&(), ())` and were readable
//! only by an engine whose connection was the unit. The mount is what holds the manager, so the
//! mount is what lends it.
//!
//! # What it does NOT do
//!
//! It does not open anything: a mount is already open — it is what
//! [`AsyncResource::build`](crate::AsyncResource) produced and what
//! [`Shared<R>`](crate::Shared) holds — so both verbs here are synchronous and infallible, which is
//! the contract the per-slot factories already keep on both store faces.
//!
//! It also does not wear the READ or WRITE faces. Those belong to the handle, one grain down, for
//! the reason `store::fulltext`'s own note states: a face on a mount would have to bake ONE corpus
//! name into itself, and a mount holds as many corpora as elections point at it.
use Utf8Bytes;
use ;
/// A resource a FULL-TEXT election reads through — the mount, mode-blind, minting one corpus at a
/// time.
///
/// # Who implements it
///
/// `#[ingraph::resource(tantivy)]` writes it. A FOREIGN resource's author writes it beside the base
/// and the faces they already write, and the body is two forwards — the open seam's usual cost, and
/// the reason the trait is public rather than sealed.
///
/// # The bound on [`Handle`](Self::Handle) is the BASE and never a face
///
/// [`FulltextEngine`] is what makes [`connection`](Self::connection)'s return type SPELLABLE — the
/// member lives on the base — and it is the same bound `holds_documents` verifies a pointing leg
/// with. Naming a face here would tax a read-only mount with a write obligation, which is the
/// division the eight faces exist for.
/// A resource a VECTOR election reads through — [`FulltextMount`]'s twin, one family over.
///
/// It differs in exactly the one parameter the two per-slot factories differ in, and for the
/// factories' own reason: a vector corpus's WIDTH is a fact its storage cannot be shaped without,
/// where a document schema has no such number.