2025-02-02 20:25:22 +01:00
|
|
|
use std::io::{Read, Write};
|
|
|
|
|
use bytemuck::bytes_of;
|
|
|
|
|
use crate::kerberos::KerberosDateTime;
|
|
|
|
|
use crate::rmc::structures::{rmc_struct, RmcSerialize};
|
|
|
|
|
|
|
|
|
|
pub struct ConnectionData<'a>{
|
|
|
|
|
pub station_url: &'a str,
|
|
|
|
|
pub special_protocols: Vec<u8>,
|
|
|
|
|
pub special_station_url: &'a str,
|
|
|
|
|
pub date_time: KerberosDateTime
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
impl<'a> RmcSerialize for ConnectionData<'a>{
|
|
|
|
|
fn serialize(&self, writer: &mut dyn Write) -> crate::rmc::structures::Result<()> {
|
2025-02-07 08:46:09 +01:00
|
|
|
rmc_struct::write_struct(writer, 1, |v|{
|
2025-02-02 20:25:22 +01:00
|
|
|
self.station_url.serialize(v).expect("unable to write station url");
|
|
|
|
|
self.special_protocols.serialize(v).expect("unable to write special protocols");
|
|
|
|
|
self.special_station_url.serialize(v).expect("unable to write special station url");
|
|
|
|
|
v.write_all(bytes_of(&self.date_time)).expect("unable to write date time");
|
2025-02-05 15:03:08 +01:00
|
|
|
|
|
|
|
|
Ok(())
|
2025-02-02 20:25:22 +01:00
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
2025-02-07 08:48:22 +01:00
|
|
|
fn deserialize(_reader: &mut dyn Read) -> crate::rmc::structures::Result<Self> {
|
2025-02-02 20:25:22 +01:00
|
|
|
todo!()
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|