SeedGraphIndex

Struct SeedGraphIndex 

Source
pub struct SeedGraphIndex { /* private fields */ }
Expand description

Runtime index over the System-block seed graph (8589934592..=12884901887).

Implementations§

Source§

impl SeedGraphIndex

Source

pub const fn instance_id(&self) -> u64

Returns the process-unique identifier assigned to this SeedGraphIndex instance.

Source

pub fn shared() -> Result<&'static Arc<Self>>

Returns the lazily loaded process-wide SeedGraphIndex from the runtime asset bundle.

Source

pub fn load_from_asset_bundle() -> Result<Self>

Loads all active data/graph/*.ctbnbdl bundle files (beginning with data/graph/85899_34592.ctbnbdl) from the runtime asset bundle (ctoolbox.rsrc) and indexes all active statements, seed entities, and value nodes.

Errors strictly by default on any checksum, framing, ordering, or value-immutability violation unless --recover-graph is enabled on the current invocation.

Source

pub fn load_from_asset_bundle_with_recovery(recover_graph: bool) -> Result<Self>

Loads active data/graph/*.ctbnbdl bundles from the runtime asset bundle, enforcing strict errors when recover_graph is false or quarantining and warning on damaged sections/invariants when recover_graph is true (--recover-graph).

Source

pub fn load_with_history_from_asset_bundle() -> Result<Self>

Loads both active data/graph/*.ctbnbdl bundles (from ctoolbox.rsrc) and optional historical/inactive data/graph/system/*.ctbnbdl bundles (from system_graph_history.rsrc if installed, or assets/data/graph/system/ in dev mode), merging them in ascending node ID order and resolving all Dc 591 (Supersedes) and Dc 592 (Retracts) history.

Source

pub fn load_at_most_recent_from_asset_bundle( most_recent_node_id: u128, ) -> Result<Arc<Self>>

Loads a SeedGraphIndex pinned to the System-block state as of most_recent_node_id (Dc 641 "Global graph system block most recent node ID at time of document creation").

If most_recent_node_id matches the shared HEAD seed graph’s system_block_most_recent_node_id(), returns the shared HEAD index in $O(1)$. If most_recent_node_id exceeds HEAD, returns an error rather than silently substituting HEAD. Otherwise, loads active and historical .ctbnbdl bundles, verifies that historical coverage is complete up to most_recent_node_id, and reconstructs the graph state as of most_recent_node_id.

Source

pub fn from_active_and_history_nodes_at_most_recent( active_most_recent: Option<u128>, active_nodes: Vec<LedgerNode>, history_most_recent: Option<u128>, history_nodes: Vec<LedgerNode>, most_recent_node_id: u128, ) -> Result<Self>

Reconstructs a SeedGraphIndex pinned to most_recent_node_id from separate active (data/graph/*.ctbnbdl) and historical (data/graph/system/*.ctbnbdl) node lists, enforcing snapshot bounds and historical bundle completeness.

Source

pub fn from_ctbnbdl_bytes(bytes: &[u8]) -> Result<Self>

Decodes a single .ctbnbdl byte slice strictly and builds a SeedGraphIndex.

Fails immediately on any checksum mismatch, malformed section, supersession cycle, or pure-value Dc 591 / Dc 592 revision.

Source

pub fn from_ctbnbdl_bytes_resilient(bytes: &[u8]) -> Result<(Self, Vec<String>)>

Resiliently decodes a .ctbnbdl byte slice (for --recover-graph), logging and returning any section-quarantine or graph-invariant warnings while building a SeedGraphIndex from all recovered valid nodes.

Source

pub fn from_nodes(nodes: Vec<LedgerNode>) -> Self

Builds a SeedGraphIndex from an ordered list of LedgerNodes using the default single-valued property set.

Source

pub fn from_bundled_nodes(nodes: Vec<LedgerNode>) -> Self

Builds a SeedGraphIndex from an ordered list of host-authenticated bundled LedgerNodes (loaded from ctoolbox.rsrc / system_graph_history.rsrc), marking all supplied System-region nodes as having authenticated bundled origin.

Source

pub fn from_bundled_nodes_at_most_recent( nodes: Vec<LedgerNode>, most_recent_node_id: u128, ) -> Self

Builds a SeedGraphIndex pinned to most_recent_node_id from an ordered list of host-authenticated bundled LedgerNodes without marking from_asset_bundle.

Source

pub fn load_merged_nodes_from_disk_graph_dir( graph_dir: &Path, ) -> Result<Vec<LedgerNode>>

Loads and merges all active (<graph_dir>/*.ctbnbdl) and historical (<graph_dir>/system/*.ctbnbdl) System-graph bundles directly from disk in strictly ascending node ID order.

§Errors

Returns an error if <graph_dir> contains no .ctbnbdl files, if any bundle fails decoding or ordering checks, or if duplicate node IDs exist across active and historical bundles.

Source

pub fn from_bundled_and_extra_nodes( bundled_nodes: Vec<LedgerNode>, extra_nodes: Vec<LedgerNode>, ) -> Result<Self>

Builds a SeedGraphIndex combining host-authenticated bundled System nodes (bundled_nodes) with extra/unbundled nodes (extra_nodes, such as Wikidata or external resource bundles).

Only nodes originating from bundled_nodes are recorded in bundled_origin_node_ids; extra_nodes cannot supply bootstrap authority even if their numeric node IDs or self-asserted Dc 635 provenance claims mimic bundled System nodes.

Source

pub fn from_nodes_at_most_recent( nodes: Vec<LedgerNode>, most_recent_node_id: u128, ) -> Self

Builds a SeedGraphIndex reflecting the System-block graph state as of most_recent_node_id (Dc 641 "Global graph system block most recent node ID at time of document creation"), ignoring any statements, supersessions (Dc 591), or retractions (Dc 592) allocated with node.id > most_recent_node_id.

Source

pub fn from_nodes_with_single_props( nodes: Vec<LedgerNode>, single_valued_props: &HashSet<DcShorthand>, ) -> Self

Builds a SeedGraphIndex from nodes and a custom set of single-valued property Dcs.

Source

pub fn collect_graph_invariant_anomalies(&self) -> Vec<String>

Collects semantic graph invariant anomalies (supersession cycles, or active Dc 591 / Dc 592 statements revising pure value nodes other than Dc 348 disambiguation lists).

Source

pub fn validate_or_warn_graph_invariants( &self, recover_graph: bool, ) -> Result<()>

Validates semantic graph invariants: errors strictly when recover_graph is false (the default), or logs warnings and continues when recover_graph is true (--recover-graph).

Source

pub fn system_block_most_recent_node_id(&self) -> Option<u128>

Returns the highest allocated node ID in the System block at the time the graph bundle was created (Dc 641 "Global graph system block most recent node ID at time of document creation").

Source

pub const fn is_from_asset_bundle(&self) -> bool

Returns true if this SeedGraphIndex was loaded from the runtime asset bundle (ctoolbox.rsrc / system_graph_history.rsrc), meaning historical Dc 641 pins must be reconstructed via the asset bundle (merging data/graph/ and data/graph/system/) rather than slicing active-only nodes in memory.

Source

pub fn node_data_source(&self, node_id: u128) -> Option<DcShorthand>

Returns the declared Dc 635 ("Collective Toolbox seed graph data source") token for node_id in the seed graph, if present.

Source

pub fn has_in_graph_provenance(&self) -> bool

Returns true if the seed graph contains any Dc 635 ("Collective Toolbox seed graph data source") provenance declarations.

Source

pub fn node_count(&self) -> usize

Returns the total number of nodes in the loaded seed graph.

Source

pub fn nodes(&self) -> &[LedgerNode]

Returns a slice of all loaded LedgerNodes.

Source

pub fn get_node(&self, id: u128) -> Option<&LedgerNode>

Looks up a LedgerNode by its global node ID (u128).

Source

pub fn is_node_active(&self, id: u128) -> bool

Returns true if id exists in the seed graph and has not been superseded or retracted.

Source

pub fn inactive_count(&self) -> usize

Returns the total number of inactive (superseded or retracted) nodes in the seed graph.

Source

pub fn superseded_count(&self) -> usize

Returns the number of superseded nodes (Dc 591) in the seed graph.

Source

pub fn retracted_count(&self) -> usize

Returns the number of retracted nodes (Dc 592) in the seed graph.

Source

pub fn get_ambiguous_candidates(&self, id: u128) -> Option<Vec<u128>>

Follows any Dc 591 "Supersedes" chain from id to its terminal replacement node, and if that node (or id itself) is a Dc 348 "Ambiguous values" list (348 310 ... 311), returns the ordered candidate node IDs.

Source

pub fn superseded_by(&self, id: u128) -> Option<u128>

Returns the node ID that directly superseded id via Dc 591 (Supersedes), if any.

Source

pub fn retracted_by(&self, id: u128) -> Option<u128>

Returns the statement node ID that retracted id via Dc 592 (Retracts), if any.

Source

pub fn resolve_latest_node_id(&self, id: u128) -> Option<u128>

Follows any Dc 591 (Supersedes) chain starting from id to its latest active node ID, returning None if id is unknown, if the terminal revision was retracted (Dc 592), or if a supersession cycle is encountered.

Source

pub fn get_active_node(&self, id: u128) -> Option<&LedgerNode>

Resolves id through any active Dc 591 (Supersedes) chain within this snapshot and returns the active terminal LedgerNode, or None if id is unknown, retracted (Dc 592), or outside the snapshot.

Source

pub fn query_active_node_verbatim(&self, id: u128) -> Option<&[DcShorthand]>

Returns the exact verbatim Dc token slice inside an active node id without following supersession chains or expanding child references.

Source

pub fn query_active_nodes_by_exact_tokens( &self, tokens: &[DcShorthand], ) -> &[u128]

Returns all active node IDs (sorted ascending) in the snapshot whose verbatim token slice equals tokens exactly.

Source

pub fn query_active_relationship_triples( &self, verb: Option<DcShorthand>, subj: Option<DcShorthand>, obj: Option<DcShorthand>, ) -> Vec<(u128, DcShorthand, DcShorthand, DcShorthand)>

Queries all active relationship triples (stmt_id, verb, subj, obj) in the snapshot matching the supplied pattern (None = Dc 600 wildcard). Includes both direct 3-token statements and Dc 638 for-each distributions.

Source

pub fn get_string(&self, tok: DcShorthand) -> Option<&str>

Resolves tok as a string value node (DcShorthand::Long(id)), returning its decoded UTF-8 string.

Source

pub fn get_integer(&self, tok: DcShorthand) -> Option<u128>

Resolves tok as an integer value node (DcShorthand::Long(id)), returning its decoded u128.

Source

pub fn get_seed_entity_id(&self, key: &SeedEntityKey) -> Option<u128>

Looks up the allocated u128 node ID for a SeedEntityKey.

Source

pub fn get_seed_entity(&self, id: u128) -> Option<&SeedEntityKey>

Looks up the SeedEntityKey for a seed entity node ID (u128), resolving through any active Dc 591 (Supersedes) chain in the snapshot.

Source

pub fn get_single_property( &self, subj: DcShorthand, prop: DcShorthand, ) -> Option<DcShorthand>

Returns the active value token for a single-valued property (subj, prop).

Source

pub fn get_single_property_entry( &self, subj: DcShorthand, prop: DcShorthand, ) -> Option<ActivePropertyValue>

Returns the full ActivePropertyValue (has_a_id, has_val_id, value) for a single-valued property (subj, prop).

Source

pub fn get_single_property_string( &self, subj: DcShorthand, prop: DcShorthand, ) -> Option<&str>

Returns the decoded UTF-8 string of a single-valued string property (subj, prop).

Source

pub fn get_single_property_integer( &self, subj: DcShorthand, prop: DcShorthand, ) -> Option<u128>

Returns the decoded u128 integer of a single-valued integer property (subj, prop).

Source

pub fn get_multi_properties( &self, subj: DcShorthand, prop: DcShorthand, ) -> &[ActivePropertyValue]

Returns all active ActivePropertyValue entries for a multi-valued property (subj, prop).

Source

pub fn get_preferred_replacements(&self, subj: DcShorthand) -> &[DcShorthand]

Returns all active preferred replacement target tokens (<prefer>) for subj.

Source

pub fn has_direct_statement( &self, verb: DcShorthand, subj: DcShorthand, obj: DcShorthand, ) -> bool

Returns true if the direct binary statement (verb, subj, obj) is currently active.

Source

pub fn has_stable_programmatic_identifier(&self, subj: DcShorthand) -> bool

Returns true if subj’s active Dc 574 "Programmatic identifier" (Has a statement node) has an active Dc 645 "Is stable" statement (645 l<ident_has_a_id> 517) that is Dc 646 "In context of" f649 (Collective Toolbox).

Source

pub fn get_direct_objects( &self, verb: DcShorthand, subj: DcShorthand, ) -> &[DcShorthand]

Returns all active object tokens obj for direct binary statements (verb, subj, obj).

Source

pub fn get_direct_subjects( &self, verb: DcShorthand, obj: DcShorthand, ) -> &[DcShorthand]

Returns all active subject tokens subj for direct binary statements (verb, subj, obj).

Source

pub fn seed_entities(&self) -> &HashMap<SeedEntityKey, u128>

Returns a map of all indexed SeedEntityKey entries to their allocated u128 node IDs.

Source

pub fn active_single_props( &self, ) -> &BTreeMap<(DcShorthand, DcShorthand), (u128, u128, DcShorthand)>

Returns the map of all active single-valued properties (subject, prop_token) -> (has_a_id, has_val_id, val_token).

Source

pub fn active_multi_props( &self, ) -> &BTreeMap<(DcShorthand, DcShorthand, DcShorthand), (u128, u128)>

Returns the map of all active multi-valued properties (subject, prop_token, val_token) -> (has_a_id, has_val_id).

Source

pub fn active_preferred( &self, ) -> &BTreeMap<(DcShorthand, DcShorthand), (u128, u128, u128)>

Returns the map of all active preferred replacements (subject, val_token) -> (has_a_id, has_val_id, pref_qual_id).

Source

pub fn active_direct_stmts( &self, ) -> &BTreeMap<(DcShorthand, DcShorthand, DcShorthand), u128>

Returns the map of all active direct binary statements (verb, subject, object) -> stmt_id.

Source

pub fn get_syntax_rule_tokens( &self, subj: DcShorthand, ) -> Option<&[DcShorthand]>

Returns the raw .Semantic:Pattern token slice for the active Dc 594 (Syntax rule) property on subj, without allocating or decoding a Rust SyntaxPattern AST.

Source

pub fn get_named_construct_tokens(&self, name: &str) -> Option<&[DcShorthand]>

Returns the raw .Semantic:Pattern token slice for a named syntax construct (e.g. "number", "string", "value"), without allocating a Rust SyntaxPattern AST.

Source

pub fn tokens_start_wasm_definition(tokens: &[DcShorthand]) -> bool

Returns true if tokens begins with a Dc-WASM program (Dc 1927 "Begin WASM program") or a wasm_routine literal (Dc 260 "Begin literal value", Dc 262 "Begin type definition", Dc 280 "Built-in type identifier: Routine").

Source

pub fn tokens_are_wasm_helper_or_definition( &self, tokens: &[DcShorthand], ) -> bool

Returns true if tokens represents a Dc-WASM program, wasm_routine literal, WASM instruction/member helper fragment, or transitive reference to one in this snapshot.

Source

pub fn get_wasm_definition_tokens( &self, subj: DcShorthand, ) -> Option<&[DcShorthand]>

Resolves any active .WASM program (Dc 1927 "Begin WASM program"..Dc 1928 "End WASM program"), wasm_routine definition, or transitive WASM helper attached to subj via Dc 611 "Canonical decomposition", Dc 571 "Decomposition", Dc 614 "Semantic decomposition", or a trailing Dc 607 "Pattern replacement" action inside subj’s Dc 594 "Syntax rule".

Source

pub fn get_wasm_definition_tokens_in_context( &self, subj: DcShorthand, context_tokens: &[DcShorthand], ) -> Option<&[DcShorthand]>

Resolves any active context-scoped .WASM program (Dc 1927 "Begin WASM program"..Dc 1928 "End WASM program") or wasm_routine definition attached to subj whose Dc 646 "In context of" qualifier matches context_tokens (preferring an exact match over a trailing Dc 275 "*" wildcard prefix).

Source

pub fn list_active_contextual_wasm_definitions( &self, subj: DcShorthand, ) -> Vec<(Vec<DcShorthand>, Vec<DcShorthand>)>

Lists all active context-scoped .WASM (Dc 1927..Dc 1928) definitions attached to subj in this snapshot ((context_tokens, expanded_wasm_tokens)), expanding interned Unicode runs and wrapping standalone Dc 260..Dc 261 routines in Dc 1927..Dc 1928.

Source

pub fn resolve_wasm_helper_shorthand( &self, subj: DcShorthand, ) -> Result<Option<(Option<u128>, &[DcShorthand])>>

Resolves subj (DcShorthand::Short or DcShorthand::Format) as a WASM helper or definition in this snapshot via Dc 611 "Canonical decomposition", Dc 571 "Decomposition", Dc 614 "Semantic decomposition", or a trailing Dc 607 "Pattern replacement" action inside subj’s Dc 594 "Syntax rule".

§Errors

Returns an error if subj’s WASM decomposition or target node was retracted in this snapshot, targets an unsupported graph block, or exceeds the pinned System graph snapshot.

Source

pub fn get_entity_class(&self, entity_id: u128) -> Option<DcShorthand>

Returns the <class_tok> of an active non-seed entity node (586 615 <class_tok>), if entity_id is an active entity in this snapshot.

Source

pub fn is_transformation_format_subject(&self, subj: DcShorthand) -> bool

Returns true if subj is a DcShorthand::Format(_) whose active script in this snapshot is .Formats:transformation.

Source

pub fn list_all_active_converter_steps( &self, ) -> Result<Vec<ActiveConverterStep<'_>>>

Lists all active single-step converters ([Dc 302 "Type conversion", src, dst]) in this snapshot across standalone Routine entities (Dc 280) and .Formats:transformation Format Dcs (DcShorthand::Format(_)), ordered with Dc 570 "Preferred" entries first and ties broken by ascending global Dc ID.

§Errors

Returns an error if an active converter’s decomposition target node was retracted, references an unsupported graph block, or exceeds the pinned System graph snapshot.

Source

pub fn resolve_active_converter_chain( &self, src: DcShorthand, dst: DcShorthand, ) -> Result<Option<Vec<ActiveConverterStep<'_>>>>

Resolves the shortest active conversion path ([Dc 302 src_0 dst_0], …, [Dc 302 src_k dst]) from src to dst in this snapshot, preferring Dc 570 "Preferred" converters at each hop and breaking ties deterministically by ascending global Dc ID.

§Errors

Returns an error if any candidate converter’s target node is invalid in this snapshot.

Source

pub fn resolve_active_converter_routine( &self, src: DcShorthand, dst: DcShorthand, ) -> Result<Option<(u128, &[DcShorthand])>>

Resolves the highest-precedence direct .WASM converter ([Dc 302 "Type conversion", src, dst]) in this snapshot (either a .Formats:transformation Format Dc or a standalone Routine entity), returning (subject_global_dc_id, wasm_tokens).

§Errors

Returns an error if a matching active converter’s target node was retracted, references an unsupported graph block, or exceeds the pinned System graph snapshot.

Source

pub fn expand_interned_string_nodes( &self, tokens: &[DcShorthand], ) -> Vec<DcShorthand>

Expands interned [string] (Dc 260 .. Dc 261), comment (Dc 246/247..248, Dc 249/250..251), identifier (Dc 270..271), and legacy pre-cleanup pure-Unicode run nodes back into inline Dc tokens.

Source

pub fn tokens_are_stagel_item_or_module( &self, raw_tokens: &[DcShorthand], ) -> bool

Returns true if raw_tokens (after expanding interned [string] nodes and skipping leading single-line comment frames) begins with a StageL 3 module or top-level declaration Token Dc.

Source

pub fn resolve_stagel_decomposition_tokens( &self, subj: DcShorthand, ) -> Result<Option<(u128, Vec<DcChar>)>>

Resolves subj (DcShorthand::Long, Short, or Format) to its active StageL 3 Token-Dc decomposition ((value_node_id, expanded_dc_chars)) in this snapshot via Dc 611 "Canonical decomposition", Dc 571 "Decomposition", or Dc 614 "Semantic decomposition".

§Errors

Returns an error if subj or its StageL decomposition target node was retracted in this snapshot (Dc 592 "Retracts"), references an unsupported graph block, or exceeds the pinned System graph snapshot (Dc 641).

Source

pub fn resolve_stagel_namespace_exports( &self, ns_segments: &[String], ) -> Result<BTreeMap<String, Vec<DcShorthand>>>

Resolves all active pub StageL symbols exported in ns_segments (f229 "File path" context on Dc 574 "Programmatic identifier"), returning a deterministic map of export_name -> Vec<subject_dc_shorthand> (supporting fixed-arity parameter-type routine overloads and typed constant overloads within the same namespace).

Source

pub fn resolve_stagel_entity_namespace( &self, subj: DcShorthand, ) -> Result<Option<Vec<String>>>

Resolves the declared PSR-4 StageL/StageR namespace segments (f229 "File path" context on Dc 574 "Programmatic identifier") for an exported StageL/StageR entity subj, returning Ok(None) when subj has no FilePath-contextualized programmatic identifier in the active snapshot.

Source

pub fn resolve_stagel_routine_metadata( &self, subj: DcShorthand, ) -> Result<StagelRoutineGraphMeta>

Resolves decoupled non-executable metadata (is_pub, Dc 574 name, home namespace via Dc 646 or Dc 598, Dc 573 description, and Dc 1942 test suite tokens) attached to a StageL/StageR routine entity or direct Dc 2240..2241 value node subj.

Source

pub fn is_trusted_seed_graph_data_source(source: DcShorthand) -> bool

Returns true if source is a trusted Collective Toolbox seed graph provenance source: Dc 636 "Collective Toolbox Dc CSV seed database" or Dc 637 "Manual entry".

Source

pub fn is_bundled_origin_node(&self, node_id: u128) -> bool

Returns true if node_id originated from the host-authenticated bundled asset (ctoolbox.rsrc / system_graph_history.rsrc).

Source

pub fn verify_authenticated_bundled_system_provenance( &self, node_id: u128, ) -> Result<()>

Verifies that node_id resides in the System block (8_589_934_592..=17_179_869_183), originated from the host-authenticated bundled asset (ctoolbox.rsrc / system_graph_history.rsrc), and carries verified Dc 635 ("Collective Toolbox seed graph data source") provenance (Dc 636 or Dc 637) asserted by bundled System-block provenance statements.

§Errors

Returns an error if node_id is outside the System block, missing from the index, from an extra/unbundled resource, missing Dc 635 provenance, or associated with an untrusted or unbundled Dc 635 provenance statement.

Source

pub fn verify_node_supersession_and_retraction_chain( &self, node_id: u128, ) -> Result<()>

Verifies that node_id and every Dc 591 "Supersedes" / Dc 592 "Retracts" statement along its revision chain satisfy Self::verify_authenticated_bundled_system_provenance.

Source

pub fn verify_subject_provenance_and_history( &self, subj: DcShorthand, ) -> Result<()>

Verifies that every statement (active or historical) touching subj, together with all Dc 610 "Has value" value statements and Dc 591 "Supersedes" / Dc 592 "Retracts" statements on those chains, satisfies Self::verify_authenticated_bundled_system_provenance.

Source

pub fn resolve_trusted_system_supervisor_bootstrap_tokens( &self, bootstrap_tokens: &[DcShorthand], ) -> Result<TrustedSystemSupervisorResolution>

Resolves an unpinned 1-Short-Dc bootstrap entry document (bootstrap_tokens) to its latest trusted System-block definition from the application-bundled trusted base (ctoolbox.rsrc).

§Errors

Returns an error if bootstrap_tokens is empty, begins with a Dc 641 pin, contains multiple tokens or a non-Short Dc, or if any statement, supersession/retraction chain, or transitive dependency fails authenticated bundled System provenance verification.

Source

pub fn resolve_trusted_system_supervisor_dc( &self, entry_dc: DcChar, ) -> Result<TrustedSystemSupervisorResolution>

Resolves the unpinned Short Dc entry_dc to its latest active System-block supervisor definition, verifying authenticated bundled-origin statement provenance (ctoolbox.rsrc + trusted Dc 635 = Dc 636 or Dc 637) across the entry character’s statements, supersession (Dc 591) and retraction (Dc 592) chains, and all transitive dependencies.

Source

pub fn discover_system_wasm_substitute_targets( &self, ) -> Result<Vec<SystemWasmSubstituteTarget>>

Auto-discovers all runnable graph Dcs and standalone .WASM value nodes active at this snapshot (Dc 1936, active .WASM/StageL/StageR [Dc 302 src dst] converters, standalone uncontextualized .WASM modules, standalone pub dc/<shorthand> StageL/StageR routines with (l/u8 -> l/u8) or (dcs -> dcs) signatures, and unowned standalone Dc 1927..Dc 1928 value nodes), sorted deterministically by ascending (global_id, defining_node_id).

§Errors

Returns an error if strict is true and any discovered target fails shorthand global-ID resolution or decomposition inspection.

Source

pub fn compute_substitute_target_revision_sha256( &self, target: &SystemWasmSubstituteTarget, ) -> Result<[u8; 32]>

Computes the deterministic SHA-256 closure digest ([u8; 32]) of a SystemWasmSubstituteTarget across its active source and compiler dependencies in this SeedGraphIndex snapshot.

§Errors

Returns an error if target’s active decomposition or converter chain is missing.

Source§

impl SeedGraphIndex

Source

pub fn reconstruct_dc_defns(&self) -> Result<Vec<DcDefn>>

Reconstructs all Document Character definitions (DcDefn for Unicode clarifications and Short Dcs) directly from the indexed seed graph, sorted in ascending dc_id order.

Source

pub fn reconstruct_format_defns(&self) -> Result<Vec<DcDefn>>

Reconstructs all Format definitions (DcShorthand::Format(_)) from the active seed graph statements, sorted by ascending dc_id.

Source

pub fn reconstruct_named_types(&self) -> Result<Vec<ReconstructedNamedType>>

Reconstructs all active named syntax constructs (SeedEntityKey::NamedConstruct) that define a Dc 594 (Syntax rule) in the seed graph, ordered by ascending entity node ID.

Source

pub fn decode_format_expr_node(&self, node_id: u128) -> Result<FormatExpr>

Decodes a FormatExpr value node by its node_id.

Source

pub fn decode_pattern_node(&self, node_id: u128) -> Result<DcSyntaxRule>

Decodes a .Semantic:Pattern value node by its node_id into a DcSyntaxRule.

Source

pub fn decode_syntax_rule_for_subject( &self, subj: DcShorthand, ) -> Result<Option<DcSyntaxRule>>

Resolves and decodes the active Dc 594 (Syntax rule) property for subj, if present.

Source

pub fn decode_named_construct_pattern( &self, name: &str, ) -> Result<Option<SyntaxPattern>>

Resolves and decodes the active SyntaxPattern for a named syntax construct (e.g. "number", "string", "value"), if present in the seed graph.

Source

pub fn decode_syntax_rule_tokens( &self, tokens: &[DcShorthand], ) -> Result<DcSyntaxRule>

Decodes a .Semantic:Pattern token sequence into a DcSyntaxRule.

Source

pub fn strip_pattern_action_tokens<'a>( &self, tokens: &'a [DcShorthand], ) -> Result<&'a [DcShorthand]>

Strips any trailing 298 607 ... 299 (Pattern replacement) action group from tokens.

Source

pub fn pattern_tokens_start_with_self(&self, tokens: &[DcShorthand]) -> bool

Returns true if the .Semantic:Pattern token sequence begins with Dc 599 "Self reference" (or an alternation whose first branch begins with Dc 599 "Self reference").

Source

pub fn pattern_tokens_start_with_self_or_charset( &self, tokens: &[DcShorthand], ) -> bool

Returns true if the .Semantic:Pattern token sequence begins with Dc 599 "Self reference" or a character set (298 604 ... or 298 602 <non-group> ...).

Source

pub fn pattern_tokens_can_start_with_token( &self, raw_tokens: &[DcShorthand], pred: &mut impl FnMut(u128) -> bool, ) -> bool

Returns true if any leading element of tokens (accounting for nullable leading elements) explicitly targets a character satisfying pred.

Source

pub fn step_pattern_token_slice<'a>( &self, tokens: &'a [DcShorthand], idx: usize, ) -> Result<(PatternTokenStep<'a>, Quantifier, usize)>

Steps a single quantified element from tokens at idx without constructing a SyntaxPattern AST for nested groups (298 ... 299).

Source

pub fn split_alternation_branches<'a>( &self, tokens: &'a [DcShorthand], ) -> Result<Option<Vec<&'a [DcShorthand]>>>

If tokens is a top-level 298 602 (branch1) (branch2) ... 299 alternation, returns the inner token slices for each branch without allocating a recursive AST.

Source

pub fn step_pattern_element_tokens( &self, tokens: &[DcShorthand], idx: usize, ) -> Result<(SyntaxElement, usize)>

Decodes a single quantified SyntaxElement at idx from a .Semantic:Pattern token slice, returning (element, next_idx).

Trait Implementations§

Source§

impl Clone for SeedGraphIndex

Source§

fn clone(&self) -> SeedGraphIndex

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for SeedGraphIndex

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where T: 'a,

§

fn implicit( self, class: Class, constructed: bool, tag: u32, ) -> TaggedParser<'a, Implicit, Self, E>

Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DynClone for T
where T: Clone,

Source§

fn __clone_box(&self, _: Private) -> *mut ()

§

impl<T, U> ExactFrom<T> for U
where U: TryFrom<T>,

§

fn exact_from(value: T) -> U

§

impl<T, U> ExactInto<U> for T
where U: ExactFrom<T>,

§

fn exact_into(self) -> U

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
§

impl<T, U> OverflowingInto<U> for T
where U: OverflowingFrom<T>,

§

fn overflowing_into(self) -> (U, bool)

§

impl<T> Paint for T
where T: ?Sized,

§

fn fg(&self, value: Color) -> Painted<&T>

Returns a styled value derived from self with the foreground set to value.

This method should be used rarely. Instead, prefer to use color-specific builder methods like red() and green(), which have the same functionality but are pithier.

§Example

Set foreground color to white using fg():

use yansi::{Paint, Color};

painted.fg(Color::White);

Set foreground color to white using white().

use yansi::Paint;

painted.white();
§

fn primary(&self) -> Painted<&T>

Returns self with the fg() set to [Color :: Primary].

§Example
println!("{}", value.primary());
§

fn fixed(&self, color: u8) -> Painted<&T>

Returns self with the fg() set to [Color :: Fixed].

§Example
println!("{}", value.fixed(color));
§

fn rgb(&self, r: u8, g: u8, b: u8) -> Painted<&T>

Returns self with the fg() set to [Color :: Rgb].

§Example
println!("{}", value.rgb(r, g, b));
§

fn black(&self) -> Painted<&T>

Returns self with the fg() set to [Color :: Black].

§Example
println!("{}", value.black());
§

fn red(&self) -> Painted<&T>

Returns self with the fg() set to [Color :: Red].

§Example
println!("{}", value.red());
§

fn green(&self) -> Painted<&T>

Returns self with the fg() set to [Color :: Green].

§Example
println!("{}", value.green());
§

fn yellow(&self) -> Painted<&T>

Returns self with the fg() set to [Color :: Yellow].

§Example
println!("{}", value.yellow());
§

fn blue(&self) -> Painted<&T>

Returns self with the fg() set to [Color :: Blue].

§Example
println!("{}", value.blue());
§

fn magenta(&self) -> Painted<&T>

Returns self with the fg() set to [Color :: Magenta].

§Example
println!("{}", value.magenta());
§

fn cyan(&self) -> Painted<&T>

Returns self with the fg() set to [Color :: Cyan].

§Example
println!("{}", value.cyan());
§

fn white(&self) -> Painted<&T>

Returns self with the fg() set to [Color :: White].

§Example
println!("{}", value.white());
§

fn bright_black(&self) -> Painted<&T>

Returns self with the fg() set to [Color :: BrightBlack].

§Example
println!("{}", value.bright_black());
§

fn bright_red(&self) -> Painted<&T>

Returns self with the fg() set to [Color :: BrightRed].

§Example
println!("{}", value.bright_red());
§

fn bright_green(&self) -> Painted<&T>

Returns self with the fg() set to [Color :: BrightGreen].

§Example
println!("{}", value.bright_green());
§

fn bright_yellow(&self) -> Painted<&T>

Returns self with the fg() set to [Color :: BrightYellow].

§Example
println!("{}", value.bright_yellow());
§

fn bright_blue(&self) -> Painted<&T>

Returns self with the fg() set to [Color :: BrightBlue].

§Example
println!("{}", value.bright_blue());
§

fn bright_magenta(&self) -> Painted<&T>

Returns self with the fg() set to [Color :: BrightMagenta].

§Example
println!("{}", value.bright_magenta());
§

fn bright_cyan(&self) -> Painted<&T>

Returns self with the fg() set to [Color :: BrightCyan].

§Example
println!("{}", value.bright_cyan());
§

fn bright_white(&self) -> Painted<&T>

Returns self with the fg() set to [Color :: BrightWhite].

§Example
println!("{}", value.bright_white());
§

fn bg(&self, value: Color) -> Painted<&T>

Returns a styled value derived from self with the background set to value.

This method should be used rarely. Instead, prefer to use color-specific builder methods like on_red() and on_green(), which have the same functionality but are pithier.

§Example

Set background color to red using fg():

use yansi::{Paint, Color};

painted.bg(Color::Red);

Set background color to red using on_red().

use yansi::Paint;

painted.on_red();
§

fn on_primary(&self) -> Painted<&T>

Returns self with the bg() set to [Color :: Primary].

§Example
println!("{}", value.on_primary());
§

fn on_fixed(&self, color: u8) -> Painted<&T>

Returns self with the bg() set to [Color :: Fixed].

§Example
println!("{}", value.on_fixed(color));
§

fn on_rgb(&self, r: u8, g: u8, b: u8) -> Painted<&T>

Returns self with the bg() set to [Color :: Rgb].

§Example
println!("{}", value.on_rgb(r, g, b));
§

fn on_black(&self) -> Painted<&T>

Returns self with the bg() set to [Color :: Black].

§Example
println!("{}", value.on_black());
§

fn on_red(&self) -> Painted<&T>

Returns self with the bg() set to [Color :: Red].

§Example
println!("{}", value.on_red());
§

fn on_green(&self) -> Painted<&T>

Returns self with the bg() set to [Color :: Green].

§Example
println!("{}", value.on_green());
§

fn on_yellow(&self) -> Painted<&T>

Returns self with the bg() set to [Color :: Yellow].

§Example
println!("{}", value.on_yellow());
§

fn on_blue(&self) -> Painted<&T>

Returns self with the bg() set to [Color :: Blue].

§Example
println!("{}", value.on_blue());
§

fn on_magenta(&self) -> Painted<&T>

Returns self with the bg() set to [Color :: Magenta].

§Example
println!("{}", value.on_magenta());
§

fn on_cyan(&self) -> Painted<&T>

Returns self with the bg() set to [Color :: Cyan].

§Example
println!("{}", value.on_cyan());
§

fn on_white(&self) -> Painted<&T>

Returns self with the bg() set to [Color :: White].

§Example
println!("{}", value.on_white());
§

fn on_bright_black(&self) -> Painted<&T>

Returns self with the bg() set to [Color :: BrightBlack].

§Example
println!("{}", value.on_bright_black());
§

fn on_bright_red(&self) -> Painted<&T>

Returns self with the bg() set to [Color :: BrightRed].

§Example
println!("{}", value.on_bright_red());
§

fn on_bright_green(&self) -> Painted<&T>

Returns self with the bg() set to [Color :: BrightGreen].

§Example
println!("{}", value.on_bright_green());
§

fn on_bright_yellow(&self) -> Painted<&T>

Returns self with the bg() set to [Color :: BrightYellow].

§Example
println!("{}", value.on_bright_yellow());
§

fn on_bright_blue(&self) -> Painted<&T>

Returns self with the bg() set to [Color :: BrightBlue].

§Example
println!("{}", value.on_bright_blue());
§

fn on_bright_magenta(&self) -> Painted<&T>

Returns self with the bg() set to [Color :: BrightMagenta].

§Example
println!("{}", value.on_bright_magenta());
§

fn on_bright_cyan(&self) -> Painted<&T>

Returns self with the bg() set to [Color :: BrightCyan].

§Example
println!("{}", value.on_bright_cyan());
§

fn on_bright_white(&self) -> Painted<&T>

Returns self with the bg() set to [Color :: BrightWhite].

§Example
println!("{}", value.on_bright_white());
§

fn attr(&self, value: Attribute) -> Painted<&T>

Enables the styling [Attribute] value.

This method should be used rarely. Instead, prefer to use attribute-specific builder methods like bold() and underline(), which have the same functionality but are pithier.

§Example

Make text bold using attr():

use yansi::{Paint, Attribute};

painted.attr(Attribute::Bold);

Make text bold using using bold().

use yansi::Paint;

painted.bold();
§

fn bold(&self) -> Painted<&T>

Returns self with the attr() set to [Attribute :: Bold].

§Example
println!("{}", value.bold());
§

fn dim(&self) -> Painted<&T>

Returns self with the attr() set to [Attribute :: Dim].

§Example
println!("{}", value.dim());
§

fn italic(&self) -> Painted<&T>

Returns self with the attr() set to [Attribute :: Italic].

§Example
println!("{}", value.italic());
§

fn underline(&self) -> Painted<&T>

Returns self with the attr() set to [Attribute :: Underline].

§Example
println!("{}", value.underline());

Returns self with the attr() set to [Attribute :: Blink].

§Example
println!("{}", value.blink());

Returns self with the attr() set to [Attribute :: RapidBlink].

§Example
println!("{}", value.rapid_blink());
§

fn invert(&self) -> Painted<&T>

Returns self with the attr() set to [Attribute :: Invert].

§Example
println!("{}", value.invert());
§

fn conceal(&self) -> Painted<&T>

Returns self with the attr() set to [Attribute :: Conceal].

§Example
println!("{}", value.conceal());
§

fn strike(&self) -> Painted<&T>

Returns self with the attr() set to [Attribute :: Strike].

§Example
println!("{}", value.strike());
§

fn quirk(&self, value: Quirk) -> Painted<&T>

Enables the yansi [Quirk] value.

This method should be used rarely. Instead, prefer to use quirk-specific builder methods like mask() and wrap(), which have the same functionality but are pithier.

§Example

Enable wrapping using .quirk():

use yansi::{Paint, Quirk};

painted.quirk(Quirk::Wrap);

Enable wrapping using wrap().

use yansi::Paint;

painted.wrap();
§

fn mask(&self) -> Painted<&T>

Returns self with the quirk() set to [Quirk :: Mask].

§Example
println!("{}", value.mask());
§

fn wrap(&self) -> Painted<&T>

Returns self with the quirk() set to [Quirk :: Wrap].

§Example
println!("{}", value.wrap());
§

fn linger(&self) -> Painted<&T>

Returns self with the quirk() set to [Quirk :: Linger].

§Example
println!("{}", value.linger());
§

fn clear(&self) -> Painted<&T>

👎Deprecated since 1.0.1: renamed to resetting() due to conflicts with Vec::clear(). The clear() method will be removed in a future release.

Returns self with the quirk() set to [Quirk :: Clear].

§Example
println!("{}", value.clear());
§

fn resetting(&self) -> Painted<&T>

Returns self with the quirk() set to [Quirk :: Resetting].

§Example
println!("{}", value.resetting());
§

fn bright(&self) -> Painted<&T>

Returns self with the quirk() set to [Quirk :: Bright].

§Example
println!("{}", value.bright());
§

fn on_bright(&self) -> Painted<&T>

Returns self with the quirk() set to [Quirk :: OnBright].

§Example
println!("{}", value.on_bright());
§

fn whenever(&self, value: Condition) -> Painted<&T>

Conditionally enable styling based on whether the [Condition] value applies. Replaces any previous condition.

See the crate level docs for more details.

§Example

Enable styling painted only when both stdout and stderr are TTYs:

use yansi::{Paint, Condition};

painted.red().on_yellow().whenever(Condition::STDOUTERR_ARE_TTY);
§

fn new(self) -> Painted<Self>
where Self: Sized,

Create a new [Painted] with a default [Style]. Read more
§

fn paint<S>(&self, style: S) -> Painted<&Self>
where S: Into<Style>,

Apply a style wholesale to self. Any previous style is replaced. Read more
§

impl<T> Pointable for T

§

const ALIGN: usize

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

impl<T> PolicyExt for T
where T: ?Sized,

§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns [Action::Follow] only if self and other return Action::Follow. Read more
§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns [Action::Follow] if either self or other returns Action::Follow. Read more
§

impl<T, U> RoundingInto<U> for T
where U: RoundingFrom<T>,

§

fn rounding_into(self, rm: RoundingMode) -> (U, Ordering)

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
§

impl<T, U> SaturatingInto<U> for T
where U: SaturatingFrom<T>,

§

fn saturating_into(self) -> U

§

impl<T> ToDebugString for T
where T: Debug,

§

fn to_debug_string(&self) -> String

Returns the String produced by Ts Debug implementation.

§Examples
use malachite_base::strings::ToDebugString;

assert_eq!([1, 2, 3].to_debug_string(), "[1, 2, 3]");
assert_eq!(
    [vec![2, 3], vec![], vec![4]].to_debug_string(),
    "[[2, 3], [], [4]]"
);
assert_eq!(Some(5).to_debug_string(), "Some(5)");
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

impl<T, U> WrappingInto<U> for T
where U: WrappingFrom<T>,

§

fn wrapping_into(self) -> U

§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<T> ErasedDestructor for T
where T: 'static,

§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,