Implement Bincode
This commit is contained in:
parent
01dce2cd93
commit
b14c999294
|
@ -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"
|
12
src/lib.rs
12
src/lib.rs
|
@ -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),
|
||||
|
||||
|
|
Loading…
Reference in a new issue