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).

Members

Aliases

ClosableRandomAccessStreamProxy
alias ClosableRandomAccessStreamProxy = InterfaceProxy!ClosableRandomAccessStream

Generic storage for types that implement the RandomAccessStream interface

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

TruncatableStreamProxy
alias TruncatableStreamProxy = InterfaceProxy!TruncatableStream

Generic storage for types that implement the RandomAccessStream interface

Classes

NullOutputStream
class NullOutputStream

Stream implementation acting as a sink with no function.

Enums

PipeMode
enum PipeMode
Undocumented in source.
isClosableRandomAccessStream
eponymoustemplate isClosableRandomAccessStream(T)

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

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.

isTruncatableStream
eponymoustemplate isTruncatableStream(T)

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

Functions

nullSink
NullOutputStream nullSink()

Returns a NullOutputStream instance.

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

Pipes an InputStream directly into this OutputStream.

Imports

IOMode (from eventcore.driver)
public import eventcore.driver : IOMode;
Undocumented in source.

Interfaces

ClosableRandomAccessStream
interface ClosableRandomAccessStream

Random access stream with support for explicit closing.

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.

TruncatableStream
interface TruncatableStream

Extended form of a RandomAccessStream that supports truncation/extension.

Mixin templates

validateClosableRandomAccessStream
mixintemplate validateClosableRandomAccessStream(T)

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

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.

validateTruncatableStream
mixintemplate validateTruncatableStream(T)

Verifies that the given type is a valid truncatable random access 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