Skip to main content

ninep_proto/
lib.rs

1#![cfg_attr(not(feature = "std"), no_std)]
2
3//! 9P2000.L wire protocol with owned and allocation-free codecs.
4//!
5//! Shared by the ZeroFS 9P server and the `ninep-client` crate so both sides
6//! speak the exact same messages. Includes the ZeroFS-private `Trebind`/`Rrebind`
7//! reconnect extension.
8//!
9//! All supported messages use [`slice_codec`]. It encodes into caller-owned
10//! buffers and decodes borrowed views without allocating. The owned API uses
11//! `Bytes` storage, so decoded strings and payloads share the received frame.
12//! With default features disabled, the codec requires only `core`. The `owned`
13//! feature adds the userspace API in `no_std + alloc` environments.
14
15#[cfg(feature = "owned")]
16extern crate alloc;
17#[cfg(all(test, not(feature = "std")))]
18extern crate std;
19
20#[cfg(feature = "owned")]
21mod lock_range;
22#[cfg(feature = "owned")]
23mod protocol;
24pub mod retry;
25pub mod slice_codec;
26mod wire_messages;
27pub use slice_codec::{CodecError, LockType};
28mod wire_types;
29
30#[cfg(feature = "owned")]
31pub use lock_range::*;
32#[cfg(feature = "owned")]
33pub use protocol::*;
34pub use wire_types::*;