mountos_native/lib.rs
1//! Blocking client for the mountOS native filesystem API over a Unix socket.
2//!
3//! ```no_run
4//! let c = mountos_native::Client::connect("/home/me/.mountOS/sockets/mountos_api_0123456789abcdef.sock")?;
5//! let f = c.open("/a.txt", mountos_native::open_flag::READ_ONLY, 0)?;
6//! let data = f.read_at(0, 4096)?;
7//! # Ok::<(), mountos_native::Error>(())
8//! ```
9//!
10//! The server pushes notices (warm results, watch changes, closing) on the connection that made
11//! the call. A reader thread per connection receives them, and `Client::add_listener` hands every
12//! event to your listeners in order. `Client::wait_warm` and `Client::watch` build on the same
13//! events. With no listener, events go to the logger in `Options`, or to stderr.
14
15mod bulk;
16mod client;
17mod dir;
18mod error;
19mod events;
20mod file;
21pub mod frame;
22mod ops_gen;
23mod socket;
24mod walk;
25mod watch;
26pub mod wire;
27
28pub use bulk::StatResult;
29pub use client::{Client, ClientOptions, Options, DEFAULT_MAX_INFLIGHT};
30pub use dir::Dir;
31pub use error::{Error, Result};
32pub use events::{ChangeKind, Event, EventKind, ListenerId, Logger};
33pub use file::{File, WriteItem};
34pub use socket::socket_path;
35pub use walk::{DEFAULT_MAX_DIR_ENTRIES, DEFAULT_MAX_WALK_PENDING};
36pub use watch::Watch;
37pub use wire::{open_flag, DirEntry, FileInfo, FileType, Range, StatfsInfo};