pub struct Config {
pub schema_version: u32,
pub environment: Option<Environment>,
pub api_key: Option<String>,
pub wallet_address: Option<String>,
pub keystore_path: Option<PathBuf>,
pub agent_id: Option<String>,
pub webhook_url: Option<String>,
pub webhook_secret_path: Option<PathBuf>,
pub confirm_above_budget: Option<String>,
pub log_format: Option<String>,
pub receipt_timeout: Option<String>,
}Expand description
On-disk config. Every runtime field is Option so the file stays
small and a partially-configured project can still round-trip.
Fields§
§schema_version: u32On-disk schema version (CURRENT_SCHEMA_VERSION for fresh
writes). A 0 value means “not set” and is normalized to
CURRENT_SCHEMA_VERSION on save.
environment: Option<Environment>§api_key: Option<String>Agent API key. Secret — the file is written 0600.
wallet_address: Option<String>§keystore_path: Option<PathBuf>§agent_id: Option<String>§webhook_url: Option<String>§webhook_secret_path: Option<PathBuf>§confirm_above_budget: Option<String>Fail-closed confirmation gate for mutating commands. When the
requested budget on post (or task budget on settle) exceeds
this stablecoin-units threshold, the command refuses to proceed
without an explicit --yes. Decimal string in the same units
as --budget (e.g. "1000" = 1000 USDC). None = gate off.
log_format: Option<String>Default --verbose log encoding. Accepts "json" or "text".
None = "text". CLI flag and env var (TASKFAST_LOG_FORMAT)
still win over this.
receipt_timeout: Option<String>Receipt-polling ceiling for escrow sign. Human-readable
duration. None = network-aware default (3min mainnet,
1min testnet). Flag --receipt-timeout and env var
TASKFAST_RECEIPT_TIMEOUT still win over this.
Implementations§
Source§impl Config
impl Config
Sourcepub fn load(path: &Path) -> Result<Self, ConfigError>
pub fn load(path: &Path) -> Result<Self, ConfigError>
Parse the JSON at path. Missing file → Config::default()
(callers treat absence the same as an empty config). Newer
schema_version values log a warning via tracing::warn! and
load what they recognise.
Hard-errors with ConfigError::LegacyFields when the on-disk
JSON still carries any key removed at the current schema version
(currently api_base and network). Stale values would otherwise
silently outrank the Environment-derived defaults.
Sourcepub fn save(&self, path: &Path) -> Result<(), ConfigError>
pub fn save(&self, path: &Path) -> Result<(), ConfigError>
Atomic write: JSON-serialize, chmod 0600 on unix from creation, rename into place.
Creates the parent directory if it doesn’t exist and tightens to 0700.
Sourcepub fn default_path() -> PathBuf
pub fn default_path() -> PathBuf
Default file path, rooted in the caller’s current working
directory. Used when neither --config nor TASKFAST_CONFIG
is supplied.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Config
impl<'de> Deserialize<'de> for Config
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
impl Eq for Config
impl StructuralPartialEq for Config
Auto Trait Implementations§
impl Forget for Config
impl Freeze for Config
impl Move for Config
impl RefUnwindSafe for Config
impl Send for Config
impl Sync for Config
impl Unpin for Config
impl UnsafeUnpin for Config
impl UnwindSafe for Config
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
impl<'de, T> BorrowedRpcObject<'de> for T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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