use super::*;
#[derive(Debug, Clone, Eq, PartialEq)]
pub struct ClientEvent {
pub name: CString,
pub props: Props,
}
impl TagStructRead for ClientEvent {
fn read(ts: &mut TagStructReader<'_>, _protocol_version: u16) -> Result<Self, ProtocolError> {
Ok(Self {
name: ts.read_string_non_null()?,
props: ts.read()?,
})
}
}
impl TagStructWrite for ClientEvent {
fn write(
&self,
ts: &mut TagStructWriter<'_>,
_protocol_version: u16,
) -> Result<(), ProtocolError> {
ts.write_string(Some(&self.name))?;
ts.write(&self.props)?;
Ok(())
}
}