mirror of
https://github.com/ziglang/zig.git
synced 2026-02-20 08:14:48 +00:00
std.Io.net.Stream: add "const" variant to "close"
useful for resource management
This commit is contained in:
parent
80069c1e69
commit
426a377c7b
@ -1154,6 +1154,11 @@ pub const Stream = struct {
|
||||
s.* = undefined;
|
||||
}
|
||||
|
||||
/// Same as `close` but doesn't try to set `Stream` to `undefined`.
|
||||
pub fn closeConst(s: *const Stream, io: Io) void {
|
||||
io.vtable.netClose(io.userdata, s.socket.handle);
|
||||
}
|
||||
|
||||
pub const Reader = struct {
|
||||
io: Io,
|
||||
interface: Io.Reader,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user