2021-04-12 05:32:13 +00:00
|
|
|
pub(crate) const SERVER_NAME: &str = "_Callback test server_";
|
|
|
|
|
|
|
|
|
|
#[derive(Debug, num_derive::FromPrimitive, num_derive::ToPrimitive)]
|
2021-04-12 21:10:00 +00:00
|
|
|
pub(crate) enum Opcode {
|
|
|
|
|
RegisterTickListener,
|
2021-04-13 08:46:49 +00:00
|
|
|
RegisterReqListener,
|
2021-04-13 18:58:22 +00:00
|
|
|
UnregisterReqListener,
|
2021-04-12 21:10:00 +00:00
|
|
|
Tick,
|
2021-04-13 08:46:49 +00:00
|
|
|
Req,
|
2021-04-12 21:10:00 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#[derive(Debug, num_derive::FromPrimitive, num_derive::ToPrimitive)]
|
|
|
|
|
pub enum TickCallback {
|
2021-04-12 05:32:13 +00:00
|
|
|
Tick,
|
2021-04-12 21:10:00 +00:00
|
|
|
Drop,
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#[derive(Debug, num_derive::FromPrimitive, num_derive::ToPrimitive)]
|
2021-04-13 08:46:49 +00:00
|
|
|
pub enum ResultCallback {
|
|
|
|
|
Result,
|
2021-04-12 21:10:00 +00:00
|
|
|
Drop,
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#[derive(Debug, rkyv::Archive, rkyv::Serialize, rkyv::Deserialize, Copy, Clone)]
|
|
|
|
|
pub(crate) struct ScalarHook {
|
|
|
|
|
pub sid: (u32, u32, u32, u32),
|
|
|
|
|
pub id: u32, // ID of the scalar message to send through (e.g. the discriminant of the Enum on the caller's side API)
|
|
|
|
|
pub cid: xous::CID, // caller-side connection ID for the scalar message to route to. Created by the caller before hooking.
|
2021-04-12 05:32:13 +00:00
|
|
|
}
|