#minecraft

macro sandstone-derive

Derive package for minecraft protocol traits

2 releases

0.1.1 Jun 24, 2024
0.1.0 Jun 2, 2024

#280 in #minecraft


Used in sandstone

MIT license

5KB
76 lines

sandstone-derive

This is a support package for my other project, sandstone. It provides a procedural macro for deriving the necessary traits for the sandstone library.

This package enables derives for the McSerialize and McDeserialize traits from the sandstone library.

Example

#[derive(McSerialize, McDeserialize)]
pub struct TestStruct {
    pub field1: i32,
    pub field2: String,
}

This will create mc_serialize and mc_deserialize implementations for the struct TestStruct. This allows it to be sent over the minecraft protocol.

This package is meant to be used in conjunction with the sandstone library, and is not intended to be used on its own.

Dependencies

~240–690KB
~16K SLoC