1#![ doc = include_str!( concat!( env!( "CARGO_MANIFEST_DIR" ), "/", "README.md" ) ) ]
2#![deny(missing_docs)]
3pub mod buf;
5pub mod cell;
7pub mod channel;
9pub mod channel_async;
11pub mod data_policy;
13pub mod event_map;
15#[cfg(target_os = "linux")]
17pub mod pi;
18pub mod policy_channel;
20pub mod policy_channel_async;
22#[cfg(not(target_os = "linux"))]
23pub use parking_lot_rt as locking;
24#[cfg(target_os = "linux")]
25pub use pi as locking;
26pub mod semaphore;
28pub mod system;
30pub mod time;
32pub use bma_ts;
34pub mod base_channel;
36pub mod base_channel_async;
38pub mod condvar_api;
40pub mod ops;
42pub mod pdeque;
44pub mod thread_rt;
46
47pub use base_channel::DataChannel;
48
49pub use rtsc_derive::DataPolicy;
50
51#[derive(thiserror::Error, Debug)]
53pub enum Error {
54 #[error("channel full")]
56 ChannelFull,
57 #[error("channel message skipped")]
60 ChannelSkipped,
61 #[error("channel closed")]
63 ChannelClosed,
64 #[error("channel closed")]
66 ChannelEmpty,
67 #[error("not implemented")]
69 Unimplemented,
70 #[error("timed out")]
72 Timeout,
73 #[error("Invalid data")]
75 InvalidData(String),
76 #[error("operation failed: {0}")]
78 Failed(String),
79 #[error("access denied")]
81 AccessDenied,
82 #[error("I/O error: {0}")]
84 IO(#[from] std::io::Error),
85 #[error("CPU affinity set error: {0}")]
87 RTSchedSetAffinity(String),
88 #[error("Real-time priority set error: {0}")]
90 RTSchedSetScheduler(String),
91}
92
93pub type Result<T> = std::result::Result<T, Error>;