pub struct ConfigBuilder { /* private fields */ }Expand description
Builder for Config.
Implementations§
Source§impl ConfigBuilder
impl ConfigBuilder
Sourcepub fn path_policy(self, policy: impl PathPolicy) -> Self
pub fn path_policy(self, policy: impl PathPolicy) -> Self
Set the path access policy.
Default: Unrestricted (no checks).
Sourcepub fn http_policy(self, policy: impl HttpPolicy) -> Self
pub fn http_policy(self, policy: impl HttpPolicy) -> Self
Set the HTTP URL access policy.
Default: Unrestricted (no checks).
Sourcepub fn env_policy(self, policy: impl EnvPolicy) -> Self
pub fn env_policy(self, policy: impl EnvPolicy) -> Self
Set the environment variable access policy.
Default: Unrestricted (no checks).
Sourcepub fn llm_policy(self, policy: impl LlmPolicy) -> Self
pub fn llm_policy(self, policy: impl LlmPolicy) -> Self
Set the LLM request policy.
Default: Unrestricted (no checks).
Sourcepub fn llm_default_timeout_secs(self, secs: u64) -> Self
pub fn llm_default_timeout_secs(self, secs: u64) -> Self
Default timeout for LLM requests in seconds.
Default: 120.
Sourcepub fn llm_max_response_bytes(self, bytes: u64) -> Self
pub fn llm_max_response_bytes(self, bytes: u64) -> Self
Maximum LLM response body size in bytes.
Default: 10_485_760 (10 MiB).
Sourcepub fn llm_max_batch_concurrency(self, n: usize) -> Self
pub fn llm_max_batch_concurrency(self, n: usize) -> Self
Maximum number of concurrent threads for llm.batch.
Default: 8.
Sourcepub fn max_read_bytes(self, bytes: u64) -> Self
pub fn max_read_bytes(self, bytes: u64) -> Self
Maximum number of bytes fs.read and fs.read_binary will load.
Default: None (no limit). When set, an error is returned if
the file size exceeds this value.
Sourcepub fn max_walk_depth(self, depth: usize) -> Self
pub fn max_walk_depth(self, depth: usize) -> Self
Maximum directory depth for fs.walk.
Default: 256.
Sourcepub fn max_walk_entries(self, entries: usize) -> Self
pub fn max_walk_entries(self, entries: usize) -> Self
Maximum number of entries returned by fs.walk and fs.glob.
Default: 10_000.
Sourcepub fn max_json_depth(self, depth: usize) -> Self
pub fn max_json_depth(self, depth: usize) -> Self
Maximum nesting depth for JSON encode/decode.
Default: 128.
Sourcepub fn http_timeout(self, timeout: Duration) -> Self
pub fn http_timeout(self, timeout: Duration) -> Self
Default timeout for HTTP requests.
Default: 30 seconds.
Sourcepub fn max_response_bytes(self, bytes: u64) -> Self
pub fn max_response_bytes(self, bytes: u64) -> Self
Maximum HTTP response body size in bytes.
Default: 10_485_760 (10 MiB).
Sourcepub fn max_sleep_secs(self, secs: f64) -> Self
pub fn max_sleep_secs(self, secs: f64) -> Self
Maximum duration for time.sleep in seconds.
Default: 86400.0 (1 day).
build returns an error if the value is
NaN, infinite, or negative.
Sourcepub fn build(self) -> Result<Config, ConfigError>
pub fn build(self) -> Result<Config, ConfigError>
Finalise the configuration.
Returns Err if any configured value is invalid.
Auto Trait Implementations§
impl Freeze for ConfigBuilder
impl !RefUnwindSafe for ConfigBuilder
impl Send for ConfigBuilder
impl Sync for ConfigBuilder
impl Unpin for ConfigBuilder
impl UnsafeUnpin for ConfigBuilder
impl !UnwindSafe for ConfigBuilder
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> 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