bolt library

Lightning fast, strongly typed network protocol

Classes

Acknowledged<T extends DataObject>
A acknowledged data object that was previously sent to a connection.
Address
An address that holds an host and a port.
AnsiCode
Standard ANSI escape code for customizing terminal text output.
AnsiCodeType
The type of code represented by AnsiCode.
Argument<T, V>
Describes an argument of a DataObject constructor.
BinaryContract<T>
The BinaryContract allows developers to define a strongly typed binary representation of a Dart class. If your Dart class contract changes, so will the binary contract, ensuring you never forget to change how the data is being read or stored.
BoltBinding
Defines a communication protocol for Bolt. This is used to define through which protocol packets are sent and received.
BoltProtocol
The underlying protocol for Bolt that can send and receive DataObjects.
BoltRegistry
A registry for DataResolvers.
ByteData
A fixed-length, random-access sequence of bytes that also provides random and unaligned access to the fixed-width integers and floating point numbers represented by those bytes.
Bytes
Reads and write a list of bytes.
DataObject
Represents the data of a packet being sent over the network.
DataResolver<T extends DataObject>
Defines how a DataObject is resolved to and from binary data.
ExitCode
Exit code constants.
Logger
A basic Logger which wraps stdio and applies various styles.
LogTheme
A theme object which contains styles for all log message types.
Packet<T>
A packet that was received from the network.
Payload
Base class for the PayloadWriter and PayloadReader.
PayloadReader
A readable payload. It is capable of reading values from a binary representation into their corresponding PayloadTypes.
PayloadType<T>
The base class for any payload type. It is capable of reading and writing values to a PayloadWriter or PayloadReader.
PayloadWriter
A writeable payload. It is used by binarize to create a binary ] representation of a payload.
Progress
A class that can be used to display progress information to the user.
ProgressAnimation
An object which contains configuration for the animation of a Progress instance.
ProgressOptions
An object containing configuration for a Progress instance.
RawList<T>
Reads and write a raw list of type.
Uint8List
A fixed-length list of 8-bit unsigned integers.

Enums

Level
Indicates the desired logging level.

Constants

backgroundBlack → const AnsiCode
backgroundBlue → const AnsiCode
backgroundColors → const List<AnsiCode>
All of the AnsiCode values that represent AnsiCodeType.background.
backgroundCyan → const AnsiCode
backgroundDarkGray → const AnsiCode
backgroundDefault → const AnsiCode
backgroundGreen → const AnsiCode
backgroundLightBlue → const AnsiCode
backgroundLightCyan → const AnsiCode
backgroundLightGray → const AnsiCode
backgroundLightGreen → const AnsiCode
backgroundLightMagenta → const AnsiCode
backgroundLightRed → const AnsiCode
backgroundLightYellow → const AnsiCode
backgroundMagenta → const AnsiCode
backgroundRed → const AnsiCode
backgroundWhite → const AnsiCode
backgroundYellow → const AnsiCode
black → const AnsiCode
blue → const AnsiCode
boolean → const _Boolean
Converts a boolean into a single bit.
cyan → const AnsiCode
darkGray → const AnsiCode
defaultForeground → const AnsiCode
flags → const _Flags
Converts a list of 8 booleans into a single byte.
float32 → const _Float32
Converts a double into four bytes that represents a Float32 value.
float64 → const _Float64
Converts a double into eight bytes that represents a Float64 value.
foregroundColors → const List<AnsiCode>
All of the AnsiCode values that represent AnsiCodeType.foreground.
green → const AnsiCode
int16 → const _Int16
Converts a integer into two bytes that represents an Int16 value.
int32 → const _Int32
Converts a integer into four bytes that represents an Int32 value.
int64 → const _Int64
Converts a integer into eight bytes that represents an Int64 value.
int8 → const _Int8
Converts an integer into a single byte that represents an Int8 value.
lightBlue → const AnsiCode
lightCyan → const AnsiCode
lightGray → const AnsiCode
lightGreen → const AnsiCode
lightMagenta → const AnsiCode
lightRed → const AnsiCode
lightYellow → const AnsiCode
magenta → const AnsiCode
red → const AnsiCode
resetAll → const AnsiCode
resetBold → const AnsiCode
resetDim → const AnsiCode
resetItalic → const AnsiCode
resetReverse → const AnsiCode
resetUnderlined → const AnsiCode
string → const _String
Converts a string into an encoded UTF-8 list.
string16 → const _String
Converts a string into an encoded UTF-8 list.
string32 → const _String
Converts a string into an encoded UTF-8 list.
string64 → const _String
Converts a string into an encoded UTF-8 list.
string8 → const _String
Converts a string into an encoded UTF-8 list.
styleBold → const AnsiCode
styleDim → const AnsiCode
styleItalic → const AnsiCode
styleReverse → const AnsiCode
styles → const List<AnsiCode>
All of the AnsiCode values that represent AnsiCodeType.style.
styleUnderlined → const AnsiCode
uint16 → const _Uint16
Converts a integer into two bytes that represents an unsigned Int16 value.
uint32 → const _Uint32
Converts a integer into four bytes that represents an unsigned Int32 value.
uint64 → const _Uint64
Converts a integer into eight bytes that represents an unsigned Int64 value.
uint8 → const _Uint8
Converts a integer into a single byte that represents an unsigned Int8 value.
white → const AnsiCode
yellow → const AnsiCode

Properties

ansiOutputEnabled bool
Whether formatted ANSI output is enabled for wrapWith and AnsiCode.wrap.
no setter

Functions

binarize(PayloadWriter payload) Uint8List
Convert a PayloadWriter into a Uint8List of bytes.
Wraps uri with an escape sequence so it's recognized as a hyperlink. An optional message can be used in place of the uri. If no message is provided, the text content will be the full uri.
list<T>(PayloadType<T> type, {PayloadType<int> lengthType = uint32}) PayloadType<List<T>>
Make the given type support a list of T.
map<K, V>(PayloadType<K> keyType, PayloadType<V> valueType, {PayloadType<int> lengthType = uint8}) PayloadType<Map<K, V>>
Store a map of K and V as binary data.
nullable<T>(PayloadType<T> type) PayloadType<T?>
Make the given type nullable.
overrideAnsiOutput<T>(bool enableAnsiOutput, T body()) → T
Allows overriding ansiOutputEnabled to enableAnsiOutput for the code run within body.

Typedefs

LogStyle = String? Function(String? message)
Type definition for a function which accepts a log message and returns a styled version of that message.