pub struct RtkConfig {
pub executable: PathBuf,
pub args: Vec<String>,
pub timeout_ms: u64,
pub working_dir: Option<PathBuf>,
pub pinned_version: Option<String>,
pub pinned_sha256: Option<String>,
pub max_output_tokens: u64,
pub max_capture_bytes: usize,
pub sandbox_root: Option<PathBuf>,
}Expand description
Configuration for the external shell optimizer.
Fields§
§executable: PathBufAbsolute path or a binary name resolved through PATH.
args: Vec<String>Fixed arguments inserted before rewrite <command>.
timeout_ms: u64Maximum duration for the RTK subprocess; zero means no local cap.
working_dir: Option<PathBuf>Optional default working directory, overridden by the invocation.
pinned_version: Option<String>Exact output of rtk --version that must be present in the probe.
pinned_sha256: Option<String>Lowercase or uppercase SHA-256 of the resolved executable.
max_output_tokens: u64Maximum output tokens retained in an observation.
max_capture_bytes: usizeMaximum bytes captured from the RTK process before it is rejected.
sandbox_root: Option<PathBuf>Optional PathJail root for test or explicitly configured sandboxes.
Implementations§
Source§impl RtkConfig
impl RtkConfig
Sourcepub fn new(executable: impl Into<PathBuf>) -> Self
pub fn new(executable: impl Into<PathBuf>) -> Self
Create a configuration using a specific executable.
Sourcepub fn with_args(
self,
args: impl IntoIterator<Item = impl Into<String>>,
) -> Self
pub fn with_args( self, args: impl IntoIterator<Item = impl Into<String>>, ) -> Self
Add fixed arguments supplied before the shell command.
Sourcepub const fn with_timeout_ms(self, timeout_ms: u64) -> Self
pub const fn with_timeout_ms(self, timeout_ms: u64) -> Self
Set the maximum wall-clock duration for one external process.
Sourcepub fn with_working_dir(self, working_dir: impl AsRef<Path>) -> Self
pub fn with_working_dir(self, working_dir: impl AsRef<Path>) -> Self
Run the optimizer in a fixed working directory.
Sourcepub fn with_pins(
self,
version: impl Into<String>,
sha256: impl Into<String>,
) -> Self
pub fn with_pins( self, version: impl Into<String>, sha256: impl Into<String>, ) -> Self
Pin both the executable version and its SHA-256 digest.
Sourcepub fn with_version(self, version: impl Into<String>) -> Self
pub fn with_version(self, version: impl Into<String>) -> Self
Set only the exact version pin.
Sourcepub fn with_sha256(self, sha256: impl Into<String>) -> Self
pub fn with_sha256(self, sha256: impl Into<String>) -> Self
Set only the executable hash pin.
Sourcepub const fn with_max_output_tokens(self, max_output_tokens: u64) -> Self
pub const fn with_max_output_tokens(self, max_output_tokens: u64) -> Self
Set the observation token bound.
Sourcepub const fn with_max_capture_bytes(self, max_capture_bytes: usize) -> Self
pub const fn with_max_capture_bytes(self, max_capture_bytes: usize) -> Self
Set the subprocess capture bound.
Sourcepub fn with_sandbox_root(self, sandbox_root: impl AsRef<Path>) -> Self
pub fn with_sandbox_root(self, sandbox_root: impl AsRef<Path>) -> Self
Set the PathJail root used for the invocation working directory.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for RtkConfig
impl<'de> Deserialize<'de> for RtkConfig
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 RtkConfig
impl StructuralPartialEq for RtkConfig
Auto Trait Implementations§
impl Freeze for RtkConfig
impl RefUnwindSafe for RtkConfig
impl Send for RtkConfig
impl Sync for RtkConfig
impl Unpin for RtkConfig
impl UnsafeUnpin for RtkConfig
impl UnwindSafe for RtkConfig
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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
impl<A, B, T> HttpServerConnExec<A, B> for Twhere
B: Body,
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