guidedoc¶
Guidedoc, the conversion engine of Guidedog: the document model, the builder readers and passes write through, validation, diagnostics, the adapter registry, and the pipeline that reads, transforms, and renders a document.
The engine imports no reader, renderer, operating system, or Typst crate. Every name is exported at the crate root, so adapters read guidedoc::begin_node-style names directly; docs/manual/internals/ast.rst is the normative node mapping.
use guidedoc::{convert_text, Registry, Workspace};
let mut ws = Workspace::new();
let registry = Registry::default(); // the defaults crate provides the real one
let failure = convert_text(&mut ws, ®istry, "commonmark", "html", "# Hi\n");
assert_eq!(failure.map_err(|f| f.code()), Err("core.reader.unknown"));
Structs
- pub struct guidedoc::ReadContext<'a>¶
-
What a reader works with for one read: the builder, the source being read, the options, and the source table it may add included sources to.
Fields
- pub options: &'a ReadOptions<'a>¶
-
The read options.
Implementations
- impl<'a> ReadContext<'a>
-
- pub fn take_scratch<T: Default + Send + 'static>(&mut self) -> T¶
-
Takes the reader’s working state of type
Tout of the workspace (seeScratch::take): what an earlier read left, orT::default(). Clear what you use and give it back withput_scratch, so the next read reuses its storage.
- pub fn put_scratch<T: Send + 'static>(&mut self, value: T)¶
-
Gives working state taken with
take_scratchback to the workspace.
- pub fn report(&mut self, m: Message, span: SourceSpan, a: Arg, b: Arg)¶
-
Reports message
matspan, filled with the argumentsaandb.
- pub fn source_of(&self, id: SourceId) -> SourceText<'a>¶
-
Returns the text of source
id, which the reader may keep while it builds; «» for an unknown id.
- pub fn source_entry(&self, id: SourceId) -> Option<&SourceEntry>¶
-
Returns the source-table entry of
id(its name, parent, and include span).
- pub fn source_count(&self) -> usize¶
-
Returns the number of sources in the table.
- pub fn source_text(&self, span: SourceSpan) -> &str¶
-
Returns the source text a span covers, or «» for an invalid span.
- impl ReadContext<'_>
-
- pub fn include_source(&mut self, from: SourceId, name: &str, span: SourceSpan, usage: SourceUse) -> Option<SourceId>¶
-
Asks the resource provider for
name, which a directive atspanin sourcefromnames, records it in the source table, and returns its id. Every refusal is reported atspanand givesNone; running out of sources poisons the builder.usagetells whether the reader parses the text or shows it as it is.
Trait Implementations
- impl fmt::Debug for ReadContext<'_>
-
- fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result
- pub struct guidedoc::Reader¶
-
A reader: a constant descriptor with functions and no state.
Fields
- pub id: &'static str¶
-
Registry id («rst»).
- pub name: &'static str¶
-
Display name.
- pub version: &'static str¶
-
Its version.
- pub conformance: Conformance¶
-
How complete it is.
- pub read_inline: Option<ReadInlineFn>¶
-
Reads inline content, when the reader offers it.
- pub struct guidedoc::Registry¶
-
The adapters a conversion may use. A plain value: build it once and share it.
Fields
Implementations
- impl Registry
- pub struct guidedoc::RenderContext<'a>¶
-
What a renderer works with for one render.
Fields
- pub options: &'a RenderOptions<'a>¶
-
The render options.
Implementations
- impl<'a> RenderContext<'a>
-
- pub fn new(doc: Document<'a>, out: Emitter<'a>, options: &'a RenderOptions<'a>, reports: &'a mut Reports) -> Self¶
-
Makes a context for rendering
docintoout; the engine makes one per render, and renderer tests may make their own.
- pub fn with_scratch(self, scratch: &'a mut Scratch) -> Self¶
-
Lets the context keep working state in
scratchbetween renders (the engine passes the workspace’s); a context made withnewalone keeps none.
- pub fn take_scratch<T: Default + Send + 'static>(&mut self) -> T¶
-
Takes the renderer’s working state of type
T(seeScratch::take): what an earlier render left, orT::default(). Clear what you use and give it back withput_scratch, so the next render reuses its storage.
- pub fn put_scratch<T: Send + 'static>(&mut self, value: T)¶
-
Gives working state taken with
take_scratchback; a context without a store drops it.
- pub fn report(&mut self, m: Message, span: SourceSpan, a: Arg, b: Arg)¶
-
Reports message
matspan.
Trait Implementations
- impl fmt::Debug for RenderContext<'_>
-
- fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result
- pub struct guidedoc::Renderer¶
-
A renderer: a constant descriptor with a function and no state.
Fields
- pub id: &'static str¶
-
Registry id («html»).
- pub name: &'static str¶
-
Display name.
- pub version: &'static str¶
-
Its version.
- pub media_type: &'static str¶
-
The media type it writes («text/html»).
- pub conformance: Conformance¶
-
How complete it is.
- pub struct guidedoc::AnchorExtra¶
-
The id of an element a renderer generates for a node:
- an entry of a table of contents:
owneris the Contents,itemthe Section; - a footnote of target-notes:
owneris the directive,itemthe first target (or anonymous reference) with the URI it lists,numberits footnote number; - the footnote reference target-notes adds after a reference:
owneris the reference,itemthe directive,notethe item of its footnote,numberthe same.
Fields
- pub span: u32¶
-
Its id’s row in the table (
extra_text).
- pub number: i32¶
-
Its footnote number.
- an entry of a table of contents:
- pub struct guidedoc::AnchorIds<'a>¶
-
The ids of one node, primary first;
Anchors::anchor_idsmakes it.Trait Implementations
- pub struct guidedoc::Anchors¶
-
The anchor table of one document. Build it with
build_anchors, or rebuild one withbuild_anchors_intoto reuse its storage.Implementations
- impl Anchors
-
- pub fn anchor_of(&self, id: NodeId) -> Option<&str>¶
-
Returns the primary id of node
id, borrowed from the table.
- pub fn anchor_ids(&self, id: NodeId) -> AnchorIds<'_>¶
-
Iterates every id of node
id, the primary one first.
- pub fn anchor_extras(&self, owner: NodeId) -> &[AnchorExtra]¶
-
Returns the ids generated for
owner’s sake, in the order they were given.
- pub fn extra_anchor(&self, owner: NodeId, item: NodeId) -> Option<&str>¶
-
Returns the id of the element generated for
owneranditem.
- pub fn extras(&self) -> &[AnchorExtra]¶
-
Returns every generated element’s id record, sorted by owner and, for one owner, in the order the ids were given.
- pub fn node_with_anchor(&self, anchor: &str) -> Option<NodeId>¶
-
Returns the node that carries the id
anchor(with the anchor prefix, asanchor_idsgives it);Nonewhen no node carries it.
- pub fn write_anchor_key(&self, out: &mut String, name: &str) -> bool¶
-
Writes into
outthe idbuild_anchorsderives fromname(the anchor prefix, thenmake_id), fornode_with_anchor. Returns false, leavingoutcleared, when the name gives no id.
- pub fn extra_text(&self, e: &AnchorExtra) -> &str¶
-
Returns the id of a generated element.
- pub struct guidedoc::Builder<'a>¶
-
Builds one snapshot for one stage (a read or a pass). It borrows the snapshot, the workspace’s reports, and a reusable open-node stack for the stage.
Fields
- pub snap: &'a mut Snapshot¶
-
The snapshot being built. Readers may read it freely and edit what the builder has no method for; validation checks the result.
Implementations
- impl<'a> Builder<'a>
-
- pub fn new(snap: &'a mut Snapshot, reports: &'a mut Reports, open: &'a mut Vec<NodeId>, limits: Limits, root_span: SourceSpan) -> Builder<'a>¶
-
Starts a builder over
snap, which it clears, and opens the root Document node atroot_span.openis reusable storage for the open-node stack. The engine calls it for every read and pass; tests use it to drive a reader’s pieces. A failure to open the root poisons the builder (seestatus).
- pub fn set_cancel(&mut self, cancel: Option<&'a dyn Fn() -> bool>)¶
-
Sets the probe polled while work is spent; true cancels the stage.
- pub fn is_ok(&self) -> bool¶
-
Tells whether the builder has not failed.
- pub fn need(&self) -> CapacityNeed¶
-
Returns the capacity a
Capacityfailure lacked.
- pub fn work(&self) -> u64¶
-
Returns the work spent so far.
- pub fn report(&mut self, m: Message, span: SourceSpan, a: Arg, b: Arg)¶
-
Reports message
matspanwithout failing.
- pub fn fail(&mut self, d: Diagnostic) -> Fail¶
-
Reports
dand poisons the builder with its status (the first failure wins); returns the failure to propagate.
- pub fn capacity(&mut self, region: Region, minimum: u64) -> Fail¶
-
Poisons the builder with a
Capacityfailure ofregion, lackingminimum; nothing new is reported once it has failed.
- pub fn spend(&mut self, steps: u64) -> Result<(), Fail>¶
-
Charges
stepsof work againstLimits::max_workand polls cancellation periodically.
- pub fn current(&self) -> Option<NodeId>¶
-
Returns the innermost open node;
Noneonce the root is closed.
- pub fn current_kind(&self) -> NodeKind¶
-
Returns the kind of the innermost open node; Document when none is open.
- pub fn begin_node(&mut self, kind: NodeKind, span: SourceSpan) -> Result<NodeId, Fail>¶
-
Opens a node of
kindas the last child of the current node, to be closed withend_node. It fails, poisoning the builder, when the nesting is illegal (child_allowed), a limit is reached, or memory runs out.
- pub fn end_node(&mut self, id: NodeId) -> Result<(), Fail>¶
-
Closes
id, which must be the innermost open node, and records its subtree end; closing out of order poisons the builder.
- pub fn with_node(&mut self, kind: NodeKind, span: SourceSpan, fill: impl FnOnce(&mut Self, NodeId) -> Result<(), Fail>) -> Result<NodeId, Fail>¶
-
Opens a node of
kind, runsfillto add its attributes and children, and closes it:begin_nodeandend_nodein one call that cannot forget the end.
- pub fn build_text(&mut self, push: impl FnOnce(&mut Self) -> Result<(), Fail>) -> Result<Text, Fail>¶
-
Runs
push, which writes into the text pool, and returns the text it wrote:text_open, the pushes, andtext_closein one call.
- pub fn add_leaf(&mut self, kind: NodeKind, span: SourceSpan, text: Text) -> Result<NodeId, Fail>¶
-
Adds a closed node of
kindwith pool texttextand no children.
- pub fn add_text_leaf(&mut self, kind: NodeKind, span: SourceSpan, s: &str) -> Result<NodeId, Fail>¶
-
Copies
sinto the pool and adds a leaf holding it.
- pub fn add_text(&mut self, s: &str) -> Result<Text, Fail>¶
-
Copies
sinto the text pool and returns where it is.
- pub fn text_open(&self) -> u32¶
-
Starts a run of pushed text: the offset
text_closemeasures from.
- pub fn text_used(&self) -> usize¶
-
Returns the bytes in the pool.
- pub fn text_push_bytes(&mut self, bytes: &[u8]) -> Result<(), Fail>¶
-
Copies raw bytes into the text pool; a run must end on a character boundary before the snapshot is validated.
- pub fn text_push_char(&mut self, c: char) -> Result<(), Fail>¶
-
Copies
c, UTF-8 encoded, into the text pool.
- pub fn text_close(&self, start: u32) -> Text¶
-
Returns the text pushed since
start(text_open); empty once failed.
- pub fn text_rewind(&mut self, start: u32)¶
-
Drops text pushed since
start; used when a tentative parse is abandoned.
- pub fn pool_string(&self, t: Text) -> &str¶
-
Returns the text
tof the pool; «» when out of range or not UTF-8.
- pub fn set_text(&mut self, id: NodeId, t: Text)¶
-
Sets the text of node
id; nothing happens once failed.
- pub fn set_value(&mut self, id: NodeId, v: i32)¶
-
Sets the value of node
id(a level, a count); nothing happens once failed.
- pub fn add_flags(&mut self, id: NodeId, f: NodeFlags)¶
-
Adds flags to node
id; nothing happens once failed.
- pub fn set_span_end(&mut self, id: NodeId, end: u32)¶
-
Moves the end of node
id’s span, as a reader learns where a construct ends.
- pub fn set_kind(&mut self, id: NodeId, k: NodeKind)¶
-
Changes the kind of node
id, as a pass does to a copy; validation checks it.
- pub fn add_attribute(&mut self, id: NodeId, key: AttributeKey, value: Text) -> Result<(), Fail>¶
-
Adds an attribute to node
id, which must be the most recently begun node, so each node’s attributes stay contiguous.
- pub fn add_attribute_named(&mut self, id: NodeId, key: AttributeKey, value: Text, name: Text) -> Result<(), Fail>¶
-
Adds an attribute whose Custom key is the pool text
name.
- pub fn add_attribute_string(&mut self, id: NodeId, key: AttributeKey, value: &str) -> Result<(), Fail>¶
-
Copies
valueinto the pool and adds it as attributekeyof nodeid.
- pub fn add_custom_attribute(&mut self, id: NodeId, name: &str, value: &str) -> Result<(), Fail>¶
-
Copies
nameandvalueinto the pool and adds them as a Custom attribute.
- pub fn set_list(&mut self, id: NodeId, info: ListInfo) -> Result<(), Fail>¶
-
Stores
infoas nodeid’s list payload.
- pub fn set_link(&mut self, id: NodeId, info: LinkInfo) -> Result<u32, Fail>¶
-
Stores
infoas nodeid’s link payload and returns its row, forresolve_link.
- pub fn set_cell(&mut self, id: NodeId, info: CellInfo) -> Result<(), Fail>¶
-
Stores
infoas nodeid’s cell payload.
- pub fn resolve_link(&mut self, row: u32, target: NodeId, kind: LinkKind, destination: Text)¶
-
Records the resolution of link row
row(fromset_link): its target, kind, and, when not empty, a new destination.
- pub fn finish(&mut self) -> Result<(), Fail>¶
-
Closes the root. Every other node must already be closed.
- pub fn unwrap_node(&mut self, id: NodeId) -> Result<(), Fail>¶
-
Removes a closed, non-root node and keeps its descendants in place, as when an RST section becomes the document title. Links resolved to later nodes follow them.
- pub fn copy_subtree(&mut self, doc: Document<'_>, id: NodeId) -> Result<NodeId, Fail>¶
-
Copies a node of
docand its descendants, with their text, attributes, and payload rows, as the last child of the current node, and returns the copy ofid. Copies are appended one per node, so the copy of a descendantdiscopy + (d - id): a pass adjusts copies withset_value,set_text,add_flags, andset_kind.
Trait Implementations
- impl fmt::Debug for Builder<'_>
-
- fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result
- pub struct guidedoc::Children<'a>¶
-
The children of a node, in order;
Document::childrenmakes it.Trait Implementations
- pub struct guidedoc::Document<'a>¶
-
A read-only view of one document and its sources. It is
Copy; pass it by value.Implementations
- impl<'a> Document<'a>
-
- pub fn from_snapshot(snap: &'a Snapshot) -> Self¶
-
Views a snapshot without sources, such as the one a builder is filling (
Builder::document); source accessors then return nothing.
- pub fn node_count(&self) -> usize¶
-
Returns the number of nodes, the root included.
- pub fn subtree_end(&self, id: NodeId) -> NodeId¶
-
Returns the id after the last descendant of node
id.
- pub fn code_caption(&self, id: NodeId) -> Option<NodeId>¶
-
Returns a code block’s Caption child (its parsed Custom
caption).
- pub fn child_count(&self, id: NodeId) -> usize¶
-
Counts the children of node
id, in time linear in their number.
- pub fn parent_of(&self, id: NodeId) -> Option<NodeId>¶
-
Returns the parent of node
id;Nonefor the root. It scans backwards, so it is meant for diagnostics, not traversal.
- pub fn attribute(&self, id: NodeId, key: AttributeKey) -> Option<&'a str>¶
-
Returns the value of node
id’s first attribute withkey.
- pub fn custom_attribute(&self, id: NodeId, name: &str) -> Option<&'a str>¶
-
Returns the value of node
id’s Custom attribute namedname.
- pub fn has_class(&self, id: NodeId, class: &str) -> bool¶
-
Tells whether one of node
id’s Class attributes (each a space-separated list) holdsclass.
- pub fn list_info(&self, id: NodeId) -> ListInfo¶
-
Returns the list payload of node
id, or a bullet list starting at 1.
- pub fn link_info(&self, id: NodeId) -> Option<LinkInfo>¶
-
Returns the link payload of node
id, orNonewhen it has none. Callers that treat a missing payload as unresolved writedoc.link_info(id).unwrap_or(LinkInfo::UNRESOLVED).
- pub fn cell_info(&self, id: NodeId) -> CellInfo¶
-
Returns the cell payload of node
id, or a cell spanning one row and column.
- pub fn sources(&self) -> &'a [SourceEntry]¶
-
Returns every source-table entry; 0 is the main source.
- pub fn source_entry(&self, id: SourceId) -> Option<&'a SourceEntry>¶
-
Returns the source-table entry of
id, orNonefor an unknown id.
- pub fn source_str(&self, id: SourceId) -> &'a str¶
-
Returns the whole text of source
id; «» for an unknown id.
- pub fn source_text(&self, span: SourceSpan) -> &'a str¶
-
Returns the source text a span covers, or «» for an invalid span.
- pub struct guidedoc::Emitter<'a>¶
-
A renderer’s output sink. The output is bytes so a renderer may copy text byte by byte; the engine checks the whole output is UTF-8 before returning it.
Implementations
- impl<'a> Emitter<'a>
-
- pub fn new(out: &'a mut Vec<u8>) -> Emitter<'a>¶
-
Makes a write-mode emitter appending to
out, without a limit. Renderers and tests use it for side outputs (a dump, a highlighted fragment).
- pub fn with_limit(out: &'a mut Vec<u8>, limit: usize) -> Emitter<'a>¶
-
Makes a write-mode emitter that stores at most
limitbytes and counts the rest.
- pub fn set_source_map(&mut self, map: Option<&'a mut Vec<MapEntry>>)¶
-
Records source map entries into
map(seeemit_mark).
- pub fn is_check(&self) -> bool¶
-
Tells whether this emitter only counts.
- pub fn written(&self) -> usize¶
-
Returns the bytes written (stored or counted).
- pub fn mapped(&self) -> usize¶
-
Returns the source map entries recorded.
- pub fn emit_bytes(&mut self, bytes: &[u8])¶
-
Writes raw bytes.
- pub fn written_since(&self, from: usize) -> &[u8]¶
-
The bytes stored since the output was
frombytes long (awrittenvalue); empty in check mode or past the limit.
- pub fn insert_bytes(&mut self, at: usize, bytes: &[u8])¶
-
Inserts
byteswhere the output wasatbytes long (awrittenvalue at or after which everything is still stored), moving what follows. Renderers use it to add an attribute to a tag they already wrote. Counts only, like every write, in check mode or past the limit.
- pub fn emit(&mut self, s: &str)¶
-
Writes
s.
- pub fn emit_byte(&mut self, c: u8)¶
-
Writes one byte.
- pub fn emit_char(&mut self, c: char)¶
-
Writes
cUTF-8 encoded.
- pub fn emit_int(&mut self, value: i64)¶
-
Writes
valuein decimal.
- pub fn emit_mark(&mut self, span: SourceSpan)¶
-
Records that output from here on originates at
span.
Trait Implementations
- impl fmt::Debug for Emitter<'_>
-
- fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result
- pub struct guidedoc::MathCheck<'a>¶
-
How a formula is checked.
Defaultchecks inline math with no host macros.Fields
- pub alignment: bool¶
-
&and\\are allowed outside an environment, because the renderer wraps the formula in an alignment (displayed math with line breaks).
- pub line_breaks: bool¶
-
\\alone is allowed outside an environment (displayed math).
- pub macros: &'a [&'a str]¶
-
Commands the host defines, without the backslash (MathJax
macros).
- pub struct guidedoc::MathChecker¶
-
Checks the formulas of one document. It remembers the commands and environments the formulas define, since a definition holds for the rest of the page.
Implementations
- impl MathChecker
-
- pub fn new() -> MathChecker¶
-
Makes a checker that knows no definition yet.
- pub fn check(&mut self, latex: &str, options: &MathCheck<'_>) -> Option<MathFault>¶
-
Returns the first fault of
latex, or None when it has none or is longer thanMAX_FORMULA_BYTES. Definitions inlatexare remembered.
- pub struct guidedoc::MathFault¶
-
The first fault of a formula.
Fields
- pub start: usize¶
-
The offending text starts at this byte of the formula.
- pub end: usize¶
-
One past its last byte.
Implementations
- impl MathFault
-
- pub fn diagnostic(&self, span: SourceSpan) -> Diagnostic¶
-
The fault as a diagnostic at
span.
- pub struct guidedoc::MathMlDropped¶
-
What the filter left out of a formula it wrote.
Fields
- pub count: usize¶
-
How many elements, attributes and declarations were dropped.
- pub struct guidedoc::MathMlOptions<'a>¶
-
How the filter treats one formula.
Defaultkeeps thedisplayattribute as it is written and counts every dropped attribute.Fields
- pub block: Option<bool>¶
-
Some(true)writesdisplay="block"on the root,Some(false)writes none, whatever the input says;Nonekeeps the input’s.
- pub quiet_attributes: &'a [&'a str]¶
-
Attributes dropped without being counted (
xmlnsalways is).
- pub quiet_elements: &'a [&'a str]¶
-
Elements dropped, with all they contain, without being counted.
- pub struct guidedoc::NameMap<V>¶
-
A map from
&strnames to valuesV, iterated in insertion order. Clearing it keeps its storage. Names are hashed with the standard library’s randomly keyed hasher, which resists collision attacks from hostile input.Implementations
- impl<V> NameMap<V>
-
- pub fn new() -> Self¶
-
Makes an empty map; it allocates nothing until a name is inserted.
- pub fn clear(&mut self)¶
-
Removes every entry, keeping the storage for the next names.
- pub fn len(&self) -> usize¶
-
Returns the number of entries.
- pub fn is_empty(&self) -> bool¶
-
Tells whether the map has no entry.
- pub fn contains_key(&self, name: &str) -> bool¶
-
Tells whether
namehas an entry.
- pub fn insert(&mut self, name: &str, value: V) -> Option<V>¶
-
Sets the value of
nameand returns the value it replaces, if any.
- pub fn get_or_insert_with(&mut self, name: &str, make: impl FnOnce() -> V) -> &mut V¶
-
Returns the value of
name, insertingmake()first when it has none.
- pub fn iter(&self) -> impl Iterator<Item = (&str, &V)> + '_¶
-
Iterates the entries in insertion order.
- pub fn values(&self) -> impl Iterator<Item = &V> + '_¶
-
Iterates the values in insertion order.
Trait Implementations
- impl<V: fmt::Debug> fmt::Debug for NameMap<V>
-
- fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result
- pub struct guidedoc::Labels¶
-
Translated labels; a label without a translation falls back to English.
Implementations
- impl Labels
Trait Implementations
- pub struct guidedoc::Limits¶
-
Bounds on the work and memory of one conversion. Reaching one is a
LimitorCapacityresult, never a panic.Defaultgivesdefault_limits().Fields
- pub max_depth: usize¶
-
Nested blocks and inline markup.
- pub max_nodes: usize¶
-
Nodes in one document.
- pub max_work: u64¶
-
Reader and resolution steps (
Builder::spend).
- pub max_include_depth: usize¶
-
Nested includes.
- pub max_included_bytes: usize¶
-
Bytes of included sources in one conversion.
- pub max_expansion: usize¶
-
Substitution nesting.
- pub stack_bytes: usize¶
-
Machine stack a recursive reader or renderer may use (
StackGuard).
- pub max_text_bytes: usize¶
-
Bytes in a snapshot’s text pool.
- pub max_reports: usize¶
-
Diagnostics stored; later ones are counted as suppressed.
- pub max_output_bytes: usize¶
-
Bytes of rendered output.
Trait Implementations
- pub struct guidedoc::MapEntry¶
-
Records that rendered output from
offseton came fromspan.Fields
- pub offset: u32¶
-
Byte offset in the output.
- pub span: SourceSpan¶
-
Where it came from.
- pub struct guidedoc::Pass<'a>¶
-
A named transform run between reading and rendering (
transform_document).Fields
- pub name: &'a str¶
-
Its name, for diagnostics.
Trait Implementations
- impl fmt::Debug for Pass<'_>
-
- fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result
- pub struct guidedoc::Policy¶
-
Trust decisions of one conversion.
Defaultgivesdefault_policy().Fields
- pub raw: ContentPolicy¶
-
Raw HTML, raw Typst, raw LaTeX.
- pub unsafe_urls: ContentPolicy¶
-
javascript:,vbscript:, and non-imagedata:URLs.
- pub math: ContentPolicy¶
-
Math the target cannot translate.
- pub includes: bool¶
-
Whether include directives may request resources.
- pub strict: bool¶
-
Warnings fail the conversion.
- pub keep_documents_with_errors: bool¶
-
Keep a document whose errors are all content errors (
content_error), as Docutils does below its halt level; renderers then report them as warnings.
Trait Implementations
- pub struct guidedoc::ReadExtension<'a>¶
-
A reader’s own settings (an
rst::Settings, acommonmark::Settings, …): a borrowed value and its type name.read_extensionmakes one; a reader takes it back withReadContext::reader_settings, which refuses settings of another type.Fields
- pub data: &'a dyn Any¶
-
The settings.
- pub type_name: &'static str¶
-
Their type’s name, for diagnostics.
Implementations
- impl<'a> ReadExtension<'a>
Trait Implementations
- impl fmt::Debug for ReadExtension<'_>
-
- fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result
- pub struct guidedoc::ReadOptions<'a>¶
-
Options every reader understands.
Defaultgivesdefault_read_options().Fields
- pub promote_title: bool¶
-
RST: a lone top-level section becomes the title.
- pub tab_width: usize¶
-
RST tab stops; zero means 8.
- pub today: &'a str¶
-
RST date substitutions, e.g. «2026-09-29».
- pub extension: Option<ReadExtension<'a>>¶
-
The reader’s own settings;
Nonemeans its defaults.
- pub check_math: bool¶
-
Check every LaTeX formula once after reading and warn about its first fault (
math.*), whatever the output is.
- pub math_macros: &'a [&'a str]¶
-
Math commands the host defines, without the backslash (MathJax
macros); the math check takes them as known.
Trait Implementations
- impl Default for ReadOptions<'_>
-
- fn default() -> Self
- pub struct guidedoc::RenderOptions<'a>¶
-
Options every renderer understands.
Defaultis a standalone document in English.Fields
- pub standalone: bool¶
-
A complete document rather than a body fragment.
- pub reference_profile: bool¶
-
CommonMark reference HTML, for conformance tests.
- pub title: &'a str¶
-
Overrides the document’s own title.
- pub language: &'a str¶
-
BCP 47 tag; «en» when empty.
- pub stylesheet: &'a str¶
-
Standalone HTML: CSS emitted in a style element.
- pub section_numbers: bool¶
-
Number sections.
- pub anchor_prefix: &'a str¶
-
Prepended to every anchor, e.g. a document ID in a book (
build_anchors).
- pub permalinks: bool¶
-
HTML: a link to each heading, caption, and signature.
- pub permalink_icon: &'a str¶
-
«¶» when empty.
- pub secnumber_suffix: &'a str¶
-
After section numbers; «. « when empty.
- pub highlighter: Option<&'a dyn Highlighter>¶
-
Highlights code blocks;
Nonewrites escaped code.
- pub math_inline: [&'a str; 2]¶
-
HTML inline math delimiters with
MathStyle::Sphinx; empty:\(\).
- pub math_display: [&'a str; 2]¶
-
HTML displayed math delimiters with
MathStyle::Sphinx; empty:\[\].
- pub math_writer: Option<&'a dyn MathWriter>¶
-
HTML: writes each formula as script-free markup (MathML);
None, or a formula it refuses, writes the LaTeX asmathsays.
- pub source_positions: Option<SourcePositions<'a>>¶
-
Preview source positions (see
SourcePositions): HTML block elements carrydata-gd-source="<source>:<start>-<end>", and Typst writes each block’s position as labelled metadata, so a preview maps a click back to the source.Nonewrites no positions.
Trait Implementations
- impl fmt::Debug for RenderOptions<'_>
-
- fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result
- impl Default for RenderOptions<'_>
-
- fn default() -> Self
- pub struct guidedoc::Request<'a>¶
-
A complete conversion request.
Default(anddefault_request) give the documented defaults; change fields with struct-update syntax.Fields
- pub reader: &'a str¶
-
The reader’s id («rst»).
- pub renderer: &'a str¶
-
The renderer’s id («html»).
- pub read: ReadOptions<'a>¶
-
Read options.
- pub render: RenderOptions<'a>¶
-
Render options.
- pub resources: Option<&'a dyn ResourceProvider>¶
-
Provides included files;
Nonerefuses includes.
- pub source_map: bool¶
-
Whether renderers fill the workspace’s source map.
Trait Implementations
- impl fmt::Debug for Request<'_>
-
- fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result
- pub struct guidedoc::Resource¶
-
A provided resource: its text, shared so a host can cache it, and a canonical name for cycle checks (usually an absolute path).
Fields
- pub text: Arc<str>¶
-
UTF-8 text.
- pub struct guidedoc::Source<'a>¶
-
A named source text, borrowed for the conversion.
Fields
- pub name: &'a str¶
-
Its name («intro.rst»).
- pub text: &'a str¶
-
Its text.
- pub struct guidedoc::PositionCache¶
-
Remembers each source’s offset, so a page asks
SourcePositions::offsetonce per source rather than once per block.Implementations
- impl PositionCache
-
- pub fn position(&mut self, doc: &Document<'_>, span: SourceSpan, positions: &SourcePositions<'_>) -> Option<String>¶
-
The position of
spanindocas<source>:<start>-<end>, with the source named relative topositions.root.Nonefor an empty span and for text a reader generated rather than read from a file, whose source name is empty or starts with<(such as<rst_epilog>or<autodoc mod.Obj>).
- pub struct guidedoc::SourcePositions<'a>¶
-
How a preview writes block source positions.
Fields
- pub root: &'a str¶
-
The folder source names are written relative to (a project’s source folder); empty: names as read.
- pub struct guidedoc::Diagnostic¶
-
One reported problem: a message, where it happened, and its arguments.
Fields
- pub code: &'static str¶
-
Stable identifier.
- pub title: &'static str¶
-
Upper-case title.
- pub message: &'static str¶
-
Explanation template.
- pub hint: &'static str¶
-
How to fix it.
- pub span: SourceSpan¶
-
Where it happened (zero when nowhere in particular).
Implementations
- impl Diagnostic
-
- pub fn format_into(&self, template: &str, quote: &dyn Fn(SourceSpan) -> String, out: &mut String)¶
-
Writes
template(the message or the hint) with its arguments substituted intoout;quotegives the source text of a span argument.
Trait Implementations
- impl fmt::Display for Diagnostic
-
- fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result
- pub struct guidedoc::Fail¶
-
The failure of a core call: a status, the capacity it lacked (for
Capacity), and the diagnostic that explains it. Readers and passes propagate it with?.Fields
- pub need: CapacityNeed¶
-
On
Capacity, the region to enlarge.
- pub diagnostic: Box<Diagnostic>¶
-
The primary diagnostic (boxed to keep
Results small).
Implementations
- impl Fail
-
- pub fn from_diagnostic(d: Diagnostic) -> Fail¶
-
Makes a failure explained by
d, with its status.
- pub fn capacity(region: Region, minimum: u64, exact: bool) -> Fail¶
-
Makes a
Capacityfailure forregion, lackingminimum(CORE_CAPACITY).
- pub fn code(&self) -> &'static str¶
-
Returns the diagnostic’s code («core.capacity»); «» when it has none.
Trait Implementations
- impl fmt::Display for Fail
-
- fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result
- impl std::error::Error for Fail
- pub struct guidedoc::Message¶
-
A static description of one problem. Packages declare them as constants:
const UNRESOLVED: Message = Message { code: "rst.reference.unresolved", .. }. Every message has a hint saying how to fix the problem (Elm style).Fields
- pub code: &'static str¶
-
Stable identifier («core.capacity»).
- pub title: &'static str¶
-
Upper-case title («NOT ENOUGH STORAGE»).
- pub message: &'static str¶
-
Explanation; «{0}» and «{1}» name the arguments.
- pub hint: &'static str¶
-
How to fix it.
- pub struct guidedoc::Reports¶
-
The bounded report store of a workspace: every diagnostic in order up to
Limits::max_reports, the first error kept by value even when the store is full, and counts of errors and warnings.Implementations
- impl Reports
-
- pub fn clear(&mut self, max: usize)¶
-
Empties the store, keeping its storage, and sets its bound.
- pub fn report(&mut self, d: Diagnostic)¶
-
Records
d, unless muted. The first error is kept as the primary even when the store is full; a full store counts the diagnostic as suppressed.
- pub fn message(&mut self, m: Message, span: SourceSpan, a: Arg, b: Arg)¶
-
Reports message
matspanwith its arguments, asreportdoes.
- pub fn items(&self) -> &[Diagnostic]¶
-
Returns every stored diagnostic, in order.
- pub fn primary(&self) -> Option<&Diagnostic>¶
-
Returns the first error, if any.
- pub fn first_problem(&self) -> Option<&Diagnostic>¶
-
Returns the primary error, or the first warning when there is none.
- pub fn error_count(&self) -> usize¶
-
Returns the number of errors reported (stored or not).
- pub fn warning_count(&self) -> usize¶
-
Returns the number of warnings reported (stored or not).
- pub fn suppressed_count(&self) -> usize¶
-
Returns how many diagnostics a full store dropped.
- pub fn is_truncated(&self) -> bool¶
-
Tells whether the store dropped diagnostics.
- pub fn is_muted(&self) -> bool¶
-
Tells whether reporting is muted (a trial parse).
- pub fn set_muted(&mut self, muted: bool) -> bool¶
-
Mutes or unmutes reporting; returns the previous setting, to restore.
- pub struct guidedoc::Scratch¶
-
A store of reusable working state: for each Rust type, a pool of values that earlier conversions gave back. The workspace owns one; adapters reach it through
ReadContext::take_scratchandRenderContext::take_scratch(and the matchingput_scratch).Taking a value out moves it, so it borrows nothing and the adapter keeps using its context freely. Nested conversions (a directive body parsed by the same reader) take further values of the same type; every value given back is kept, so each nesting level finds one next time. Once a type’s pool exists, taking and putting back do not allocate.
Implementations
- impl Scratch
-
- pub fn take<T: Default + Send + 'static>(&mut self) -> T¶
-
Takes a value of type
Tout of the store: one an earlier conversion gave back, orT::default()when there is none (the first conversion, or a nested one while outer ones hold the values). The value keeps whatever its last user left in it: clear what you use, keeping the capacity.
- pub fn put<T: Send + 'static>(&mut self, value: T)¶
-
Gives
valueback for a later conversion to take.
- pub fn len(&self) -> usize¶
-
Returns the number of types the store keeps values of.
- pub fn is_empty(&self) -> bool¶
-
Tells whether the store keeps values of no type.
- pub fn release(&mut self)¶
-
Drops every stored value, releasing its memory.
Trait Implementations
- impl fmt::Debug for Scratch
-
- fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result
- pub struct guidedoc::Snapshot¶
-
The tables of one document. Readers and passes fill them through a
Builder; itssnapfield gives direct access for the few edits the builder has no method for.Fields
- pub text: Vec<u8>¶
-
The text pool. Bytes, so a reader can copy a source byte by byte; validation checks the pool is UTF-8 and every
Textlies on character boundaries.
Implementations
- pub struct guidedoc::SourceEntry¶
-
One entry of a workspace’s source table. The main source’s text lives in the workspace (reused between conversions); included and added sources share theirs.
Fields
- pub included_at: SourceSpan¶
-
The include directive, when included.
- pub struct guidedoc::StackGuard¶
-
Measures stack use from where it was made. A zero guard is never exhausted.
Implementations
- impl StackGuard
-
- pub fn used(&self) -> usize¶
-
Returns the stack used between the guard’s start and the caller’s frame.
- pub fn is_exhausted(&self) -> bool¶
-
Tells whether the next frame would take the stack past the budget.
- pub fn limit(&self) -> usize¶
-
Returns the budget in bytes.
- pub fn diagnostic(&self, span: SourceSpan) -> Diagnostic¶
-
Returns the
Limitdiagnostic a guarded recursion reports atspan.
- pub struct guidedoc::SymbolTable¶
-
A bounded map from names to
u32values.Implementations
- impl SymbolTable
-
- pub fn with_capacity(capacity: usize) -> SymbolTable¶
-
Makes a table for about
capacitynames. It holds at least 8 and roundscapacityup to a power of two, so the bound a caller sees is predictable.
- pub fn insert(&mut self, key: &str, value: u32) -> Result<(), SymbolClash>¶
-
Inserts
keywithvalue. A duplicate or a full table leaves the table as it is.
- pub fn set(&mut self, key: &str, value: u32) -> bool¶
-
Replaces the value of an existing key; false when it is absent.
- pub fn count(&self) -> usize¶
-
Returns the number of names held.
- pub fn clear(&mut self)¶
-
Empties the table, keeping its storage.
- pub struct guidedoc::Attribute¶
-
One attribute row.
Fields
- pub key: AttributeKey¶
-
The key.
- pub struct guidedoc::AttributeRange¶
-
A node’s attributes: rows
first..first + countof the attribute table.Fields
- pub first: u32¶
-
First attribute row.
- pub count: u32¶
-
Number of rows.
Implementations
- impl AttributeRange
-
- pub const fn range(self) -> std::ops::Range<usize>¶
-
Returns the rows as a range of indices.
- pub struct guidedoc::CapacityNeed¶
-
What a
Capacityfailure needs: the region and the bytes or rows it lacked.Fields
- pub minimum: u64¶
-
The least size that is needed (or the shortfall, when not exact).
- pub exact: bool¶
-
Whether
minimumis the exact size needed.
- pub struct guidedoc::CellInfo¶
-
A Cell node’s payload row.
Fields
- pub row_span: u16¶
-
Rows spanned (at least 1).
- pub col_span: u16¶
-
Columns spanned (at least 1).
Trait Implementations
- pub struct guidedoc::LineView<'s>¶
-
One line of a source as readers hand it to each other: its text without the line break, and the source offset of its first byte. Borrowed from the source text.
Fields
- pub text: &'s str¶
-
The line’s text, without its break.
- pub offset: u32¶
-
Offset of
textin its source.
- pub struct guidedoc::LinkInfo¶
-
A link-like node’s payload row.
Fields
Implementations
- impl LinkInfo
Trait Implementations
- pub struct guidedoc::ListInfo¶
-
A List node’s payload row.
Fields
- pub delimiter: u8¶
-
“.”, “)”, or “(“ for «(1)»; the bullet character for bullets.
- pub start: i32¶
-
First number.
Trait Implementations
- pub struct guidedoc::Node¶
-
One node of the preorder node table.
Fields
- pub subtree_end: u32¶
-
The id after its last descendant.
- pub value: i32¶
-
A small per-kind scalar (see docs/manual/internals/ast.rst), otherwise zero.
- pub payload: u32¶
-
Its payload row, or
NONE.
- pub span: SourceSpan¶
-
Where it comes from.
- pub attributes: AttributeRange¶
-
Its attribute rows.
- pub struct guidedoc::NodeFlags(pub u8)¶
-
A set of
NodeFlags in one byte (saved objects store the byte as it is).Implementations
- impl NodeFlags
-
- pub const fn contains(self, other: NodeFlags) -> bool¶
-
Tells whether every flag of
otheris in the set.
- pub const fn is_empty(self) -> bool¶
-
Tells whether the set is empty.
Trait Implementations
- pub struct guidedoc::NodeId(pub u32)¶
-
A node’s index in its snapshot’s preorder node table.
ROOTis the Document node.Implementations
- impl NodeId
-
- pub const fn index(self) -> usize¶
-
Returns the id as a
usizeindex into the node table.
Trait Implementations
- pub struct guidedoc::SourceId(pub u16)¶
-
An index into a workspace’s source table; 0 is the main source.
Implementations
- pub struct guidedoc::SourceSpan¶
-
A half-open byte range in one source of the workspace’s source table.
Fields
- pub start: u32¶
-
First byte.
- pub end: u32¶
-
One past the last byte.
Implementations
- impl SourceSpan
-
- pub const fn new(source: SourceId, start: u32, end: u32) -> SourceSpan¶
-
Makes a span of
sourcefromstarttoend.
- pub const fn is_zero(self) -> bool¶
-
Tells whether the span is the zero span (no source position).
- pub struct guidedoc::Text¶
-
A byte range in a snapshot’s text pool.
Fields
- pub start: u32¶
-
First byte in the pool.
- pub len: u32¶
-
Length in bytes.
Implementations
- pub struct guidedoc::Workspace¶
-
One conversion’s storage. Use one workspace per thread; documents borrow it.
Implementations
- impl Workspace
-
- pub fn new() -> Workspace¶
-
Makes an empty workspace with
default_limits(). It allocates nothing until used.
- pub fn with_limits(limits: Limits) -> Workspace¶
-
Makes an empty workspace whose
convert_textuseslimits.
- pub fn document(&self) -> Option<Document<'_>>¶
-
Returns the current document: the last successful read, pass, or load, until the next conversion starts or the workspace is reset.
- pub fn reports(&self) -> &Reports¶
-
Returns the reports of the current conversion, valid until the next one.
- pub fn source_map(&self) -> &[MapEntry]¶
-
Returns the source map the last render recorded (
Request::source_map).
- pub fn sources(&self) -> &[SourceEntry]¶
-
Returns the source table of the current conversion.
- pub fn source_str(&self, id: SourceId) -> &str¶
-
Returns the whole text of source
id; «» for an unknown id.
- pub fn source_text(&self, span: SourceSpan) -> &str¶
-
Returns the source text a span covers, or «» for an invalid span.
- pub fn describe(&self, d: &Diagnostic) -> String¶
-
Returns a diagnostic’s message with its arguments, span arguments quoted from this workspace’s sources.
- pub fn scratch(&mut self) -> &mut Scratch¶
-
Returns the working state readers and renderers keep between conversions.
- pub fn reset(&mut self)¶
-
Forgets the document, sources, reports, and output, keeping their storage.
- pub fn begin_read<'w>(&'w mut self, request: &'w Request<'w>) -> Result<ReadContext<'w>, Fail>¶
-
Starts a read of
request’s source: a new conversion, the main source copied into the workspace, and a context whose builder has the root open.read_documentuses it; reader tests use it to drive a reader’s pieces.
Trait Implementations
- impl fmt::Debug for Workspace
-
- fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result
Enums
- pub enum guidedoc::Conformance¶
-
How completely an adapter implements its format.
Variants
- Planned¶
-
Not implemented yet.
- Partial¶
-
Implemented with known gaps.
- Conformant¶
-
Passes its conformance suite.
- pub enum guidedoc::SourceText<'a>¶
-
The text of a source, as a reader holds it while it keeps building: borrowed for the main source, shared for included ones. It dereferences to
&str.Variants
- Borrowed(&'a str)¶
-
The main source, borrowed from the workspace.
-
An included or added source.
Trait Implementations
- impl Deref for SourceText<'_>
-
- type Target = str
- fn deref(&self) -> &str
- pub enum guidedoc::EmitMode¶
-
What an emitter does with the bytes it is given.
Variants
- Check¶
-
Count them only (check_render).
- Write¶
-
Store them, up to the limit.
- pub enum guidedoc::MathMlError¶
-
Why the filter wrote nothing.
Variants
- TooLong¶
-
The text is longer than
MAX_MATHML_BYTES.
- TooDeep¶
-
Elements nest deeper than
MAX_MATHML_DEPTH.
- NoRoot¶
-
The text does not start with a
mathelement, or has text around it.
- Malformed¶
-
A tag is not closed, or an end tag closes another element.
Trait Implementations
- impl fmt::Display for MathMlError
-
- fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result
- impl std::error::Error for MathMlError
- pub enum guidedoc::MediaKind¶
-
The media an image path names.
Variants
- Image¶
-
A picture.
- Video¶
-
A video file.
- Audio¶
-
An audio file.
- pub enum guidedoc::ContentPolicy¶
-
What to do with content a policy governs.
Variants
- Refuse¶
-
An error that names the construct and the policy.
- Omit¶
-
A warning; the content is left out.
- Allow¶
-
Trusted content is emitted.
- pub enum guidedoc::Label¶
-
A word or phrase a renderer writes by itself; hosts translate them (
Labels). Labels holding «%s» take a value (a version number); seesplit_label.Variants
- Attention¶
- Caution¶
- Danger¶
- Error¶
- Hint¶
- Important¶
- Note¶
- Tip¶
- Warning¶
- SeeAlso¶
- Todo¶
- Contents¶
- VersionAdded¶
- VersionChanged¶
- VersionDeprecated¶
- VersionRemoved¶
- SectionAuthor¶
- ModuleAuthor¶
- CodeAuthor¶
- LinkHeading¶
- LinkDefinition¶
- LinkImage¶
- LinkTable¶
- LinkCode¶
- LinkEquation¶
- LinkTerm¶
- Parameters¶
- Variables¶
- Raises¶
- Returns¶
- ReturnType¶
- ReturnValues¶
- TemplateParameters¶
- Throws¶
- Arguments¶
- Availability¶
- UnengravedScore¶
Implementations
- pub enum guidedoc::MathStyle¶
-
How HTML writes math for a script (MathJax, KaTeX) to typeset.
Variants
- Plain¶
-
Class «math», the text in
\( \)or\[ \], as Docutils writes it.
- Sphinx¶
-
As Sphinx’s mathjax extension writes it.
- pub enum guidedoc::PassOutcome¶
-
What a pass did.
Variants
- Unchanged¶
-
It left the document as it is (costs nothing).
- Rebuilt¶
-
It wrote a new document into the builder.
- Failed¶
-
It failed; the previous document stays.
- pub enum guidedoc::ResourceStatus¶
-
Why a resource provider did not provide a resource.
Variants
- Missing¶
-
It does not exist.
- Refused¶
-
The host refuses to provide it.
- Limit¶
-
The host’s memory budget cannot hold it.
- NotUtf8¶
-
It exists, but its text is not UTF-8.
- pub enum guidedoc::Arg¶
-
A diagnostic argument: an integer, a quoted source span, or text.
{0}and{1}in a message name the arguments.Variants
- None¶
-
No argument.
- Int(i64)¶
-
An integer.
- Span(SourceSpan)¶
-
The source text of a span, quoted.
- Text(Cow<'static, str>)¶
-
Text: static, or owned when it was made at run time.
- pub enum guidedoc::Severity¶
-
How serious a diagnostic is.
Variants
- Note¶
-
Information only.
- Warning¶
-
A problem that does not fail the conversion (unless strict).
- Error¶
-
A problem that fails the conversion (unless kept by the policy).
- pub enum guidedoc::SourceUse¶
-
How the reader uses an included source: parsed as markup (include), or shown as it is (literalinclude, a graph file). Hosts tell a document’s parts from files it only quotes, as Sphinx’s
env.includeddoes.Variants
- Parsed¶
-
Read as markup.
- Literal¶
-
Shown as it is.
- pub enum guidedoc::SymbolClash¶
-
Why
SymbolTable::insertleft the table unchanged.Variants
- Duplicate(u32)¶
-
The key was present, with this value.
- Full¶
-
The table holds its capacity.
- #[repr(i32)] pub enum guidedoc::AdmonitionKind¶
-
An Admonition node’s
value.Variants
- Generic¶
-
The generic
admonitiondirective.
- Attention¶
- Caution¶
- Danger¶
- Error¶
- Hint¶
- Important¶
- Note¶
- Tip¶
- Warning¶
- Seealso¶
- Todo¶
Implementations
- impl AdmonitionKind
-
- pub const ALL: [AdmonitionKind; 12]¶
-
Every kind, in value order.
- pub fn from_value(v: i32) -> Option<AdmonitionKind>¶
-
Returns the kind a node’s
valueholds, orNonewhen out of range.
- #[repr(u8)] pub enum guidedoc::Align¶
-
A cell’s alignment.
Variants
- None¶
- Left¶
- Center¶
- Right¶
Implementations
- #[repr(u8)] pub enum guidedoc::AttributeKey¶
-
An attribute’s key;
Customkeys carry their name as text.Variants
- Custom¶
-
A key named by the attribute’s
nametext.
- Class¶
- Id¶
- Name¶
- Language¶
- Alt¶
- Width¶
- Height¶
- Scale¶
- Align¶
- Format¶
- Title¶
- Target¶
- Start¶
- Widths¶
- Source¶
Implementations
- impl AttributeKey
-
- pub const ALL: [AttributeKey; 16]¶
-
Every key, in declaration order.
- pub const fn name(self) -> &'static str¶
-
Returns the static name dumps write («class»); «custom» for Custom.
- pub enum guidedoc::Content¶
-
What children a kind may have; see
child_allowed.Variants
- Nothing¶
-
No children.
- Blocks¶
-
Block children.
- Inlines¶
-
Inline children.
- Structure¶
-
Children of specific kinds only.
- #[repr(i32)] pub enum guidedoc::DocumentReading¶
-
A Document node’s
value: who read it, which decides the ids anchors give.Variants
- Docutils = 0¶
-
Read as Docutils reads it.
- Sphinx = 1¶
-
Read by the Sphinx layer.
- #[repr(u8)] pub enum guidedoc::LinkKind¶
-
What a link row’s destination means.
Variants
- External¶
-
Destination is a URL or path.
- Email¶
-
Destination is an address; HTML adds
mailto:.
- Internal¶
-
resolvedis a node of this document.
- Unresolved¶
-
The name awaits resolution.
- Project¶
-
Destination is a project anchor key in another document.
Implementations
- #[repr(u8)] pub enum guidedoc::ListStyle¶
-
A list’s numbering style.
Variants
- Bullet¶
- Arabic¶
- LowerAlpha¶
- UpperAlpha¶
- LowerRoman¶
- UpperRoman¶
Implementations
- #[repr(u8)] pub enum guidedoc::NodeFlag¶
-
One node flag;
NodeFlagsholds a set of them.Variants
- Tight¶
-
List: items render without paragraph spacing.
- Anonymous¶
-
Reference or Target: anonymous hyperlink.
- Auto¶
-
Footnote or reference: auto-numbered.
- Symbol¶
-
Footnote or reference: auto-symbol.
- Local¶
-
Contents: only the enclosing section.
- Header¶
-
Row or Cell: belongs to a header.
- Referenced¶
-
Target or Footnote: something refers to it.
- Generated¶
-
Created by resolution rather than markup.
Implementations
- #[repr(u8)] pub enum guidedoc::NodeKind¶
-
Every kind of node. docs/manual/internals/ast.rst documents each kind’s children and fields.
Variants
- Document¶
-
The root.
- Title¶
- Subtitle¶
- Section¶
- Heading¶
- Paragraph¶
- BlockQuote¶
- Attribution¶
- List¶
- ListItem¶
- DefinitionList¶
- DefinitionItem¶
- Term¶
- Classifier¶
- Definition¶
- FieldList¶
- Field¶
- FieldName¶
- FieldBody¶
- OptionList¶
- OptionItem¶
- OptionGroup¶
- Option¶
- OptionArgument¶
- OptionDescription¶
- LineBlock¶
- Line¶
- CodeBlock¶
- Preformatted¶
- DoctestBlock¶
- MathBlock¶
- RawBlock¶
- ThematicBreak¶
- Table¶
- TableHead¶
- TableBody¶
- Row¶
- Cell¶
- Figure¶
- Caption¶
- Legend¶
- Admonition¶
- Topic¶
- Sidebar¶
- Rubric¶
- Container¶
- Compound¶
- Footnote¶
- Citation¶
- Target¶
- Comment¶
- SubstitutionDefinition¶
- Contents¶
- Directive¶
- Toctree¶
- ToctreeEntry¶
- Only¶
- Glossary¶
- VersionModified¶
- Desc¶
- DescSignature¶
- DescContent¶
- Hlist¶
- ProductionList¶
- Production¶
- Index¶
- Text¶
- Emphasis¶
- Strong¶
- Code¶
- Link¶
- Reference¶
- Image¶
- FootnoteReference¶
- CitationReference¶
- SubstitutionReference¶
- InlineTarget¶
- Math¶
- RawInline¶
- SoftBreak¶
- HardBreak¶
- Subscript¶
- Superscript¶
- TitleReference¶
- Abbreviation¶
- Role¶
- Xref¶
- DescName¶
- DescAddname¶
- DescAnnotation¶
- DescParameterlist¶
- DescParameter¶
- DescOptional¶
- DescReturns¶
Implementations
- impl NodeKind
- pub enum guidedoc::Region¶
-
A storage region named by a capacity failure.
Variants
- None¶
-
No region.
- Nodes¶
-
The node table.
- Text¶
-
The text pool.
- Attributes¶
-
The attribute table.
- Lists¶
-
The list payload table.
- Links¶
-
The link payload table.
- Cells¶
-
The cell payload table.
- Sources¶
-
The source table.
- Scratch¶
-
Working memory of an adapter.
- Reports¶
-
The report store.
- Output¶
-
The rendered output.
- SourceMap¶
-
The source map.
Implementations
- pub enum guidedoc::Status¶
-
The outcome class of a stage.
Okis kept so builders can report their state.Variants
- Ok¶
-
Success.
- InvalidInput¶
-
The input (or a document, request or registry) is invalid.
- Unsupported¶
-
The input asks for something no adapter supports.
- Policy¶
-
The policy refused something.
- Capacity¶
-
Memory ran out;
CapacityNeedsays where.
- Limit¶
-
A configured limit was reached.
- Cancelled¶
-
The caller cancelled the conversion.
- Internal¶
-
A bug in an adapter or the core.
Traits
- pub trait guidedoc::Highlighter¶
-
Writes highlighted HTML for a code block. It belongs to the caller’s trust boundary. It returns false, having written nothing, to let the renderer write plain escaped code instead.
- pub trait guidedoc::MathWriter¶
-
Writes one formula as markup that needs no script, such as MathML. It belongs to the caller’s trust boundary: what it writes goes into the page as it is. It returns false, having written nothing, to let the renderer write the formula’s LaTeX in its usual markup instead.
- pub trait guidedoc::ResourceProvider¶
-
Provides included files. It belongs to the caller’s trust boundary and may allocate. The core passes the name of the requesting source and the name as written.
- fn provide(&self, from: &str, name: &str) -> Result<Resource, ResourceStatus>¶
-
Returns the resource
namethat sourcefromasks for.
- pub trait guidedoc::TextSink¶
-
Something text can be written into: a
String, a byte buffer, a builder’s text pool, or an emitter. Helpers such asnormalize_labelandmake_idwrite into any of them, so callers reuse their own buffers instead of receiving fresh strings.- fn put_str(&mut self, s: &str)¶
-
Appends
s.
- fn put_char(&mut self, c: char)¶
-
Appends one character.
Implementors
- impl TextSink for Vec<u8>
Functions
- pub fn guidedoc::validate_registry(r: &Registry) -> Result<(), Fail>¶
-
Validates a registry: fails when an adapter lacks metadata or is registered twice.
- pub fn guidedoc::build_anchors(doc: Document<'_>, options: &RenderOptions<'_>, headings: bool) -> Anchors¶
-
Builds the anchor table of
docwith the options” anchor prefix.headingsgives ids to headings outside sections (every profile but CommonMark’s reference one).
- pub fn guidedoc::build_anchors_into(a: &mut Anchors, doc: Document<'_>, options: &RenderOptions<'_>, headings: bool)¶
-
Rebuilds
aas the anchor table ofdoc, asbuild_anchorsbuilds one, reusing the table’s storage: a renderer that keeps its table between conversions does not allocate once the table fits the largest document.
- pub fn guidedoc::id_fold(r: char) -> &'static str¶
-
Returns the ASCII transliteration
make_idgives a lowercase character («é» gives «e», «²» gives «2»), or «» when it has none.
- pub fn guidedoc::make_id(out: &mut (impl TextSink + ?Sized), name: &str)¶
-
Turns a name into an identifier matching
[a-z](-?[a-z0-9]+)*: letters are lowercased and transliterated to ASCII (id_fold), every other run of characters becomes one hyphen, and leading digits and hyphens are dropped, as published Sphinx URLs expect. It may write nothing.
- pub fn guidedoc::write_id(out: &mut (impl TextSink + ?Sized), name: &str)¶
-
Lowercases letters, keeps letters and digits, and joins every other run of characters with one hyphen. It names documents and chapters, whose names may start with digits (they get «id-« before them);
make_idnames anchors. A name without a letter or digit gives «section».
- pub fn guidedoc::contents_scope(doc: Document<'_>, contents: NodeId) -> (NodeId, NodeId, usize)¶
-
Returns the range of nodes a table of contents lists and the number of sections around that range.
- pub fn guidedoc::check_render(ws: &mut Workspace, renderer: &Renderer, request: &Request<'_>) -> Result<usize, Fail>¶
-
Runs the renderer without storing output and returns the exact output size; every support problem is reported as a render would report it.
- pub fn guidedoc::convert<'w>(ws: &'w mut Workspace, registry: &Registry, request: &Request<'_>) -> Result<&'w str, Fail>¶
-
Reads, transforms (when the request has passes), and renders one source, with the adapters
registrynames. It checks the registry first. The output borrows the workspace until its next conversion; on failure the workspace’s reports explain it and theFailcarries the primary diagnostic.
- pub fn guidedoc::convert_text<'w>(ws: &'w mut Workspace, registry: &Registry, reader: &str, renderer: &str, text: &str) -> Result<&'w str, Fail>¶
-
Converts
textwithdefault_requestand the workspace’s limits: the one-call path.guidedoc::convert_text(&mut ws, ®istry, "commonmark", "html", text).
- pub fn guidedoc::read_document<'w>(ws: &'w mut Workspace, reader: &Reader, request: &Request<'_>) -> Result<Document<'w>, Fail>¶
-
Reads the request’s source with
readerinto a new conversion and validates it. The document borrows the workspace until its next mutable use. Content errors fail it unlessPolicy::keep_documents_with_errors; strict policy fails on warnings.
- pub fn guidedoc::render_document<'w>(ws: &'w mut Workspace, renderer: &Renderer, request: &Request<'_>) -> Result<&'w str, Fail>¶
-
Renders the current document into the workspace’s output and returns it, valid until the next conversion. Output past
Limits::max_output_bytesfails withCapacityand the exact size needed; strict policy fails on warnings.
- pub fn guidedoc::transform_document<'w>(ws: &'w mut Workspace, passes: &[Pass<'_>], limits: &Limits) -> Result<Document<'w>, Fail>¶
-
Runs
passesin order on the current document. A rebuilding pass writes the other snapshot, which is validated before it becomes current; when a pass fails, the previous document stays current. Passes keep the read’s error policy.
- pub fn guidedoc::dump_to_string(doc: Document<'_>) -> String¶
-
Returns the outline of
docas a new string (for tests and debugging).
- pub fn guidedoc::dump_tree(doc: Document<'_>, out: &mut (impl TextSink + ?Sized))¶
-
Writes the outline of
docintoout, one node per line, indented two spaces per level.
- pub fn guidedoc::admonition_name(k: AdmonitionKind) -> &'static str¶
-
Returns the static class name of an admonition kind («note», «tip»).
- pub fn guidedoc::child_allowed(parent: NodeKind, child: NodeKind) -> bool¶
-
States the legal parent-child pairs. Builders and validation share it.
- pub fn guidedoc::content_model(k: NodeKind) -> Content¶
-
Tells what children nodes of kind
kmay have; seechild_allowed. Exhaustive, aspayload_ofis.
- pub fn guidedoc::kind_name(k: NodeKind) -> &'static str¶
-
Returns the static name of a node kind, as dumps and diagnostics write it.
- pub fn guidedoc::check_math(latex: &str, options: &MathCheck<'_>) -> Option<MathFault>¶
-
Checks one formula alone. See
MathChecker::check.
- pub fn guidedoc::is_math_command(name: &str) -> bool¶
-
Tells whether
name(without the backslash) is a LaTeX math command we know.
- pub fn guidedoc::is_math_environment(name: &str) -> bool¶
-
Tells whether
nameis a LaTeX math environment we know.
- pub fn guidedoc::suggest_math_command(name: &str) -> Option<&'static str>¶
-
The known command closest to the misspelled
name, if one is close.
- pub fn guidedoc::suggest_math_environment(name: &str) -> Option<&'static str>¶
-
The known environment closest to the misspelled
name, if one is close.
- pub fn guidedoc::filter_mathml(input: &str, options: &MathMlOptions<'_>, out: &mut String) -> Result<MathMlDropped, MathMlError>¶
-
Appends the MathML Core form of
input(onemathelement) tooutand returns what it left out. It borrows both for the call. On failureoutis as it was.
- pub fn guidedoc::media_kind(path: &str) -> MediaKind¶
-
Reads a path’s extension, ignoring case, a query, and a fragment.
- pub fn guidedoc::nfd_first(s: &str) -> char¶
-
Returns the first character of
sin NFD, as Sphinx takes an index entry’s letter:unicodedata.normalize("NFD", s[0])[0]. An empty string gives U+FFFD.
- pub fn guidedoc::normalize_nfd(s: &str) -> Cow<'_, str>¶
-
Returns
sin Normalization Form D, borrowing it when it is already in that form (all ASCII, the common case for index keys).
- pub fn guidedoc::normalize_nfd_into(out: &mut String, s: &str)¶
-
Appends
sin Normalization Form D toout, reusingout’s storage. Combining marks of a run are collected in a small buffer and reordered there.
- pub fn guidedoc::load_object<'w>(ws: &'w mut Workspace, bytes: &[u8], limits: &Limits) -> Result<Document<'w>, Fail>¶
-
Rebuilds a document from bytes
write_objectwrote, as a new conversion ofws, and validates it. The bytes are copied; they need not outlive the document.
- pub fn guidedoc::write_object(doc: Document<'_>, out: &mut Vec<u8>)¶
-
Appends
doc, with its sources, tooutas object bytes.
- pub fn guidedoc::admonition_label<'a>(options: &RenderOptions<'a>, k: AdmonitionKind) -> &'a str¶
-
Returns the title of an admonition kind; «» for a generic admonition.
- pub fn guidedoc::default_limits() -> Limits¶
-
Returns the documented limits: depth 256, a million nodes, 2^32 work steps, includes 8 deep and 32 MiB in total, expansion 16, 512 KiB of stack, 256 MiB of text, 256 reports, and 1 GiB of output.
- pub fn guidedoc::default_policy() -> Policy¶
-
Returns the safe policy: raw content, unsafe URLs, and untranslatable math refused; includes may be requested.
- pub fn guidedoc::default_read_options() -> ReadOptions<'static>¶
-
Returns the read options: title promotion on, tab width 8, no reader settings, the math check on.
- pub fn guidedoc::default_request<'a>(name: &'a str, text: &'a str, reader: &'a str, renderer: &'a str) -> Request<'a>¶
-
Returns a complete request with the documented defaults: default read options, a standalone render,
default_policy(),default_limits(), no passes, no resource provider, no cancellation. It borrows its arguments.
- pub fn guidedoc::is_mathml(doc: Document<'_>, id: crate::NodeId) -> bool¶
-
Tells whether the formula
idis written as MathML, not LaTeX. The HTML renderer passes its MathML Core through a filter; renderers that cannot typeset MathML show its source.
- pub fn guidedoc::label<'a>(options: &RenderOptions<'a>, l: Label) -> &'a str¶
-
Returns a label in the render’s language, or in English when it has none.
- pub fn guidedoc::read_extension<T: Any>(settings: &T) -> ReadExtension<'_>¶
-
Wraps borrowed reader settings with their type; they must outlive the read.
- pub fn guidedoc::split_label(s: &str) -> (&str, &str)¶
-
Splits a label at its «%s»: the text before and after the value.
- pub fn guidedoc::trusted_policy() -> Policy¶
-
Returns the policy for conformance tests and content the caller wrote: everything allowed.
- pub fn guidedoc::unengraved_score(doc: Document<'_>, id: crate::NodeId, options: &RenderOptions<'_>) -> Option<String>¶
-
For a code block that stands for an unread score file, the sentence a renderer shows in its place, in the rendering language; None for any other node. Renderers call this instead of knowing the directive’s attributes.
- pub fn guidedoc::relative_source(name: &str, root: &str) -> String¶
-
namerelative to the folderroot, with/separators. Only Windows names use\as a separator, so only there is it turned into/.
- pub fn guidedoc::arg_span(s: SourceSpan) -> Arg¶
-
Makes an argument that quotes the source text of
s.
- pub fn guidedoc::arg_static(s: &'static str) -> Arg¶
-
Makes an argument of static text; it copies nothing.
- pub fn guidedoc::arg_text(s: &str) -> Arg¶
-
Makes an argument of text that does not live long enough to borrow; it copies
s.
- pub fn guidedoc::content_error(status: Status) -> bool¶
-
Tells whether an error’s status describes the content (an unknown directive, a bad option, an unresolved reference, content refused by policy) rather than a tree that cannot be used.
Policy::keep_documents_with_errorskeeps documents whose errors are all content errors.
- pub fn guidedoc::diagnostic(m: Message, span: SourceSpan, a: Arg, b: Arg) -> Diagnostic¶
-
Builds a diagnostic from message
matspanwith up to two arguments.
- pub fn guidedoc::kept_message(policy: &Policy, m: Message) -> Message¶
-
Returns
mas a renderer reports it: a content error becomes a warning when the policy keeps documents with errors, so the page is still written.
- pub fn guidedoc::recycle<T, U>(mut buffer: Vec<T>) -> Vec<U>¶
-
Empties
bufferand returns its storage as a vector of another type of the same size and alignment. A reader keeps a buffer of borrowed values (Vec<Line<'s>>, borrowing one conversion’s source) in its scratch asVec<Line<'static>>, and turns it back withrecyclein the next conversion: the standard library collects an emptied vector into one of a same-sized type in place, without allocating.
- pub fn guidedoc::stack_diagnostic(g: &StackGuard, span: SourceSpan) -> Diagnostic¶
-
Returns the diagnostic a guard’s recursion reports.
- pub fn guidedoc::stack_exhausted(g: &StackGuard) -> bool¶
-
Tells whether the guard’s budget is spent.
- pub fn guidedoc::stack_guard(limits: &Limits) -> StackGuard¶
-
Starts measuring at the caller’s frame, with the limits” stack budget.
- pub fn guidedoc::check_utf8(source: SourceId, bytes: &[u8]) -> Result<&str, Fail>¶
-
Checks that
bytesare UTF-8 and returns them as text; otherwise aCORE_UTF8failure whose span (in sourcesource) covers the first bad byte. Hosts call it on file contents before building aRequest.
- pub fn guidedoc::decode_last_rune(s: &str, end: usize) -> (char, usize)¶
-
Decodes the character ending at byte
endofs, asdecode_runedoes.
- pub fn guidedoc::decode_rune(s: &str, i: usize) -> (char, usize)¶
-
Decodes the character starting at byte
iofs, with its width. A position that is not a character boundary decodes as U+FFFD with width 1, so a scan always moves forward; past the end gives U+FFFD with width 0.
- pub fn guidedoc::fold_rune(r: char) -> ([char; 3], usize)¶
-
Applies Unicode full case folding (statuses C and F) to
r: up to three characters, and how many.
- pub fn guidedoc::is_ascii_alnum(c: u8) -> bool¶
-
Tells whether
cis an ASCII letter or digit.
- pub fn guidedoc::is_ascii_digit(c: u8) -> bool¶
-
Tells whether
cis an ASCII digit.
- pub fn guidedoc::is_ascii_punct(c: u8) -> bool¶
-
Tells whether
cis ASCII punctuation, as CommonMark defines it.
- pub fn guidedoc::is_ascii_space(c: u8) -> bool¶
-
Tells whether
cis ASCII white space: space, tab, LF, CR, FF, or VT.
- pub fn guidedoc::is_decimal_digit(r: char) -> bool¶
-
Tells whether
ris a decimal digit (general category Nd).
- pub fn guidedoc::is_letter(r: char) -> bool¶
-
Tells whether
ris a letter (general category L).
- pub fn guidedoc::is_unicode_punctuation(r: char) -> bool¶
-
Tells whether
ris punctuation as CommonMark 0.31 defines it: general categories P and S.
- pub fn guidedoc::is_unicode_whitespace(r: char) -> bool¶
-
Tells whether
ris white space as CommonMark defines it: Zs characters, tab, LF, FF, and CR.
- pub fn guidedoc::line_bounds(text: &str, offset: usize) -> (usize, usize)¶
-
Returns the byte range of the line holding
offset, without its break.
- pub fn guidedoc::line_column(text: &str, offset: usize) -> (usize, usize)¶
-
Converts a byte offset into a 1-based line and byte column.
- pub fn guidedoc::normalize_label(out: &mut (impl TextSink + ?Sized), label: &str)¶
-
Writes the case-folded
labelwith runs of white space collapsed to one space and the ends trimmed. CommonMark labels and RST names are normalized this way.
- pub fn guidedoc::to_lower(r: char) -> char¶
-
Returns the simple lowercase mapping of
r(one character); characters whose full mapping has several characters keep the first one, which is the simple mapping for every such character (U+0130 gives “i”).
- pub fn guidedoc::offset_in(outer: &str, inner: &str) -> Option<usize>¶
-
Returns where
innerstarts inouterwheninneris a slice ofouter’s bytes, andNoneotherwise (an emptyinnerincluded). It compares addresses only.
- pub fn guidedoc::validate(snap: &Snapshot, source_lengths: &[usize], limits: &Limits) -> Result<(), Fail>¶
-
Checks a finished snapshot.
source_lengths[i]is the byte length of sourcei. It allocates its own working stack; the engine usesvalidate_withand a reused one.
Type Aliases
- pub type guidedoc::ReadFn = fn(&mut ReadContext<'_>) -> Result<(), Fail>¶
-
Reads
ctx.sourceintoctx.b.
- pub type guidedoc::ReadInlineFn = fn(&mut ReadContext<'_>, SourceSpan) -> Result<(), Fail>¶
-
Parses a span of
ctx.sourceas inline content of the builder’s open node, as a translated message is parsed. It neither resolves references nor reports unresolved ones.span.sourcemust bectx.source.
- pub type guidedoc::RenderFn = fn(&mut RenderContext<'_>) -> Result<(), Fail>¶
-
Writes
ctx.docwithctx.out.
- pub type guidedoc::PassFn<'a> = dyn Fn(Document<'_>, &mut Builder<'_>) -> PassOutcome + 'a¶
-
The function of a pass: it reads an immutable document and may rebuild it.
Constants
- pub const guidedoc::BUILDER_OPEN: u32 = u32::MAX - 1¶
-
The subtree end of a node that is still open.
- pub const guidedoc::MATH_DELIMITER: Message¶
-
A
\leftwithout its\right, or a\rightwithout its\left.
- pub const guidedoc::MATH_ENVIRONMENT_MISMATCH: Message¶
-
An
\endthat names another environment than the open one.
- pub const guidedoc::MATH_ENVIRONMENT_UNCLOSED: Message¶
-
A
\beginwithout its\end, or an\endwithout its\begin.
- pub const guidedoc::MATH_ENVIRONMENT_UNKNOWN: Message¶
-
An environment no LaTeX math vocabulary we know has.
- pub const guidedoc::MAX_FORMULA_BYTES: usize = 64 << 10¶
-
The longest formula checked, in bytes. A longer one is left alone.
- pub const guidedoc::MATHML_ATTRIBUTES: [&str; 26]¶
-
The attributes the filter keeps, on any kept element.
- pub const guidedoc::MATHML_ELEMENTS: [&str; 28]¶
-
The elements the filter keeps: MathML Core’s presentation elements.
- pub const guidedoc::MAX_MATHML_BYTES: usize = 256 << 10¶
-
The longest MathML text the filter reads, in bytes.
- pub const guidedoc::MAX_MATHML_DEPTH: usize = 128¶
-
The deepest element nesting the filter follows.
- pub const guidedoc::ENGLISH_LABELS: [&str; LABEL_COUNT]¶
-
The labels in English (Sphinx’s msgids), indexed by
Label as usize.
- pub const guidedoc::LABEL_COUNT: usize = 37¶
-
The number of labels.
- pub const guidedoc::MATH_NOTATION_ATTRIBUTE: &str = "notation"¶
-
The custom attribute of a formula that is not written in LaTeX. Its only value is
mathml: the node’s text is then one MathMLmathelement (seeis_mathml).
- pub const guidedoc::SCORE_FILE_ATTRIBUTE: &str = "lilypond-file"¶
-
The custom attribute a
lilyponddirective with a file argument carries. The reader never opens the file; the project builder engraves it.
- pub const guidedoc::CORE_CAPACITY: Message¶
-
A region ran out of memory;
{0}names it and{1}the shortfall.
- pub const guidedoc::CORE_UNHANDLED_KIND: Message¶
-
A renderer routed a node to a handler that does not write it.
- pub const guidedoc::INCLUDE_MISSING: Message¶
-
The provider has no such resource. Readers report it too (literalinclude).
- pub const guidedoc::DEFAULT_STACK_BYTES: usize = 512 << 10¶
-
The stack a reader or renderer may use when
Limits::stack_bytesis 0. WithSTACK_RESERVEit fits a 1 MiB thread, the smallest default thread stack of the supported platforms (Windows).
- pub const guidedoc::STACK_RESERVE: usize = 128 << 10¶
-
The stack a conversion needs below its deepest guard. Debug builds have larger frames, so a debug build should run conversions on a thread with more room.
- pub const guidedoc::INVALID_NODE: NodeId = NodeId(u32::MAX)¶
-
«No node»: the table value for a node that is absent.
- pub const guidedoc::NONE: u32 = u32::MAX¶
-
«No row»: a node’s payload when it has none.
- pub const guidedoc::VERSION: &str = env!("CARGO_PKG_VERSION")¶
-
The engine’s version: the project version every crate inherits.
- pub const guidedoc::SCHEMA_VERSION: u32 = 1¶
-
Counts the incompatible changes to documents saved as objects (
write_object).