pub struct Config {
pub x_api: XApiConfig,
pub auth: AuthConfig,
pub business: BusinessProfile,
pub scoring: ScoringConfig,
pub limits: LimitsConfig,
pub intervals: IntervalsConfig,
pub llm: LlmConfig,
pub targets: TargetsConfig,
pub approval_mode: bool,
pub storage: StorageConfig,
pub logging: LoggingConfig,
pub schedule: ScheduleConfig,
}Expand description
Top-level configuration for the Tuitbot agent.
Fields§
§x_api: XApiConfigX API credentials.
auth: AuthConfigAuthentication settings.
business: BusinessProfileBusiness profile for content targeting.
scoring: ScoringConfigScoring engine weights and threshold.
limits: LimitsConfigSafety limits for API actions.
intervals: IntervalsConfigAutomation interval settings.
llm: LlmConfigLLM provider configuration.
targets: TargetsConfigTarget account monitoring configuration.
approval_mode: boolEnable approval mode: queue posts for human review instead of posting.
storage: StorageConfigData storage configuration.
logging: LoggingConfigLogging and observability settings.
schedule: ScheduleConfigActive hours schedule for posting.
Implementations§
Source§impl Config
impl Config
Sourcepub fn load(config_path: Option<&str>) -> Result<Config, ConfigError>
pub fn load(config_path: Option<&str>) -> Result<Config, ConfigError>
Load configuration from a TOML file with environment variable overrides.
The loading sequence:
- Determine config file path (argument >
TUITBOT_CONFIGenv var > default) - Parse TOML file (or use defaults if default path doesn’t exist)
- Apply environment variable overrides
Sourcepub fn load_and_validate(
config_path: Option<&str>,
) -> Result<Config, Vec<ConfigError>>
pub fn load_and_validate( config_path: Option<&str>, ) -> Result<Config, Vec<ConfigError>>
Load configuration and validate it, returning all validation errors at once.
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>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze 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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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>
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 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>
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