structstd.crypto.tls.Client.StreamInterface[src]

This is an example of the type that is needed by the read and write functions. It can have any fields but it must at least have these functions.

Note that std.net.Stream conforms to this interface.

This declaration serves as documentation only.

Error Sets

Error SetReadError[src]

Can be any error set.

Source Code

Source code
pub const ReadError = error{}

Error SetWriteError[src]

Can be any error set.

Source Code

Source code
pub const WriteError = error{}

Functions

Functionreadv[src]

pub fn readv(this: @This(), iovecs: []std.posix.iovec) ReadError!usize

Returns the number of bytes read. The number read may be less than the buffer space provided. End-of-stream is indicated by a return value of 0.

The iovecs parameter is mutable because so that function may to mutate the fields in order to handle partial reads from the underlying stream layer.

Parameters

this: @This()
iovecs: []std.posix.iovec

Source Code

Source code
pub fn readv(this: @This(), iovecs: []std.posix.iovec) ReadError!usize {
    _ = .{ this, iovecs };
    @panic("unimplemented");
}

Functionwritev[src]

pub fn writev(this: @This(), iovecs: []const std.posix.iovec_const) WriteError!usize

Returns the number of bytes read, which may be less than the buffer space provided. A short read does not indicate end-of-stream.

Parameters

this: @This()
iovecs: []const std.posix.iovec_const

Source Code

Source code
pub fn writev(this: @This(), iovecs: []const std.posix.iovec_const) WriteError!usize {
    _ = .{ this, iovecs };
    @panic("unimplemented");
}

FunctionwritevAll[src]

pub fn writevAll(this: @This(), iovecs: []std.posix.iovec_const) WriteError!usize

Returns the number of bytes read, which may be less than the buffer space provided, indicating end-of-stream. The iovecs parameter is mutable in case this function needs to mutate the fields in order to handle partial writes from the underlying layer.

Parameters

this: @This()

Source Code

Source code
pub fn writevAll(this: @This(), iovecs: []std.posix.iovec_const) WriteError!usize {
    // This can be implemented in terms of writev, or specialized if desired.
    _ = .{ this, iovecs };
    @panic("unimplemented");
}

Source Code

Source code
pub const StreamInterface = struct {
    /// Can be any error set.
    pub const ReadError = error{};

    /// Returns the number of bytes read. The number read may be less than the
    /// buffer space provided. End-of-stream is indicated by a return value of 0.
    ///
    /// The `iovecs` parameter is mutable because so that function may to
    /// mutate the fields in order to handle partial reads from the underlying
    /// stream layer.
    pub fn readv(this: @This(), iovecs: []std.posix.iovec) ReadError!usize {
        _ = .{ this, iovecs };
        @panic("unimplemented");
    }

    /// Can be any error set.
    pub const WriteError = error{};

    /// Returns the number of bytes read, which may be less than the buffer
    /// space provided. A short read does not indicate end-of-stream.
    pub fn writev(this: @This(), iovecs: []const std.posix.iovec_const) WriteError!usize {
        _ = .{ this, iovecs };
        @panic("unimplemented");
    }

    /// Returns the number of bytes read, which may be less than the buffer
    /// space provided, indicating end-of-stream.
    /// The `iovecs` parameter is mutable in case this function needs to mutate
    /// the fields in order to handle partial writes from the underlying layer.
    pub fn writevAll(this: @This(), iovecs: []std.posix.iovec_const) WriteError!usize {
        // This can be implemented in terms of writev, or specialized if desired.
        _ = .{ this, iovecs };
        @panic("unimplemented");
    }
}