# \(breaking\) rework stream abstractions · gitcafe/zig

[View on GitCafe](https://git.cafe/gitcafe/zig/commit/ba0e3be5cfa2f60f2f9d2a4eb319408f972796c2)

Repository: [gitcafe/zig](https://git.cafe/gitcafe/zig)

Visibility: public

Requested revision: ba0e3be5cfa2f60f2f9d2a4eb319408f972796c2

Requested commit: ba0e3be5cfa2f60f2f9d2a4eb319408f972796c2

Commit: ba0e3be5cfa2f60f2f9d2a4eb319408f972796c2

Tree: da35c17d0067a463b521163f624f3d109b8050f4

Author: Andrew Kelley

Committer: Andrew Kelley

## Message

```
(breaking) rework stream abstractions

The main goal here is to make the function pointers comptime, so that we
don't have to do the crazy stuff with async function frames.

Since InStream, OutStream, and SeekableStream are already generic
across error sets, it's not really worse to make them generic across the
vtable as well.

See #764 for the open issue acknowledging that using generics for these
abstractions is a design flaw.

See #130 for the efforts to make these abstractions non-generic.

This commit also changes the OutStream API so that `write` returns
number of bytes written, and `writeAll` is the one that loops until the
whole buffer is written.

```

## Parents

- [1ad831a0ef22f354d4e1dd5073456a0683249846](https://git.cafe/gitcafe/zig/commit/1ad831a0ef22f354d4e1dd5073456a0683249846?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zig/tree/ba0e3be5cfa2f60f2f9d2a4eb319408f972796c2?format=markdown)
