pub enum Unit {
File {
path: String,
},
Section {
file: String,
anchor: String,
},
Symbol {
id: String,
},
Directory {
path: String,
},
Crate {
id: String,
},
Module {
id: String,
},
}Expand description
An authority unit: the granularity at which a spec claims ownership.
Serializes internally-tagged on kind (e.g. { "kind": "file", "path": ... }).
Deserializes from that tagged map, a bare string (= a file unit), or a
{ unit: <unit> } wrapper (spec 015 sugar), so authors can write
establishes: ["src/lib.rs"] or establishes: [{ unit: "src/lib.rs" }]
interchangeably; all three normalize to the same unit.
Variants§
File
A file path (bare string shorthand resolves here). A trailing / denotes
the directory subtree rooted at path.
Section
A named section within a file: a Makefile target, a Markdown heading slug,
a region: marker, or a CI jobs.<name>.
Symbol
A symbol (function / type / export), resolved by the indexer via
tree-sitter (Rust .rs and TypeScript .ts/.tsx).
Directory
A directory subtree, named explicitly ({ kind: directory, path }). The
subtree-prefix resolution is identical to a trailing-slash file unit; the
distinct kind preserves the author’s intent across the round-trip (spec
017). Resolves to the directory path; the gate prefix-matches it.
Crate
A compilation unit by its manifest name (Cargo [package].name or npm
package.json:name), resolved against the discovered package inventory to
the package directory subtree (spec 017).
Module
A module by its ::-qualified path (e.g. my_crate::serialization),
resolved by the indexer’s Rust module index: file-modules (whole file)
and top-level inline mod blocks (line-span) (spec 017).
Implementations§
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Unit
impl<'de> Deserialize<'de> for Unit
Source§fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
impl Eq for Unit
impl StructuralPartialEq for Unit
Auto Trait Implementations§
impl Freeze for Unit
impl RefUnwindSafe for Unit
impl Send for Unit
impl Sync for Unit
impl Unpin for Unit
impl UnsafeUnpin for Unit
impl UnwindSafe for Unit
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.