feat(auth): finish protocol 10 method 2 and 3

This commit is contained in:
DJMrTV 2025-02-02 20:25:22 +01:00
commit d18ba43aed
24 changed files with 490 additions and 43 deletions

View file

@ -17,6 +17,15 @@ impl RmcSerialize for String{
Ok(String::from_utf8(data)?)
}
fn serialize(&self, writer: &mut dyn Write) -> Result<()> {
(&self[..]).serialize(writer)
}
}
impl RmcSerialize for &str{
fn deserialize(mut reader: &mut dyn Read) -> Result<Self> {
panic!("cannot serialize to &str")
}
fn serialize(&self, writer: &mut dyn Write) -> Result<()> {
let u16_len: u16 = self.len() as u16;
writer.write(bytes_of(&u16_len))?;