Example yunq implementation for one Yellowstone endpoint.
This commit is contained in:
parent
51d40f6db6
commit
3eea4d811a
11 changed files with 301 additions and 3 deletions
23
rust/lib/yunq/src/message.rs
Normal file
23
rust/lib/yunq/src/message.rs
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
use crate::buffer::ByteBuffer;
|
||||
use alloc::vec::Vec;
|
||||
use mammoth::syscall::z_cap_t;
|
||||
use mammoth::syscall::ZError;
|
||||
|
||||
pub const MESSAGE_IDENT: u32 = 0x33441122;
|
||||
|
||||
pub trait YunqMessage {
|
||||
fn parse<const N: usize>(
|
||||
buf: &ByteBuffer<N>,
|
||||
offset: usize,
|
||||
caps: &Vec<z_cap_t>,
|
||||
) -> Result<Self, ZError>
|
||||
where
|
||||
Self: Sized;
|
||||
|
||||
fn serialize<const N: usize>(
|
||||
&self,
|
||||
buf: &mut ByteBuffer<N>,
|
||||
offset: usize,
|
||||
caps: &mut Vec<z_cap_t>,
|
||||
) -> Result<usize, ZError>;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue