mirror of
https://github.com/Astatin3/unshell.git
synced 2026-06-08 22:38:01 -06:00
Add "LeafMeta" struct to leaf
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user