Skip to main content

MaArgs

Struct MaArgs 

Source
pub struct MaArgs {
    pub config: Option<PathBuf>,
    pub slug: Option<String>,
    pub log_level: Option<String>,
    pub log_file: Option<PathBuf>,
    pub log_level_stdout: Option<String>,
    pub secret_bundle: Option<PathBuf>,
    pub secret_bundle_passphrase: Option<String>,
    pub kubo_rpc_url: Option<String>,
    pub kubo_key_alias: Option<String>,
    pub gen_headless_config: bool,
}
Expand description

Standard ma-core CLI arguments.

Add these to your binary with #[command(flatten)].

MA_CONFIG and MA_SLUG are the only statically-named environment variables; all other fields are resolved dynamically in super::Config::from_args using the binary’s compile-time MA_DEFAULT_SLUG constant as a prefix (e.g. MA_PANTEIA_LOG_LEVEL), with a plain MA_LOG_LEVEL-style fallback.

Fields§

§config: Option<PathBuf>

Path to the YAML config file. Overrides the slug-derived default (XDG_CONFIG_HOME/ma/<slug>.yaml).

Environment variable: MA_CONFIG

§slug: Option<String>

Runtime slug. Overrides MA_DEFAULT_SLUG for file naming (<slug>.yaml, <slug>.bin, <slug>.log) only.

The env-var prefix MA_<MA_DEFAULT_SLUG>_* is always determined by the compile-time constant — this value does not change the prefix.

Environment variable: MA_SLUG

§log_level: Option<String>

Log level for the log file (trace, debug, info, warn, error).

Resolved via MA_<MA_DEFAULT_SLUG>_LOG_LEVELMA_LOG_LEVEL → YAML → default "info".

§log_file: Option<PathBuf>

Path to the log file. Defaults to XDG_DATA_HOME/ma/<slug>.log.

Resolved via MA_<MA_DEFAULT_SLUG>_LOG_FILEMA_LOG_FILE → YAML → XDG default.

§log_level_stdout: Option<String>

Log level for stdout output (trace, debug, info, warn, error).

Resolved via MA_<MA_DEFAULT_SLUG>_LOG_LEVEL_STDOUTMA_LOG_LEVEL_STDOUT → YAML → default "warn".

§secret_bundle: Option<PathBuf>

Path to the encrypted secret bundle file. Defaults to XDG_CONFIG_HOME/ma/<slug>.bin.

Resolved via MA_<MA_DEFAULT_SLUG>_SECRET_BUNDLEMA_SECRET_BUNDLE → YAML → XDG default.

§secret_bundle_passphrase: Option<String>

Passphrase to unlock the secret bundle.

In headless configs this is stored in cleartext in the YAML file. Prefer setting via environment variable rather than CLI to avoid shell history exposure.

Resolved via MA_<MA_DEFAULT_SLUG>_SECRET_BUNDLE_PASSPHRASEMA_SECRET_BUNDLE_PASSPHRASE → YAML.

§kubo_rpc_url: Option<String>

Kubo RPC API URL. Defaults to http://127.0.0.1:5001.

Resolved via MA_<MA_DEFAULT_SLUG>_KUBO_RPC_URLMA_KUBO_RPC_URL → YAML → default.

§kubo_key_alias: Option<String>

IPNS key alias used in Kubo. Defaults to the slug.

Resolved via MA_<MA_DEFAULT_SLUG>_KUBO_KEY_ALIASMA_KUBO_KEY_ALIAS → YAML → slug.

§gen_headless_config: bool

Generate a headless config with a fresh secret bundle, write both files with 0600 permissions, and exit.

If --secret-bundle-passphrase is not provided, a random passphrase is generated and written into the config file.

Trait Implementations§

Source§

impl Args for MaArgs

Source§

fn group_id() -> Option<Id>

Report the ArgGroup::id for this set of arguments
Source§

fn augment_args<'b>(__clap_app: Command) -> Command

Append to Command so it can instantiate Self via FromArgMatches::from_arg_matches_mut Read more
Source§

fn augment_args_for_update<'b>(__clap_app: Command) -> Command

Append to Command so it can instantiate self via FromArgMatches::update_from_arg_matches_mut Read more
Source§

impl Clone for MaArgs

Source§

fn clone(&self) -> MaArgs

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for MaArgs

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for MaArgs

Source§

fn default() -> MaArgs

Returns the “default value” for a type. Read more
Source§

impl FromArgMatches for MaArgs

Source§

fn from_arg_matches(__clap_arg_matches: &ArgMatches) -> Result<Self, Error>

Instantiate Self from ArgMatches, parsing the arguments as needed. Read more
Source§

fn from_arg_matches_mut( __clap_arg_matches: &mut ArgMatches, ) -> Result<Self, Error>

Instantiate Self from ArgMatches, parsing the arguments as needed. Read more
Source§

fn update_from_arg_matches( &mut self, __clap_arg_matches: &ArgMatches, ) -> Result<(), Error>

Assign values from ArgMatches to self.
Source§

fn update_from_arg_matches_mut( &mut self, __clap_arg_matches: &mut ArgMatches, ) -> Result<(), Error>

Assign values from ArgMatches to self.

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

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

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: 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: 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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

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

Source§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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