wa-rs-derive 0.2.0

Derive macros for wacore protocol types
Documentation
  • Coverage
  • 100%
    4 out of 4 items documented0 out of 3 items with examples
  • Size
  • Source code size: 22.36 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 341.91 kB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 5s Average build duration of successful builds.
  • all releases: 5s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • homun-app/wa-rs
    8 3 1
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • fabiocantone

Derive macros for wa_rs_core protocol types.

This crate provides derive macros for implementing the ProtocolNode trait on structs that represent WhatsApp protocol nodes.

Example

use wa_rs_derive::{ProtocolNode, StringEnum};

/// A query request node.
/// Wire format: `<query request="interactive"/>`
#[derive(ProtocolNode)]
#[protocol(tag = "query")]
pub struct QueryRequest {
    #[attr(name = "request", default = "interactive")]
    pub request_type: String,
}

/// An enum with string representation.
#[derive(StringEnum)]
pub enum MemberAddMode {
    #[str = "admin_add"]
    AdminAdd,
    #[str = "all_member_add"]
    AllMemberAdd,
}