Remove the old leaf declaration path

Delete the deprecated Leaf derive path, migrate the remaining tests and example to leaf!, and add direct coverage for endpoint-only, TUI-only, and shared-host leaf declarations.
This commit is contained in:
Michael Mikovsky
2026-04-26 14:14:49 -06:00
parent 0aa0b187d7
commit 54c44b407e
17 changed files with 284 additions and 380 deletions
+1 -1
View File
@@ -12,7 +12,7 @@ pub extern crate alloc;
use unshell_protocol::DataMessage;
pub use unshell_macros::{Leaf, Procedure, leaf, procedures};
pub use unshell_macros::{Procedure, leaf, procedures};
pub use unshell_protocol as protocol;
/// Re-exports one role-specific type behind a stable public alias.
+19
View File
@@ -6,6 +6,8 @@
//! - `leaf_tui` builds a placeholder client-side TUI surface
use rkyv::{Archive, Deserialize, Serialize};
#[cfg(not(feature = "leaf_endpoint"))]
use std::string::String;
#[cfg(feature = "leaf_endpoint")]
pub mod endpoint;
@@ -24,6 +26,23 @@ pub use tui::RemoteShellTui;
/// not built, so the leaf declaration still validates its declared inventory.
pub struct Open;
#[cfg(not(feature = "leaf_endpoint"))]
#[doc(hidden)]
pub struct RemoteShellDeclarationPlaceholder;
#[cfg(not(feature = "leaf_endpoint"))]
impl crate::protocol::tree::ProtocolLeaf for RemoteShellDeclarationPlaceholder {
fn leaf_name() -> String {
String::from("remote_shell")
}
}
#[cfg(not(feature = "leaf_endpoint"))]
impl crate::protocol::tree::ProcedureMetadata for Open {
type Leaf = RemoteShellDeclarationPlaceholder;
const PROCEDURE_SUFFIX: &'static str = "open";
}
/// Open-request payload for the remote shell leaf.
///
/// The shell currently needs no structured arguments, but a named payload type is