Add stream proxy types to allow user code to store generic streams.
This commit is contained in:
parent
dae1ca71b5
commit
df4022d83e
|
@ -17,6 +17,7 @@
|
|||
module vibe.core.stream;
|
||||
|
||||
import vibe.internal.traits : checkInterfaceConformance, validateInterfaceConformance;
|
||||
import vibe.internal.interfaceproxy;
|
||||
import core.time;
|
||||
import std.algorithm;
|
||||
import std.conv;
|
||||
|
@ -275,6 +276,19 @@ final class NullOutputStream : OutputStream {
|
|||
void finalize() {}
|
||||
}
|
||||
|
||||
|
||||
/// Generic storage for types that implement the `InputStream` interface
|
||||
alias InputStreamProxy = InterfaceProxy!InputStream;
|
||||
/// Generic storage for types that implement the `OutputStream` interface
|
||||
alias OutputStreamProxy = InterfaceProxy!OutputStream;
|
||||
/// Generic storage for types that implement the `Stream` interface
|
||||
alias StreamProxy = InterfaceProxy!Stream;
|
||||
/// Generic storage for types that implement the `ConnectionStream` interface
|
||||
alias ConnectionStreamProxy = InterfaceProxy!ConnectionStream;
|
||||
/// Generic storage for types that implement the `RandomAccessStream` interface
|
||||
alias RandomAccessStreamProxy = InterfaceProxy!RandomAccessStream;
|
||||
|
||||
|
||||
/** Tests if the given aggregate type is a valid input stream.
|
||||
|
||||
See_also: `validateInputStream`
|
||||
|
|
Loading…
Reference in a new issue