Skip to main content

air_sys_types/
lib.rs

1// This Source Code Form is subject to the terms of the Mozilla Public
2// License, v. 2.0. If a copy of the MPL was not distributed with this
3// file, You can obtain one at https://mozilla.org/MPL/2.0/.
4
5//! Types fondamentaux de la couche 0 d'Air.
6//!
7//! Cette crate expose les newtypes, wrappers RAII, bitflags et enums typés
8//! qui sous-tendent toute la couche 0 (cf. `docs/specs/layer-0/air-sys-types.md`).
9//! Une seule dépendance externe : `bitflags` (sous régime de `docs/EXCEPTIONS.md`).
10//!
11//! **Familles couvertes :** `process`, `signal`, `time`, `ipc`, `mem`,
12//! `fs`, `net`, `poll`, `futex`, `security`, `system`.
13
14// Les lints couche 0 (cast_possible_truncation/sign_loss/lossless/
15// arithmetic_side_effects en deny + unsafe_op_in_unsafe_fn en forbid) sont
16// hérités automatiquement depuis `[workspace.lints]` de la racine via
17// `[lints] workspace = true` dans le Cargo.toml. Aucun `#![…]` redondant ici.
18// Couche 0 `std`-free (Principe 4, ADR-048) : `#![no_std]` pour le code lib
19// **livré** (`cargo build` ⇒ preuve par le compilateur qu'aucun `std` ne subsiste).
20// Sous `cfg(test)`, la crate redevient `std` pour que le harnais de test et ses
21// modules `#[cfg(test)]` gardent le prélude `std` (Principe 1 — tests inchangés).
22#![cfg_attr(not(test), no_std)]
23#![deny(missing_docs)]
24
25// `alloc` fournit les types possédés (`Vec`, `String`, `CString`, `Arc`…) ;
26// aucun `std` en code lib. Les ponts FD transitoires (`feature = "std"`) lient
27// `std` explicitement, mais uniquement hors test (sous test la crate est déjà `std`).
28extern crate alloc;
29#[cfg(all(feature = "std", not(test)))]
30extern crate std;
31
32pub mod device;
33pub mod ebpf;
34pub mod errno;
35pub mod fd;
36pub mod fs;
37pub mod futex;
38pub mod io_uring;
39pub mod ipc;
40pub mod mem;
41pub mod net;
42pub mod poll;
43pub mod process;
44pub mod security;
45pub mod signal;
46pub mod system;
47pub mod terminal;
48pub mod time;
49
50pub use crate::device::{
51    AbsAxis, EventClock, EventType, InputAbsInfo, InputEvent, InputId,
52    UEVENT_RECOMMENDED_BUFFER_SIZE, UEventAction, UEventGroups, UEventMessage, UEventProperties,
53    UEventSocketFlags,
54};
55pub use crate::ebpf::{
56    BpfAttachFlags, BpfAttachType, BpfBtfLoadFlags, BpfInstruction, BpfLinkCreateRequest,
57    BpfMapBatchInput, BpfMapBatchRequest, BpfMapBtfInfo, BpfMapCreateFlags, BpfMapCreateRequest,
58    BpfMapLookupFlags, BpfMapType, BpfMapUpdateFlags, BpfObjectGetFlags, BpfProgramLoadFlags,
59    BpfProgramLoadRequest, BpfProgramQueryRequest, BpfProgramTestRunRequest,
60    BpfProgramTestRunResult, BpfProgramType, BpfStatsType, BpfTaskFdQueryRequest,
61    BpfVerifierLogLevel, PerfEventAttr, PerfEventOpenFlags, PerfEventScope, PerfHardwareCounter,
62    PerfSoftwareCounter, PerfTypeId,
63};
64pub use crate::errno::Errno;
65pub use crate::fd::{BorrowedFd, OwnedFd, RawFd};
66pub use crate::futex::{FutexScope, FutexWakeCount};
67pub use crate::io_uring::{CompletionFlags, IoUringOpcode, SetupFlags};
68pub use crate::ipc::{EventFdFlags, PipeFlags, SpliceFlags};
69pub use crate::net::{IoSlice, IoSliceMut};
70pub use crate::poll::{PollEvents, PollFd};
71pub use crate::process::{
72    Capability, CapabilityMask, CapabilitySet, CapabilityTarget, CloneArgs, CloneFlags,
73    CloneResult, DumpableMode, Dup3Flags, ExecveatFlags, Gid, Pid, PidFd, PidFdOpenFlags, ResGid,
74    ResUid, Resource, Rlimit, RlimitValue, Rusage, RusageWho, StackSpecification, Tid, TidReceiver,
75    Timeval, Uid, WaitEvent, WaitOptions, WaitStatus, WaitTarget,
76};
77pub use crate::signal::{
78    AltStack, SS_DISABLE, SS_ONSTACK, Signal, SignalFdFlags, SignalFdInfo, SignalInfo, SignalMask,
79    SignalValue,
80};
81pub use crate::system::{GetrandomFlags, SystemInfo, UtsName};
82pub use crate::terminal::{
83    BaudRate, CharSize, ControlChar, ControlFlags, FlowAction, FlushQueue, InputFlags, LocalFlags,
84    NCCS, OutputFlags, PtyNumber, SetAction, Termios, Winsize,
85};
86pub use crate::time::{
87    Clock, Instant, SleepDeadline, SleepError, TimerFdFlags, TimerFdSpecification, TimerSetFlags,
88};