DoxigAlpha

readAtLeast

Deprecated in favor of Reader.

Function parameters

Parameters

#
buffer:[]u8
len:usize

Type definitions in this namespace

Types

#

Functions in this namespace

Functions

#
tcpConnectToHost
All memory allocated with `allocator` will be freed before this function returns.
getAddressList
Call `AddressList.deinit` on the result.

Error sets in this namespace

Error Sets

#

= switch (native_os) { .windows => builtin.os.version_range.windows.isAtLeast(.win10_rs4) orelse false, .wasi => false, else => true, }

Values

#
has_unix_sockets
= switch (native_os) { .windows => builtin.os.version_range.windows.isAtLeast(.win10_rs4) orelse false, .wasi => false, else => true, }

Source

Implementation

#
pub fn readAtLeast(s: Stream, buffer: []u8, len: usize) ReadError!usize {
    assert(len <= buffer.len);
    var index: usize = 0;
    while (index < len) {
        const amt = try s.read(buffer[index..]);
        if (amt == 0) break;
        index += amt;
    }
    return index;
}