Add "LeafMeta" struct to leaf

This commit is contained in:
Michael Mikovsky
2026-05-31 10:26:57 -06:00
parent 0a44bc93de
commit f595b5aa98
11 changed files with 1576 additions and 374 deletions
+23
View File
@@ -1,5 +1,8 @@
use crate::protocol::{Endpoint, Leaf, Packet};
#[cfg(feature = "interface")]
use crate::protocol::LeafMeta;
use alloc::{boxed::Box, format, vec, vec::Vec};
use super::support::{CommsLeaf, ENDPOINT_A, ENDPOINT_B, assert_hook_present, assert_hook_removed};
@@ -82,6 +85,16 @@ impl Leaf for StreamCallerLeaf {
LEAF_STREAM_CALLER
}
#[cfg(feature = "interface")]
fn get_meta(&self) -> LeafMeta {
LeafMeta {
name: "Stream Caller Leaf",
identifier: "dev.unshell.test.stream_caller_leaf",
version: "v0",
authors: vec!["ASTATIN3"],
}
}
fn update(&mut self, endpoint: &mut Endpoint) {
if self.has_run {
return;
@@ -98,6 +111,16 @@ impl Leaf for StreamRespondentLeaf {
LEAF_STREAM_RESPONDENT
}
#[cfg(feature = "interface")]
fn get_meta(&self) -> LeafMeta {
LeafMeta {
name: "Stream Respondant Leaf",
identifier: "dev.unshell.test.stream_respondent_leaf",
version: "v0",
authors: vec!["ASTATIN3"],
}
}
fn update(&mut self, endpoint: &mut Endpoint) {
self.open_stream_from_pending_request(endpoint);
self.send_next_frame(endpoint);