pub struct VName {
pub corpus: String,
pub root: String,
pub path: String,
pub language: String,
pub signature: String,
}Expand description
Kythe-style globally unique identifier for a code entity.
VNames are stable across repos, languages, and time — they form the universal address space of the Travsr graph.
Fields§
§corpus: StringLogical corpus (e.g. repo URL or org/project).
root: StringRoot within the corpus (e.g. branch or build root).
path: StringPath within the root (e.g. src/foo.ts).
language: StringSource language identifier (e.g. typescript, rust).
signature: StringSymbol signature within the file (e.g. class:PaymentService#charge).
Implementations§
Source§impl VName
impl VName
Sourcepub fn new(
corpus: impl Into<String>,
root: impl Into<String>,
path: impl Into<String>,
language: impl Into<String>,
signature: impl Into<String>,
) -> VName
pub fn new( corpus: impl Into<String>, root: impl Into<String>, path: impl Into<String>, language: impl Into<String>, signature: impl Into<String>, ) -> VName
Construct a VName from its five components.
Sourcepub fn id(&self) -> NodeId
pub fn id(&self) -> NodeId
Stable 64-bit identifier derived from the five-field VName.
The hash is the first 8 bytes of the BLAKE3 digest of:
[SIGNATURE_FORMAT_VERSION] || [len_u32_le][corpus] || [len_u32_le][root] || ...
Length-prefix encoding (4-byte little-endian field length before each
field) replaces the NUL-separator scheme. This guarantees that no two
distinct VNames share the same byte stream, and that a v0 byte stream
(which starts with raw corpus bytes) can never equal a v1 stream (which
starts with [version_byte][len]). See RFC-002.