vibe.core.stream

Generic stream interface used by several stream-like classes.

This module defines the basic (buffered) stream primitives. For concrete stream types, take a look at the vibe.stream package. The vibe.stream.operations module contains additional high-level operations on streams, such as reading streams by line or as a whole.

Note that starting with vibe-core 1.0.0, streams can be of either struct or class type. Any APIs that take streams as a parameter should use a template type parameter that is tested using the appropriate trait (e.g. isInputStream) instead of assuming the specific interface type (e.g. InputStream).

Public Imports

eventcore.driver
public import eventcore.driver : IOMode;

Members

Aliases

ConnectionStreamProxy
alias ConnectionStreamProxy = InterfaceProxy!ConnectionStream

Generic storage for types that implement the ConnectionStream interface

InputStreamProxy
alias InputStreamProxy = InterfaceProxy!InputStream

Generic storage for types that implement the InputStream interface

OutputStreamProxy
alias OutputStreamProxy = InterfaceProxy!OutputStream

Generic storage for types that implement the OutputStream interface

RandomAccessStreamProxy
alias RandomAccessStreamProxy = InterfaceProxy!RandomAccessStream

Generic storage for types that implement the RandomAccessStream interface

StreamProxy
alias StreamProxy = InterfaceProxy!Stream

Generic storage for types that implement the Stream interface

Classes

NullOutputStream
class NullOutputStream

Stream implementation acting as a sink with no function.

Enums

isConnectionStream
eponymoustemplate isConnectionStream(T)

Tests if the given aggregate type is a valid connection stream.

isInputStream
eponymoustemplate isInputStream(T)

Tests if the given aggregate type is a valid input stream.

isOutputStream
eponymoustemplate isOutputStream(T)

Tests if the given aggregate type is a valid output stream.

isRandomAccessStream
eponymoustemplate isRandomAccessStream(T)

Tests if the given aggregate type is a valid random access stream.

isStream
eponymoustemplate isStream(T)

Tests if the given aggregate type is a valid bidirectional stream.

Functions

nullSink
NullOutputStream nullSink()

Returns a NullOutputStream instance.

pipe
ulong pipe(InputStream source, OutputStream sink, ulong nbytes)
ulong pipe(InputStream source, OutputStream sink)

Pipes an InputStream directly into this OutputStream.

Interfaces

ConnectionStream
interface ConnectionStream

Interface for streams based on a connection.

InputStream
interface InputStream

Interface for all classes implementing readable streams.

OutputStream
interface OutputStream

Interface for all classes implementing writeable streams.

RandomAccessStream
interface RandomAccessStream

Interface for all streams supporting random access.

Stream
interface Stream

Interface for all classes implementing readable and writable streams.

Mixin templates

validateConnectionStream
mixintemplate validateConnectionStream(T)

Verifies that the given type is a valid connection stream.

validateInputStream
mixintemplate validateInputStream(T)

Verifies that the given type is a valid input stream.

validateOutputStream
mixintemplate validateOutputStream(T)

Verifies that the given type is a valid output stream.

validateRandomAccessStream
mixintemplate validateRandomAccessStream(T)

Verifies that the given type is a valid random access stream.

validateStream
mixintemplate validateStream(T)

Verifies that the given type is a valid bidirectional stream.

Structs

blocking
struct blocking

Marks a function as blocking.

Meta

License

Subject to the terms of the MIT license, as written in the included LICENSE.txt file.

Authors

Sönke Ludwig