aboutsummaryrefslogtreecommitdiff
path: root/src/z/Env/Future.zig
diff options
context:
space:
mode:
Diffstat (limited to 'src/z/Env/Future.zig')
-rw-r--r--src/z/Env/Future.zig34
1 files changed, 0 insertions, 34 deletions
diff --git a/src/z/Env/Future.zig b/src/z/Env/Future.zig
deleted file mode 100644
index 1e28ac7..0000000
--- a/src/z/Env/Future.zig
+++ /dev/null
@@ -1,34 +0,0 @@
-const std = @import("std");
-const Env = @import("root.zig");
-const z = @import("../root.zig");
-
-const Self = @This();
-
-result: *Env.Value,
-
-pub fn await(self: *const Self, env: *Env, comptime kind: Env.Value.Kind) kind.asType() {
- const result = self.awaitAny(env);
-
- if (kind != result.kind) {
- std.log.err("unexpected {}, expected {}", .{result.kind, kind});
- @panic("type error");
- }
-
- return switch (kind) {
- .uninit => @panic("uninitialized result"),
- .string => result.value.string.ptr[0..result.value.string.len],
- else => @field(result.value, @tagName(kind)),
- };
-}
-
-pub fn awaitAny(self: *const Self, env: *Env) Env.Value {
- defer env.pool.destroy(self.result);
-
- if (self.result.kind != .uninit) {
- return self.result.*;
- }
-
- env.flush();
-
- return self.result.*;
-}