#majordome #derive #enums #macro #required #msg #err

macro majordome-derive

Derive macros for the majordome crate

11 stable releases

1.0.10 Aug 3, 2024
1.0.9 Jul 22, 2024
1.0.8 Jul 21, 2024
1.0.4 Jul 18, 2024
1.0.2 May 5, 2024

#30 in #err

Download history 26/week @ 2024-09-21 16/week @ 2024-09-28 7/week @ 2024-10-12 2/week @ 2024-10-19 5/week @ 2024-11-02 2/week @ 2024-11-16 3/week @ 2024-11-23 1/week @ 2024-11-30 24/week @ 2024-12-07 1/week @ 2024-12-14 55/week @ 2024-12-28

56 downloads per month
Used in 3 crates (2 directly)

MIT license

32KB
648 lines

Majordome Errors Enums

#[derive(MajordomeError)]
#[err(prefix = "errors.gg.wls.")]
pub enum AuthError {
    #[err(code="invalid_token", msg="Invalid token", status=401)]
    InvalidToken,

    #[err(code="unknown_event", msg="Unknown event {id}", status=404)]
    UnknownEvent {id: String},

    #[err(code="not_enough_players", msg="Not enough players (required: {required}, actual: {actual})", status=400)]
    NotEnoughPlayers{required: u32, actual: u32},
}

Dependencies

~1.5MB
~38K SLoC