Crate datum

Source
Expand description

The datum crate provides reading/writing utilities for the human-writable data format of the same name. For further information, see https://github.com/20kdc/datum and the documentation there.

Macros§

datum_error
Creates a DatumError. Beware: If detailed_errors is off, messages are discarded.

Structs§

DatumChar
Datum character with class. It is not possible to create an instance of this enum which cannot be emitted.
DatumComposePipe
Composed pipe.
DatumDecoder
Decoder for the Datum encoding layer.
DatumError
Datum error. Notably, writing uses a different error type, so these are read-focused.
DatumLineNumberTracker
‘Tracking’ pipeline stage, holding the line number in a cell by reference.
DatumParser
Datum parser (from tokens into values).
DatumPipeTokenizer
Tokenizer that uses String as an internal buffer and spits out DatumToken.
DatumTokenizer
Datum tokenizer state machine. This API is a little harder to use, but allows complete control over buffer allocation/etc. In particular, it expects you to keep track of characters it sends your way with the DatumTokenizerAction::Push action. When a token is complete, you will receive the DatumTokenizerAction::Token action. You should also call feed with None when relevant to get any token at the very end of the file.
DatumUTF8Decoder
UTF-8 stream decoder.
DatumWriter
General interface for formatting/printing Datum content. Note that if the passed writer returns an error at any point, the state of the writer is indeterminate, as it can be mid-token or part-way through a comment.
ViaDatumPipe
This is used in IntoViaDatumPipe::via_datum_pipe.

Enums§

DatumAtom
Atomic Datum AST value. This enum also contains the functions that convert between tokens and atoms. You can think of it as the bridge between Datum’s tokenization model and value model. Accordingly, it does not contain offsets.
DatumCharClass
Datum character class.
DatumErrorKind
Any error producible by Datum.
DatumToken
Datum token with integrated string. Notably, integer/float are stored as their values here to prevent unwritable values existing.
DatumTokenType
Datum token type. This is paired with the token contents, if any.
DatumTokenizerAction
Action output by the tokenizer.
DatumValue
Datum AST node / value.
DatumWriterState
The states a Datum writer can be in.

Traits§

DatumMayContainAtom
Implemented by structs which may contain an Atom to give easy access to said Atom.
DatumPipe
Generic “input X, get Y” function
IntoViaDatumPipe
This is used to provide IntoViaDatumPipe::via_datum_pipe on Iterator.

Functions§

datum_byte_to_token_pipeline
Byte to token parsing pipeline.
datum_byte_to_value_pipeline
Byte to value parsing pipeline.
datum_char_to_token_pipeline
Character to token parsing pipeline.
datum_char_to_value_pipeline
Char to value parsing pipeline.
datum_write_byte_hex_escape
Writes a hex escape for a byte.
datum_write_display_as_string
Writes a Datum string where the contents come from a core::fmt::Display type.

Type Aliases§

DatumByteToTokenPipeline
Byte to token parsing pipeline (custom storage) Added in 1.1.0.
DatumCharToTokenPipeline
Char to token parsing pipeline (custom storage) Added in 1.1.0.
DatumOffset
Diagnostic offset. Units are dependent on how you use it.
DatumResult
Datum result for the given value.
DatumStringTokenizer
The ‘default’ String-based tokenizer you usually want.