Skip to main content

Crate voxgig_struct

Crate voxgig_struct 

Source

Re-exports§

pub use value::Sentinel;
pub use value::Value;
pub use value::DELETE;
pub use value::SKIP;
pub use consts::M_KEYPOST;
pub use consts::M_KEYPRE;
pub use consts::M_VAL;
pub use consts::T_ANY;
pub use consts::T_BOOLEAN;
pub use consts::T_DECIMAL;
pub use consts::T_FUNCTION;
pub use consts::T_INSTANCE;
pub use consts::T_INTEGER;
pub use consts::T_LIST;
pub use consts::T_MAP;
pub use consts::T_NODE;
pub use consts::T_NOVAL;
pub use consts::T_NULL;
pub use consts::T_NUMBER;
pub use consts::T_SCALAR;
pub use consts::T_STRING;
pub use consts::T_SYMBOL;

Modules§

consts
ordered_map
re
value

Structs§

InjectDef
Public injdef argument — the subset of Partial<Injection> callers set.
Injection
JsonFlags
StructError
Error raised by transform / validate when no error collector was supplied (mirrors the TS throw new Error(errs.join(' | '))).
StructUtility
Bundle of all functions, mirroring the TS StructUtility class. Useful for the test harness (which looks subjects up by name).

Functions§

check_placement
clone
clone(val) — deep copy. Functions and sentinels are copied (not cloned).
del_prop
esc_re
escre(s) — escape regex metacharacters.
esc_url
escurl(s)encodeURIComponent.
filter
filter_vals
flatten
get_def
get_elem
getelem(list, key, alt?) — list lookup by integer key, negative counts from the end. If the element is absent and alt is a callable value, it is invoked (with the uniform (inj, val, ref, store) shape — a fresh throwaway injection, Noval value/store, empty ref) and its result used, mirroring the canonical alt() call.
get_elem_or_else
get_path
get_path_inj
Internal getpath working against a full Inj (used by the inject machinery and by the public get_path wrapper).
get_prop
getprop(node, key, alt?) — safe property lookup on a map or list.
has_key
inject
inject_child
injector_args
is_empty
is_func
is_key
is_list
is_map
is_node
items
jm
join
join_vals
join over an already-built Vec<Value>.
jsonify
jsonify(val, flags?) — strict JSON serialisation, default 2-space indent.
jt
keys_of
keysof_vec
keysof(node) — sorted keys of a map, or list indices as strings.
lookup
Internal raw lookup that PRESERVES a stored JSON null (Group B). Mirrors the canonical TS _lookup (StructUtility.ts:477): Group B callers — validate / transform commands / builders / inject internals — use this when they need the raw stored value at a slot regardless of whether it is null. The public get_prop / get_elem / has_key APIs treat null as absent (Group A) per UNDEF_SPEC.md. Returns Noval only when the key is genuinely absent.
merge
pad
pathify
re_compile
Compile a pattern. Mirrors re_compile(pattern).
re_escape
Alias of esc_re.
re_find
First match. Returns Some([whole, capture1, ...]) or None.
re_find_all
All non-overlapping matches.
re_replace
Replace every match. Supports $& (whole match) and $1..$9 (captures).
re_test
Boolean test.
select
set_path
set_prop
size
size(val) — length for lists/strings, key count for maps, integer part for numbers, 1/0 for booleans, 0 otherwise.
slice
slice(val, start?, end?, mutate?) — sub-section of a list, string, or bounded number. When val is a list and mutate is true, the list is truncated/shifted in place (and the same list value is returned).
str_key
strkey(key) — coerce a key to its canonical string form ("" if invalid).
stringify
stringify(val, maxlen?, pretty?) — compact, human-friendly string form.
transform
type_name
typename(t) — human name for a type bit-flag.
typify
typify(value) — type bit-code for a value.
validate
walk

Type Aliases§

Inj
Modify
Modify(val, key, parent, inj, store).
NativeFn
Injector(inj, val, ref, store) -> any.
WalkClosure
WalkApply(key, val, parent, path) -> any. key is Noval at the root and a Str for every descendant (matches the canonical, where items always yields string keys).