ctb_formats_dcstring/
dcstring.rs

1// SPDX-License-Identifier: AGPL-3.0-or-later
2/*
3This file is part of Collective Toolbox, a database and document workspace and utilities.
4Copyright (C) 2026 Collective Toolbox Developers
5Contact: info@collectivetoolbox.com
6
7This program is free software: you can redistribute it and/or modify it under
8the terms of the GNU Affero General Public License as published by the Free
9Software Foundation, either version 3 of the License, or (at your option) any
10later version.
11
12This program is distributed in the hope that it will be useful, but WITHOUT ANY
13WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
14A PARTICULAR PURPOSE.  See the GNU Affero General Public License for more details.
15
16You should have received a copy of the GNU Affero General Public License along
17with this program.  If not, see <https://www.gnu.org/licenses/>.
18*/
19
20//! Document Character String (`DcString`, `DcStr`), Document Character (`DcChar`), and
21//! related Document Character Text formats (`DcText`, `DcList`, `DcUtf`).
22
23#[allow(
24    unused_imports,
25    clippy::wildcard_imports,
26    reason = "Standard workspace crate prelude"
27)]
28pub(crate) use ctb_utilities::*;
29
30pub mod character_description;
31pub mod cli_identifiers;
32pub mod converters;
33pub mod dc_char;
34pub mod dc_mixed;
35pub mod dc_mixed_serde;
36pub mod dc_number;
37pub mod dc_source;
38pub mod dc_str;
39pub mod dc_writer;
40pub mod dcstring_impl;
41mod encapsulation;
42pub mod error;
43pub mod kv_map;
44pub mod navigator;
45pub mod shared;
46pub mod source_edit;
47
48pub use converters::dctext::DcList;
49pub use converters::transform::{
50    apply_dc_transformation, apply_dc_transformations,
51    apply_semantic_to_text_with_resolver,
52    transform_dclist_unicode_to_short_dc,
53};
54pub use converters::utf8::{
55    DcNormalizationMode, normalize_dclist_all, normalize_dcmstring_all,
56};
57pub use converters::wasm::{
58    CTB_RESUME_TARGET_OP_EXPORT, DC_WASM_MAILBOX_HEADER_LEN,
59    DC_WASM_MAILBOX_INPUT_LEN, DC_WASM_MAILBOX_INPUT_PTR,
60    DC_WASM_MAILBOX_MOST_RECENT_NODE_ID, DC_WASM_MAILBOX_OUTPUT_LEN,
61    DC_WASM_MAILBOX_OUTPUT_PTR, DEFAULT_MAX_WASM_CAPABILITY_PAYLOAD_BYTES,
62    DEFAULT_MAX_WASM_INSTRUCTIONS_PER_STEP, DEFAULT_MAX_WASM_MEMORY_PAGES,
63    DEFAULT_MAX_WASM_SESSION_OUTPUT_BYTES, DEFAULT_MAX_WASM_STEP_OUTPUT_BYTES,
64    DEFAULT_MAX_WASM_TABLE_ELEMENTS, DEFAULT_MAX_WASM_TRACE_BYTES,
65    DcWasmExecutionBackend, DcWasmResourceLimits, DcWasmSession,
66    DcWasmWatchdogLimits, InstrumentedWasmModule, SharedWasmTaskQuota,
67    SharedWasmTaskQuotaState, WASM_RESOURCE_ACCOUNTING_VERSION,
68    WasmResourceInterruption, WasmStartSectionTrap, WasmStepOutcome,
69    WasmStepStatus, instrument_wasm_module_bytes, run_dc_wasm_pure_conversion,
70    run_dc_wasm_pure_conversion_with_resolver,
71    run_graph_wasm_tokens_on_dc_slice,
72    run_graph_wasm_tokens_on_dc_slice_with_quota,
73};
74pub use converters::{
75    dcal, dctext, dcts, eite, transform, utf8, wasm, wat,
76    wat_to_dc_shorthand_string, wat_to_dc_shorthands, wat_to_dclist,
77    wat_to_dcmstring, wat_to_dcmstring_with_resolver, wat_to_dcstring,
78    wat_to_wasm, wat_to_wasm_with_resolver,
79};
80pub use ctb_dc_macro::DcMixed;
81pub use ctb_formats_dcdata::ctbnbdl::LedgerNode;
82pub use ctb_formats_dcdata::dc;
83pub use ctb_formats_dcdata::global_graph_layout;
84pub use ctb_formats_dcdata::seed_graph::{
85    SeedGraphIndex, TrustedSystemSupervisorResolution,
86};
87pub use ctb_formats_dcdata::shorthand::DcShorthand;
88pub use ctb_formats_dcdata::syntax::{self, DcRole, SyntaxRuleResolver};
89pub use ctb_formats_dcdata::{stagel_dc_alloc, stagel3};
90pub use ctb_formats_utilities::FormatLog;
91pub use dc_char::{DcChar, DcCharExt};
92pub use dc_mixed::{
93    DCMM_HEADER_LEN, DCMM_MAGIC, DCMM_UUID, DCMM_UUID_V1, DcMixed,
94    DcMixedChunk, DcMixedError, DcMixedOwned, DcMstSlice, DcMstr, DcMstring,
95    DcmmStreamOptions, dcmm_to_dcmstring, dcmm_to_dcmstring_with_options,
96    dcmm1_to_dcmstring, dcmm1_to_dcmstring_with_options, dcmm2_to_dcmstring,
97    dcmm2_to_dcmstring_with_options, dcmstring_to_dcmm, dcmstring_to_dcmm1,
98    dcmstring_to_dcmm2, validate_and_copy_dcmm_stream,
99    validate_and_copy_dcmm_stream_with_options, validate_dcmst,
100};
101pub use dc_mixed_serde::{
102    BinaryPayload, DcEpochTimestamp, DcMixedDecode, DcMixedEncode,
103    DcMixedFlattened, DcMixedNumber, DcProjectionContext, DcRawValue,
104    LazyBinaryPayload, LosslessWithContext, assert_dc_document_roundtrip,
105    assert_dc_roundtrip,
106};
107pub use dc_source::{
108    DcDiagnostic, DcFieldAnnotation, DcInspection, DcMixedFields, DcSource,
109};
110pub use dc_str::{
111    DcCharIndices, DcChars, DcStr, validate_dctf, validate_dcutf,
112};
113pub use dc_writer::{
114    DcBinaryReader, DcBinarySource, DcBinarySourceError, DcWriter,
115    validate_and_write_dc_record,
116};
117pub use dcstring_impl::DcString;
118pub use error::DcUtfError;
119pub use kv_map::DcKvMapEncoding;
120pub use malachite::{Integer, Natural};
121pub use navigator::{
122    BinaryPayloadRef, BootstrapKernelVersion,
123    DEFAULT_MAX_ENCAPSULATION_METADATA_DEPTH,
124    DEFAULT_MAX_ENCAPSULATION_PAYLOAD_BYTES, DEFAULT_MAX_PROJECTION_DEPTH,
125    DcBinaryResolver, DcByteSpan, DcDocumentNavigator, DcEvaluatedValue,
126    DcExpressionEvaluator, DcForgivingDefault, DcFrameHeaderInfo, DcFrameStub,
127    DcPinProvenance, DcProjectionPolicy, DcSyntaxArena, DcSyntaxKind,
128    DcSyntaxNode, DefaultDcExpressionEvaluator, DiagnosticAction,
129    INLINE_BINARY_THRESHOLD, MAX_SYNTAX_EXPANSION_DEPTH, NodeId,
130    SharedQuotaDcExpressionEvaluator, SyntaxEvalContext, SyntaxRuntimeResolver,
131    ValueRequirement, validate_dc_mixed_strict, validate_dc_str_strict,
132    validate_dc_tokens_strict,
133};
134pub use shared::{
135    SharedJson, SharedValueContext, decode_dc_identifier, decode_identifier,
136    encode_dc_identifier, encode_dc_identifier_to, encode_identifier,
137    encode_identifier_to,
138};