forge
Explore
Log in

Don't you dare go Hollow

forge

Clone
★ 0

0 watching0 forksRustAGPL-3.09.4 MiBe910f7eTahinli8 hours ago361 commits

lib.rs72 lines, 1.7 KiBHistoryRawDownload
1macro_rules! string_enum {
2 ($name:ident { $($variant:ident = $text:literal),+ $(,)? }) => {
3 impl $name {
4 pub const fn as_str(self) -> &'static str {
5 match self {
6 $(Self::$variant => $text),+
7 }
8 }
9 }
10
11 impl std::str::FromStr for $name {
12 type Err = crate::error::Error;
13
14 fn from_str(s: &str) -> std::result::Result<Self, Self::Err> {
15 match s {
16 $($text => Ok(Self::$variant),)+
17 other => Err(crate::error::Error::Invalid(format!(
18 "{}: {other:?}",
19 stringify!($name)
20 ))),
21 }
22 }
23 }
24 };
25}
26
27pub mod alerts;
28pub mod audit;
29pub mod authz;
30pub mod avatar;
31pub mod ci;
32pub mod config;
33pub mod error;
34pub mod issue_refs;
35pub mod issues;
36pub mod lfs_token;
37pub mod mail;
38pub mod merge_queue;
39pub mod mirrors;
40pub mod model;
41pub mod names;
42pub mod notifications;
43pub mod password;
44pub mod protection;
45pub mod pulls;
46pub mod raw_token;
47pub mod reactions;
48pub mod releases;
49pub mod reviews;
50pub mod secret;
51pub mod server_settings;
52pub mod signed_token;
53pub mod store;
54pub mod suggestions;
55pub mod time;
56pub mod token;
57pub mod totp;
58pub mod tz;
59pub mod webhooks;
60
61pub use audit::*;
62pub use authz::{Action, Denied, authorize};
63pub use config::{Config, Registration};
64pub use error::{Error, Result};
65pub use issues::*;
66pub use model::*;
67pub use notifications::*;
68pub use pulls::*;
69pub use reactions::{Reaction, ReactionMap, ReactionSummary, ReactionTarget};
70pub use reviews::*;
71pub use store::Store;
72pub use store::edit_history_read::{EditTarget, EditVersion};