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§
- Datum
Char - Datum character with class. It is not possible to create an instance of this enum which cannot be emitted.
- Datum
Compose Pipe - Composed pipe.
- Datum
Decoder - Decoder for the Datum encoding layer.
- Datum
Error - Datum error. Notably, writing uses a different error type, so these are read-focused.
- Datum
Line Number Tracker - ‘Tracking’ pipeline stage, holding the line number in a cell by reference.
- Datum
Parser - Datum parser (from tokens into values).
- Datum
Pipe Tokenizer - Tokenizer that uses String as an internal buffer and spits out DatumToken.
- Datum
Tokenizer - 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.
- DatumUT
F8Decoder - UTF-8 stream decoder.
- Datum
Writer - 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.
- ViaDatum
Pipe - This is used in IntoViaDatumPipe::via_datum_pipe.
Enums§
- Datum
Atom - 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.
- Datum
Char Class - Datum character class.
- Datum
Error Kind - Any error producible by Datum.
- Datum
Token - Datum token with integrated string. Notably, integer/float are stored as their values here to prevent unwritable values existing.
- Datum
Token Type - Datum token type. This is paired with the token contents, if any.
- Datum
Tokenizer Action - Action output by the tokenizer.
- Datum
Value - Datum AST node / value.
- Datum
Writer State - The states a Datum writer can be in.
Traits§
- Datum
MayContain Atom - Implemented by structs which may contain an Atom to give easy access to said Atom.
- Datum
Pipe - Generic “input X, get Y” function
- Into
ViaDatum Pipe - 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§
- Datum
Byte ToToken Pipeline - Byte to token parsing pipeline (custom storage) Added in 1.1.0.
- Datum
Char ToToken Pipeline - Char to token parsing pipeline (custom storage) Added in 1.1.0.
- Datum
Offset - Diagnostic offset. Units are dependent on how you use it.
- Datum
Result - Datum result for the given value.
- Datum
String Tokenizer - The ‘default’ String-based tokenizer you usually want.