Skip to main content

ConfigBuilder

Struct ConfigBuilder 

Source
pub struct ConfigBuilder { /* private fields */ }
Expand description

Builder for Config.

Implementations§

Source§

impl ConfigBuilder

Source

pub fn path_policy(self, policy: impl PathPolicy) -> Self

Set the path access policy.

Default: Unrestricted (no checks).

Source

pub fn http_policy(self, policy: impl HttpPolicy) -> Self

Set the HTTP URL access policy.

Default: Unrestricted (no checks).

Source

pub fn env_policy(self, policy: impl EnvPolicy) -> Self

Set the environment variable access policy.

Default: Unrestricted (no checks).

Source

pub fn llm_policy(self, policy: impl LlmPolicy) -> Self

Set the LLM request policy.

Default: Unrestricted (no checks).

Source

pub fn llm_default_timeout_secs(self, secs: u64) -> Self

Default timeout for LLM requests in seconds.

Default: 120.

Source

pub fn llm_max_response_bytes(self, bytes: u64) -> Self

Maximum LLM response body size in bytes.

Default: 10_485_760 (10 MiB).

Source

pub fn llm_max_batch_concurrency(self, n: usize) -> Self

Maximum number of concurrent threads for llm.batch.

Default: 8.

Source

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.

Source

pub fn max_walk_depth(self, depth: usize) -> Self

Maximum directory depth for fs.walk.

Default: 256.

Source

pub fn max_walk_entries(self, entries: usize) -> Self

Maximum number of entries returned by fs.walk and fs.glob.

Default: 10_000.

Source

pub fn max_json_depth(self, depth: usize) -> Self

Maximum nesting depth for JSON encode/decode.

Default: 128.

Source

pub fn http_timeout(self, timeout: Duration) -> Self

Default timeout for HTTP requests.

Default: 30 seconds.

Source

pub fn max_response_bytes(self, bytes: u64) -> Self

Maximum HTTP response body size in bytes.

Default: 10_485_760 (10 MiB).

Source

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.

Source

pub fn build(self) -> Result<Config, ConfigError>

Finalise the configuration.

Returns Err if any configured value is invalid.

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> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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, 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<T> MaybeSend for T