Implement Bincode

master
Able 2022-01-15 09:27:15 -06:00
parent f69d05deb7
commit b3c2588048
Signed by: able
GPG Key ID: D164AF5F5700BE51
2 changed files with 11 additions and 4 deletions

View File

@ -1,8 +1,9 @@
[package]
name = "y-compositor-protocol"
version = "0.1.0"
version = "0.1.1"
edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
bincode = "2.0.0-beta.0"

View File

@ -1,18 +1,23 @@
use bincode::{Decode, Encode};
#[derive(Encode, Decode, PartialEq, Debug)]
pub struct WindowOption {
funct: WindowFunction,
// funct: WindowFunction,
symbol: char,
}
// #[derive(Encode, Decode, PartialEq, Debug)]
pub type WindowBar = Vec<WindowOption>;
pub type WindowID = u64;
#[derive(Encode, Decode, PartialEq, Debug)]
pub struct Window {
bar: WindowBar,
}
// TODO: Seperate out this versioning into ableos-ver
#[repr(C)]
#[derive(Encode, Decode, PartialEq, Debug)]
pub struct Version {
pub major: u8,
pub minor: u8,
@ -21,6 +26,7 @@ pub struct Version {
pub type WindowFunction = fn() -> ();
#[derive(Encode, Decode, PartialEq, Debug)]
pub enum Protocol {
Version(Version),