| ... | @@ -35,6 +35,14 @@ pub const Preopen = struct { | ... | @@ -35,6 +35,14 @@ pub const Preopen = struct { |
| 35 | .@"type" = .{ .Dir = path }, | 35 | .@"type" = .{ .Dir = path }, |
| 36 | }; | 36 | }; |
| 37 | } | 37 | } |
| | 38 | |
| | 39 | pub fn format(self: Self, comptime fmt: []const u8, options: std.fmt.FormatOptions, out_stream: var) !void { |
| | 40 | try out_stream.print("{{ .fd = {}, ", .{self.fd}); |
| | 41 | switch (self.@"type") { |
| | 42 | PreopenType.Dir => |path| try out_stream.print(".Dir = '{}'", .{path}), |
| | 43 | } |
| | 44 | return out_stream.print(" }}", .{}); |
| | 45 | } |
| 38 | }; | 46 | }; |
| 39 | | 47 | |
| 40 | /// Dynamically-sized array list of WASI preopens. This struct is a | 48 | /// Dynamically-sized array list of WASI preopens. This struct is a |