Skip to main content
KeyOS API Reference

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 buffer;
9mod checked_conn;
10mod deferred;
11mod definitions;
12mod error;
13mod event;
14mod lend_mut;
15mod macros;
16mod r#move;
17mod owned;
18mod rkyv_utils;
19mod scalar;
20mod server;
21
22pub use archive::*;
23pub use blocking_archive::*;
24pub use buffer::*;
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 rkyv_utils::*;
34pub use scalar::*;
35pub use server::*;
36pub use server_macro::*;
37// Re-export related modules so other crates don't need to depend on them directly.
38pub use {xous, xous_names};
39
40pub(crate) fn next_dynamic_message_id() -> xous::MessageId {
41    use std::sync::atomic::AtomicUsize;
42    static DYNAMIC_MESSAGE_ID: AtomicUsize = AtomicUsize::new(0x10000);
43
44    DYNAMIC_MESSAGE_ID.fetch_add(1, std::sync::atomic::Ordering::SeqCst)
45}