Provides io.Reader, io.Writer, and io.SeekableStream for in-memory buffers as well as files. For memory sources, if the supplied byte buffer is const, then io.Writer is not available. The error set of the stream functions is the error set of the corresponding file functions.

Fields

buffer: field_call,

The stream access is redirected to this buffer.

const_buffer: field_call,

The stream access is redirected to this buffer. Writing to the source will always yield error.AccessDenied.

file: if (has_file) std.fs.File else void,

The stream access is redirected to this file. On freestanding, this must never be initialized!

Functions

fn getEndPos(self: *StreamSource) GetSeekPosError!u64

No documentation provided.

fn getPos(self: *StreamSource) GetSeekPosError!u64

No documentation provided.

fn read(self: *StreamSource, dest: []u8) ReadError!usize

No documentation provided.

fn reader(self: *StreamSource) Reader

No documentation provided.

fn seekBy(self: *StreamSource, amt: i64) SeekError!void

No documentation provided.

fn seekTo(self: *StreamSource, pos: u64) SeekError!void

No documentation provided.

fn seekableStream(self: *StreamSource) SeekableStream

No documentation provided.

fn write(self: *StreamSource, bytes: []const u8) WriteError!usize

No documentation provided.

fn writer(self: *StreamSource) Writer

No documentation provided.

Values