macro_rules! string_enum { ($name:ident { $($variant:ident = $text:literal),+ $(,)? }) => { impl $name { pub const fn as_str(self) -> &'static str { match self { $(Self::$variant => $text),+ } } } impl std::str::FromStr for $name { type Err = crate::error::Error; fn from_str(s: &str) -> std::result::Result { match s { $($text => Ok(Self::$variant),)+ other => Err(crate::error::Error::Invalid(format!( "{}: {other:?}", stringify!($name) ))), } } } }; } pub mod alerts; pub mod audit; pub mod authz; pub mod avatar; pub mod ci; pub mod config; pub mod error; pub mod issue_refs; pub mod issues; pub mod lfs_token; pub mod mail; pub mod merge_queue; pub mod mirrors; pub mod model; pub mod names; pub mod notifications; pub mod password; pub mod protection; pub mod pulls; pub mod raw_token; pub mod reactions; pub mod releases; pub mod reviews; pub mod secret; pub mod server_settings; pub mod signed_token; pub mod store; pub mod suggestions; pub mod time; pub mod token; pub mod totp; pub mod tz; pub mod webhooks; pub use audit::*; pub use authz::{Action, Denied, authorize}; pub use config::{Config, Registration}; pub use error::{Error, Result}; pub use issues::*; pub use model::*; pub use notifications::*; pub use pulls::*; pub use reactions::{Reaction, ReactionMap, ReactionSummary, ReactionTarget}; pub use reviews::*; pub use store::Store; pub use store::edit_history_read::{EditTarget, EditVersion};