mountos_native/wire.rs
1//! Protobuf messages for package mountos.filesystem.v1, generated by build.rs
2//! from api/proto/mountos_fs.proto. Method IDs and result types come from
3//! the generated ops_gen module, open flags are constants from api/filesystem.yaml.
4
5include!(concat!(env!("OUT_DIR"), "/mountos.filesystem.v1.rs"));
6
7pub use crate::ops_gen::{method, StatfsInfo};
8
9/// Open flags. The low two bits are the access mode, 3 is invalid.
10pub mod open_flag {
11 pub const READ_ONLY: u32 = 0;
12 pub const WRITE_ONLY: u32 = 1;
13 pub const READ_WRITE: u32 = 2;
14 pub const CREATE: u32 = 64;
15 pub const EXCL: u32 = 128;
16 pub const TRUNC: u32 = 512;
17 pub const APPEND: u32 = 1024;
18}
19
20impl Range {
21 /// A byte range of `length` bytes from `offset`, for `File::read_batch`.
22 pub fn new(offset: i64, length: u32) -> Range {
23 Range { offset, length }
24 }
25}