xous_api_names/api/rkyv_enum.rs
1// As of Rust 1.64.0:
2//
3// Rkyv-derived enums throw warnings that rkyv::Archive derived enums are never used
4// and I can't figure out how to make them go away. Since they spam the build log,
5// rkyv-derived enums are now isolated to their own file with a file-wide `dead_code`
6// allow on top.
7//
8// This might be a temporary compiler regression, or it could just
9// be yet another indicator that it's time to upgrade rkyv. However, we are waiting
10// until rkyv hits 0.8 (the "shouldn't ever change again but still not sure enough
11// for 1.0") release until we rework the entire system to chase the latest rkyv.
12// As of now, the current version is 0.7.x and there isn't a timeline yet for 0.8.
13#![allow(dead_code)]
14use crate::api::AuthenticateRequest;
15
16#[derive(Debug, rkyv::Archive, rkyv::Serialize, rkyv::Deserialize)]
17#[repr(C)]
18pub enum Return {
19 /// The caller must perform an AuthenticatedLookup using this challenge
20 AuthenticateRequest(AuthenticateRequest),
21
22 /// The connection failed for some reason
23 Failure,
24
25 /// A server was successfully created with the given SID
26 SID([u32; 4]),
27
28 /// A connection was successfully made with the given CID; an optional "disconnect token" is provided
29 CID((xous::CID, Option<[u32; 4]>)),
30
31 /// Operation requested was otherwise successful (currently only used by disconnect to ack the
32 /// disconnect)
33 Success,
34}