pub struct DiscordLifecycle;Trait Implementations§
Source§impl CliLifecycle for DiscordLifecycle
impl CliLifecycle for DiscordLifecycle
Source§type CreateArgs = CreateArgs
type CreateArgs = CreateArgs
Per-service
zad service create <name> flag struct. Must
embed CreateArgsBase via #[command(flatten)] and expose
it through CreateArgsLike::base.Source§fn resolve<'life0, 'async_trait>(
args: &'life0 CreateArgs,
non_interactive: bool,
) -> Pin<Box<dyn Future<Output = Result<(DiscordServiceCfg, DiscordSecrets)>> + Send + 'async_trait>>where
'life0: 'async_trait,
fn resolve<'life0, 'async_trait>(
args: &'life0 CreateArgs,
non_interactive: bool,
) -> Pin<Box<dyn Future<Output = Result<(DiscordServiceCfg, DiscordSecrets)>> + Send + 'async_trait>>where
'life0: 'async_trait,
Build
(Cfg, Secrets) from CLI args. Interactive mode prompts
for any Option<_> fields that arrived empty; non-interactive
mode returns ZadError::MissingRequired for anything still
missing.Source§impl LifecycleService for DiscordLifecycle
impl LifecycleService for DiscordLifecycle
Source§const NAME: &'static str = "discord"
const NAME: &'static str = "discord"
Lowercase identifier used in paths, commands, and keychain
account names (
"discord", "telegram", …). Must match the
entry in crate::service::registry::SERVICES.Source§const DISPLAY: &'static str = "Discord"
const DISPLAY: &'static str = "Discord"
Capitalized display name for human-facing output (
"Discord").Source§type Cfg = DiscordServiceCfg
type Cfg = DiscordServiceCfg
Non-secret per-service config persisted to the service’s
config.toml. Anything that isn’t a credential belongs here.Source§type Secrets = DiscordSecrets
type Secrets = DiscordSecrets
Credential material held in the OS keychain. Shape is up to
the service: one bot token, three OAuth fields, a PEM blob —
whatever the provider needs.
Source§fn enable_in_project(cfg: &mut ProjectConfig)
fn enable_in_project(cfg: &mut ProjectConfig)
Mark the current project as using this service.
Source§fn disable_in_project(cfg: &mut ProjectConfig)
fn disable_in_project(cfg: &mut ProjectConfig)
Remove this service’s entry from the current project config.
Source§fn validate<'life0, 'life1, 'async_trait>(
_cfg: &'life0 DiscordServiceCfg,
creds: &'life1 mut DiscordSecrets,
) -> Pin<Box<dyn Future<Output = Result<String>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
fn validate<'life0, 'life1, 'async_trait>(
_cfg: &'life0 DiscordServiceCfg,
creds: &'life1 mut DiscordSecrets,
) -> Pin<Box<dyn Future<Output = Result<String>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Confirm the credentials work by pinging the provider. Returns
a short identifier (bot username, GitHub App slug) on success. Read more
Source§fn store_secrets(
creds: &DiscordSecrets,
scope: Scope<'_>,
) -> Result<Vec<SecretRef>>
fn store_secrets( creds: &DiscordSecrets, scope: Scope<'_>, ) -> Result<Vec<SecretRef>>
Write each piece of secret material to the OS keychain at
scope. Returns one SecretRef per account written.Source§fn delete_secrets(scope: Scope<'_>) -> Result<Vec<SecretRef>>
fn delete_secrets(scope: Scope<'_>) -> Result<Vec<SecretRef>>
Remove every keychain entry for this service at
scope.
Idempotent.Source§fn inspect_secrets(scope: Scope<'_>) -> Result<Vec<SecretRef>>
fn inspect_secrets(scope: Scope<'_>) -> Result<Vec<SecretRef>>
Report keychain presence per account this service expects.
Source§fn load_secrets(scope: Scope<'_>) -> Result<Option<DiscordSecrets>>
fn load_secrets(scope: Scope<'_>) -> Result<Option<DiscordSecrets>>
Load the full secret material from the keychain at
scope.
Returns Ok(None) if any required account is missing.Source§fn cfg_human(cfg: &DiscordServiceCfg) -> Vec<(&'static str, String)>
fn cfg_human(cfg: &DiscordServiceCfg) -> Vec<(&'static str, String)>
Human-readable non-secret fields, as
(label, value) pairs.Source§fn cfg_json(cfg: &DiscordServiceCfg) -> Value
fn cfg_json(cfg: &DiscordServiceCfg) -> Value
Non-secret fields rendered for
--json.Source§fn scopes_of(cfg: &DiscordServiceCfg) -> &[String]
fn scopes_of(cfg: &DiscordServiceCfg) -> &[String]
Declared scopes — stored verbatim in the TOML config’s
scopes array.Source§fn post_create_hint(cfg: &DiscordServiceCfg) -> Option<String>
fn post_create_hint(cfg: &DiscordServiceCfg) -> Option<String>
Optional URL to surface immediately after
create succeeds.
Default: no hint.Auto Trait Implementations§
impl Freeze for DiscordLifecycle
impl RefUnwindSafe for DiscordLifecycle
impl Send for DiscordLifecycle
impl Sync for DiscordLifecycle
impl Unpin for DiscordLifecycle
impl UnsafeUnpin for DiscordLifecycle
impl UnwindSafe for DiscordLifecycle
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more