- Version 0.1
This specification uses Rust- and ABNF inspired pseudocode for structured data definitions1. We call this notation Rust-like Abstract Notation (RlAN).
bool: Boolean value (true/false)char: A single UTF8 characteru8,u16,u32,u64,u128: Unsigned integers of specified bit lengthi8,i16,i32,i64,i128: Signed integers of specified bit lengthString: UTF-8 encoded text string
Derived Type
DerivedTypeName := InnerType(Constraint)
Struct
StructName := {
field_name: FieldType(Constraint),
optional_field: Optional<Type>
}
Enumeration
EnumName := Variant1 | Variant2 | Variant3
CONST_NAME: Type := ValueDefines a value of a certain type that never changes
[T]: Array of type TList<T>: Ordered collection of type TOptional<T>: Nullable field of type TMap<K, V>: Key-value mapping from type K to type VResult<T, E>: Success value T or error ERefCounted<T>: Automatically reference counted TMutex<T>: A mutual exclusion primitive useful for protecting shared data T
DateTime<Utc>: Time and Date with the universal timezone "UTC"DateTime<Local>: Time and Date with the local timezone of a user, like "CET"Duration: Time span/interval
SocketAddr: Network socket address (IP + port)DNSName: Domain name stringIPAddress: IPv4 or IPv6 address
Ed25519PublicKey: 32-byte Ed25519 public keyEd25519PrivateKey: 32-byte Ed25519 private keyEd25519Signature: 64-byte Ed25519 signatureX25519PublicKey: 32-byte X25519 public keyX25519PrivateKey: 32-byte X25519 private key
MessageId: Unique message identifier, derived overu32
||: Byte sequence concatenation:=: Type definition assignment=: Value assignment==,!=: Equality/inequality comparison<,>,<=,>=: Ordering comparison&&,||,!: Logical AND, OR, NOT+,-,*,/,%: Arithmetic operations&,|,^: Bitwise AND, OR, XOR<<,>>: Bit shift left/right.: Field access[index]: Indexing1..40: Range1..=40: Inclusive range
This notation can contain comments. Comments are free text that can be used
to further explain something. All text in a line following the marker //
is a comment.
// This is a comment
Trust := Unknown | Trusted | Rejected // this is also a comment
- Field names use
snake_case - Type names use
PascalCase - Constants use
UPPER_CASE
Footnotes
-
ABNF is defined in RFC 5234 of the IETF: https://www.rfc-editor.org/rfc/rfc5234 ↩