neco_gleam/printer

Types

pub opaque type Printer

Values

pub fn append_byte(
  printer: Printer,
  byte: Int,
) -> Result(Printer, Nil)

Appends one byte, returning Error(Nil) for values outside 0 through 255.

pub fn append_bytes(printer: Printer, bytes: BitArray) -> Printer
pub fn append_string(printer: Printer, string: String) -> Printer

Appends the UTF-8 encoding of string.

pub fn byte_size(printer: Printer) -> Int
pub fn new() -> Printer
pub fn to_bit_array(printer: Printer) -> BitArray
pub fn to_string(printer: Printer) -> Result(String, Nil)

Returns the accumulated bytes as text, with Error(Nil) for invalid UTF-8.

Search Document