server/
lib.rs

1// SPDX-FileCopyrightText: 2023 Foundation Devices, Inc. <hello@foundation.xyz>
2// SPDX-License-Identifier: GPL-3.0-or-later
3
4//! A type-safe way to implement KeyOS servers.
5
6mod archive;
7mod blocking_archive;
8mod checked_conn;
9mod deferred;
10mod definitions;
11mod error;
12mod event;
13mod lend_mut;
14mod macros;
15mod r#move;
16mod owned;
17mod scalar;
18mod server;
19mod utils;
20
21pub mod rkyv_with;
22
23pub use archive::*;
24pub use blocking_archive::*;
25pub use checked_conn::*;
26pub use deferred::*;
27pub use definitions::*;
28pub use error::*;
29pub use event::*;
30pub use lend_mut::*;
31pub use owned::*;
32pub use r#move::*;
33pub use scalar::*;
34pub use server::*;
35pub use server_macro::*;
36// Re-export related modules so other crates don't need to depend on them directly.
37pub use {xous, xous_ipc, xous_names};
38
39pub(crate) fn next_dynamic_message_id() -> xous::MessageId {
40    use std::sync::atomic::AtomicUsize;
41    static DYNAMIC_MESSAGE_ID: AtomicUsize = AtomicUsize::new(0x10000);
42
43    DYNAMIC_MESSAGE_ID.fetch_add(1, std::sync::atomic::Ordering::SeqCst)
44}