enum Mode [src]
Alias for std.fs.File.Reader.Mode
Fields
streaming
positional
streaming_readingAvoid syscalls other than read and readv.
positional_readingAvoid syscalls other than pread and preadv.
failureIndicates reading cannot continue because of a seek failure.
Members
- toReading (Function)
- toStreaming (Function)
Source
pub const Mode = enum {
streaming,
positional,
/// Avoid syscalls other than `read` and `readv`.
streaming_reading,
/// Avoid syscalls other than `pread` and `preadv`.
positional_reading,
/// Indicates reading cannot continue because of a seek failure.
failure,
pub fn toStreaming(m: @This()) @This() {
return switch (m) {
.positional, .streaming => .streaming,
.positional_reading, .streaming_reading => .streaming_reading,
.failure => .failure,
};
}
pub fn toReading(m: @This()) @This() {
return switch (m) {
.positional, .positional_reading => .positional_reading,
.streaming, .streaming_reading => .streaming_reading,
.failure => .failure,
};
}
}