authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2025-07-10 13:14:55-07:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2025-07-10 16:52:29-07:00
loge25541549852c8dcf4acbcc1a3f3d7ef4bcef9d7
tree249fe817a5250623e38f6e45d0fd5afc4a942a1c
parent88e50b30c3c929761f2ae1a924b96f8bc7548b84

std: add some missing doc comments


2 files changed, 14 insertions(+), 0 deletions(-)

lib/std/Io/Reader.zig+9
......@@ -840,6 +840,9 @@ pub fn peekDelimiterExclusive(r: *Reader, delimiter: u8) DelimiterError![]u8 {
840840/// Returns number of bytes streamed, which may be zero, or error.EndOfStream
841841/// if the delimiter was not found.
842842///
843/// Asserts buffer capacity of at least one. This function performs better with
844/// larger buffers.
845///
843846/// See also:
844847/// * `streamDelimiterEnding`
845848/// * `streamDelimiterLimit`
......@@ -858,6 +861,9 @@ pub fn streamDelimiter(r: *Reader, w: *Writer, delimiter: u8) StreamError!usize
858861/// Returns number of bytes streamed, which may be zero. End of stream can be
859862/// detected by checking if the next byte in the stream is the delimiter.
860863///
864/// Asserts buffer capacity of at least one. This function performs better with
865/// larger buffers.
866///
861867/// See also:
862868/// * `streamDelimiter`
863869/// * `streamDelimiterLimit`
......@@ -884,6 +890,9 @@ pub const StreamDelimiterLimitError = error{
884890///
885891/// Returns number of bytes streamed, which may be zero. End of stream can be
886892/// detected by checking if the next byte in the stream is the delimiter.
893///
894/// Asserts buffer capacity of at least one. This function performs better with
895/// larger buffers.
887896pub fn streamDelimiterLimit(
888897 r: *Reader,
889898 w: *Writer,
lib/std/Io/Writer.zig+5
......@@ -560,6 +560,10 @@ pub fn writeAllPreserve(w: *Writer, preserve_length: usize, bytes: []const u8) E
560560/// A user type may be a `struct`, `vector`, `union` or `enum` type.
561561///
562562/// To print literal curly braces, escape them by writing them twice, e.g. `{{` or `}}`.
563///
564/// Asserts `buffer` capacity of at least 2 if a union is printed. This
565/// requirement could be lifted by adjusting the code, but if you trigger that
566/// assertion it is a clue that you should probably be using a buffer.
563567pub fn print(w: *Writer, comptime fmt: []const u8, args: anytype) Error!void {
564568 const ArgsType = @TypeOf(args);
565569 const args_type_info = @typeInfo(ArgsType);
......@@ -930,6 +934,7 @@ pub fn printAddress(w: *Writer, value: anytype) Error!void {
930934 @compileError("cannot format non-pointer type " ++ @typeName(T) ++ " with * specifier");
931935}
932936
937/// Asserts `buffer` capacity of at least 2 if `value` is a union.
933938pub fn printValue(
934939 w: *Writer,
935940 comptime fmt: []const u8,