2025-01-26 12:09:56 +01:00
|
|
|
use std::io;
|
2025-02-01 17:31:13 +01:00
|
|
|
use std::io::{Read, Write};
|
2025-01-26 12:09:56 +01:00
|
|
|
use std::string::FromUtf8Error;
|
|
|
|
|
use thiserror::Error;
|
|
|
|
|
|
|
|
|
|
//ideas for the future: make a proc macro library which allows generation of struct reads
|
|
|
|
|
|
|
|
|
|
#[derive(Error, Debug)]
|
|
|
|
|
pub enum Error{
|
|
|
|
|
#[error("Io Error: {0}")]
|
|
|
|
|
Io(#[from] io::Error),
|
|
|
|
|
#[error("UTF8 conversion Error: {0}")]
|
|
|
|
|
Utf8(#[from] FromUtf8Error)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type Result<T> = std::result::Result<T, Error>;
|
|
|
|
|
|
|
|
|
|
pub mod string;
|
2025-01-26 23:21:35 +01:00
|
|
|
pub mod any;
|
2025-02-02 20:25:22 +01:00
|
|
|
pub mod qresult;
|
|
|
|
|
pub mod buffer;
|
|
|
|
|
pub mod connection_data;
|
|
|
|
|
pub mod rmc_struct;
|
|
|
|
|
pub mod list;
|
2025-02-04 17:08:04 +01:00
|
|
|
pub mod qbuffer;
|
2025-01-26 23:21:35 +01:00
|
|
|
|
|
|
|
|
pub trait RmcSerialize: Sized{
|
|
|
|
|
fn serialize(&self, writer: &mut dyn Write) -> Result<()>;
|
|
|
|
|
fn deserialize(reader: &mut dyn Read) -> Result<Self>;
|
|
|
|
|
}
|