Skip to main content

DiscordLifecycle

Struct DiscordLifecycle 

Source
pub struct DiscordLifecycle;

Trait Implementations§

Source§

impl CliLifecycle for DiscordLifecycle

Source§

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,

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

Source§

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"

Capitalized display name for human-facing output ("Discord").
Source§

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

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)

Mark the current project as using this service.
Source§

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,

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>>

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>>

Remove every keychain entry for this service at scope. Idempotent.
Source§

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>>

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)>

Human-readable non-secret fields, as (label, value) pairs.
Source§

fn cfg_json(cfg: &DiscordServiceCfg) -> Value

Non-secret fields rendered for --json.
Source§

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>

Optional URL to surface immediately after create succeeds. Default: no hint.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more