Implement Bincode

This commit is contained in:
Able 2022-01-15 09:27:15 -06:00
parent 01dce2cd93
commit b14c999294
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),