pub struct GmailCommand {
pub account: Option<String>,
pub command: GmailSubcommands,
}Expand description
Gmail: read Gmail messages, threads, and labels (and, with gmail.modify, mutate labels).
Fields§
§account: Option<String>Selects a named Gmail account configured in
~/.omni-dev/settings.json (AWS-CLI style, mirrors the top-level
--profile) for this invocation.
Orthogonal to --profile: switching the Gmail account never changes
which profile is active, and vice versa (see
ADR-0066). Overrides
OMNI_DEV_GMAIL_ACCOUNT. Scoped to the gmail subtree — unlike
--profile/--instance it is not usable before the gmail
subcommand name, only after it (gmail --account NAME <cmd> or
gmail <cmd> --account NAME), so it can’t collide with an unrelated
subcommand’s own --account flag elsewhere in the CLI (e.g.
snowflake query --account).
command: GmailSubcommandsThe Gmail subcommand to execute.
Implementations§
Source§impl GmailCommand
impl GmailCommand
Sourcepub async fn execute(self) -> Result<()>
pub async fn execute(self) -> Result<()>
Executes the Gmail command.
auth manages credentials and must run without them; account
manages which named account is selected and must equally run
without a resolved client (import-legacy’s whole point is working
in a pre-migration state). sync-all also runs without the shared
client: it resolves one client per configured account itself
(helpers::create_client_for, never the env var below, which is
unsafe across its concurrent tasks — ADR-0068). extract-attachments
also runs without a client — it never contacts Gmail at all, only
the local archive under --archive-dir, so --account has no
meaning for it either (#1510). Every other subcommand needs an
authenticated client, which is resolved once here and threaded
down so each leaf takes &GmailClient and stays free of process
env. render also runs without a client — like
extract-attachments, it only ever reads .eml files already on
disk (#1513).
Trait Implementations§
Source§impl Args for GmailCommand
impl Args for GmailCommand
Source§fn augment_args<'b>(__clap_app: Command) -> Command
fn augment_args<'b>(__clap_app: Command) -> Command
Source§fn augment_args_for_update<'b>(__clap_app: Command) -> Command
fn augment_args_for_update<'b>(__clap_app: Command) -> Command
Command so it can instantiate self via
FromArgMatches::update_from_arg_matches_mut Read moreSource§impl CommandFactory for GmailCommand
impl CommandFactory for GmailCommand
Source§impl FromArgMatches for GmailCommand
impl FromArgMatches for GmailCommand
Source§fn from_arg_matches(__clap_arg_matches: &ArgMatches) -> Result<Self, Error>
fn from_arg_matches(__clap_arg_matches: &ArgMatches) -> Result<Self, Error>
Source§fn from_arg_matches_mut(
__clap_arg_matches: &mut ArgMatches,
) -> Result<Self, Error>
fn from_arg_matches_mut( __clap_arg_matches: &mut ArgMatches, ) -> Result<Self, Error>
Source§fn update_from_arg_matches(
&mut self,
__clap_arg_matches: &ArgMatches,
) -> Result<(), Error>
fn update_from_arg_matches( &mut self, __clap_arg_matches: &ArgMatches, ) -> Result<(), Error>
ArgMatches to self.Source§fn update_from_arg_matches_mut(
&mut self,
__clap_arg_matches: &mut ArgMatches,
) -> Result<(), Error>
fn update_from_arg_matches_mut( &mut self, __clap_arg_matches: &mut ArgMatches, ) -> Result<(), Error>
ArgMatches to self.Source§impl Parser for GmailCommand
impl Parser for GmailCommand
Source§fn parse_from<I, T>(itr: I) -> Self
fn parse_from<I, T>(itr: I) -> Self
Source§fn try_parse_from<I, T>(itr: I) -> Result<Self, Error>
fn try_parse_from<I, T>(itr: I) -> Result<Self, Error>
Source§fn update_from<I, T>(&mut self, itr: I)
fn update_from<I, T>(&mut self, itr: I)
Auto Trait Implementations§
impl Freeze for GmailCommand
impl RefUnwindSafe for GmailCommand
impl Send for GmailCommand
impl Sync for GmailCommand
impl Unpin for GmailCommand
impl UnsafeUnpin for GmailCommand
impl UnwindSafe for GmailCommand
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more