lisette-stdlib 0.1.17

Little language inspired by Rust that compiles to Go
Documentation
// Generated by Lisette bindgen
// Source: encoding/hex (Go stdlib)
// Go: 1.25.5
// Lisette: 0.1.14

import "go:io"

/// AppendDecode appends the hexadecimally decoded src to dst
/// and returns the extended buffer.
/// If the input is malformed, it returns the partially decoded src and an error.
pub fn AppendDecode(mut dst: Slice<uint8>, src: Slice<uint8>) -> Result<Slice<uint8>, error>

/// AppendEncode appends the hexadecimally encoded src to dst
/// and returns the extended buffer.
pub fn AppendEncode(mut dst: Slice<uint8>, src: Slice<uint8>) -> Slice<uint8>

/// Decode decodes src into [DecodedLen](len(src)) bytes,
/// returning the actual number of bytes written to dst.
/// 
/// Decode expects that src contains only hexadecimal
/// characters and that src has even length.
/// If the input is malformed, Decode returns the number
/// of bytes decoded before the error.
pub fn Decode(mut dst: Slice<uint8>, src: Slice<uint8>) -> Result<int, error>

/// DecodeString returns the bytes represented by the hexadecimal string s.
/// 
/// DecodeString expects that src contains only hexadecimal
/// characters and that src has even length.
/// If the input is malformed, DecodeString returns
/// the bytes decoded before the error.
pub fn DecodeString(s: string) -> Result<Slice<uint8>, error>

/// DecodedLen returns the length of a decoding of x source bytes.
/// Specifically, it returns x / 2.
pub fn DecodedLen(x: int) -> int

/// Dump returns a string that contains a hex dump of the given data. The format
/// of the hex dump matches the output of `hexdump -C` on the command line.
pub fn Dump(data: Slice<uint8>) -> string

/// Dumper returns a [io.WriteCloser] that writes a hex dump of all written data to
/// w. The format of the dump matches the output of `hexdump -C` on the command
/// line.
pub fn Dumper(w: io.Writer) -> io.WriteCloser

/// Encode encodes src into [EncodedLen](len(src))
/// bytes of dst. As a convenience, it returns the number
/// of bytes written to dst, but this value is always [EncodedLen](len(src)).
/// Encode implements hexadecimal encoding.
pub fn Encode(mut dst: Slice<uint8>, src: Slice<uint8>) -> int

/// EncodeToString returns the hexadecimal encoding of src.
pub fn EncodeToString(src: Slice<uint8>) -> string

/// EncodedLen returns the length of an encoding of n source bytes.
/// Specifically, it returns n * 2.
pub fn EncodedLen(n: int) -> int

/// NewDecoder returns an [io.Reader] that decodes hexadecimal characters from r.
/// NewDecoder expects that r contain only an even number of hexadecimal characters.
pub fn NewDecoder(r: io.Reader) -> io.Reader

/// NewEncoder returns an [io.Writer] that writes lowercase hexadecimal characters to w.
pub fn NewEncoder(w: io.Writer) -> io.Writer

/// InvalidByteError values describe errors resulting from an invalid byte in a hex string.
pub struct InvalidByteError(uint8)

/// ErrLength reports an attempt to decode an odd-length input
/// using [Decode] or [DecodeString].
/// The stream-based Decoder returns [io.ErrUnexpectedEOF] instead of ErrLength.
pub var ErrLength: error

impl InvalidByteError {
  fn Error(self) -> string
}