pub struct RequestBase {
pub jq: Option<String>,
pub python: Option<String>,
pub timeout_seconds: Option<u64>,
pub max_tokens: Option<u64>,
}Fields§
§jq: Option<String>jq filter applied to the JSON output. Ignored when python
is also set — python overrides jq.
python: Option<String>Python transform applied to the JSON output. Overrides jq
when both are provided.
timeout_seconds: Option<u64>Wall-clock execution cap, in whole seconds. Parsed from
--timeout (humantime: 30s, 5m, 1h30m), > 0
enforced at parse time. db query threads it to postgres
when set; omit for uncapped.
max_tokens: Option<u64>Response token budget, >= 1 (0 is rejected at parse
time — omit entirely for unlimited). Forward-compatible
envelope data — no leaf enforces it yet.
Implementations§
Source§impl RequestBase
impl RequestBase
Sourcepub fn push_flags(&self, argv: &mut Vec<String>)
pub fn push_flags(&self, argv: &mut Vec<String>)
Append this envelope’s argv flags (--jq <filter>,
--python <code>, …) — the counterpart of
RequestBaseArgs’ parse side, called from every leaf’s
into_command.
Sourcepub fn clear_transform(&mut self)
pub fn clear_transform(&mut self)
Drop every TRANSFORM field — execute’s typed-response
contract (a transform would turn the output into untyped
JSON the caller’s Response type couldn’t parse).
Non-transform envelope fields (timeout_seconds,
max_tokens) survive.
Sourcepub fn transform(&self) -> Option<Transform>
pub fn transform(&self) -> Option<Transform>
The active output transform, if any — the read side of the
jq / python pair, resolving the python-overrides-jq rule:
python set ⇒ Transform::Python, else jq set ⇒
Transform::Jq, else None. Clones the owned filter/code.
Sourcepub fn set_transform(&mut self, transform: Transform)
pub fn set_transform(&mut self, transform: Transform)
Install transform, displacing any other — execute_transform’s
contract: exactly the requested transform is active.
Trait Implementations§
Source§impl Clone for RequestBase
impl Clone for RequestBase
Source§fn clone(&self) -> RequestBase
fn clone(&self) -> RequestBase
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for RequestBase
impl Debug for RequestBase
Source§impl Default for RequestBase
impl Default for RequestBase
Source§fn default() -> RequestBase
fn default() -> RequestBase
Source§impl<'de> Deserialize<'de> for RequestBase
impl<'de> Deserialize<'de> for RequestBase
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 RequestBase
Source§impl From<RequestBaseArgs> for RequestBase
impl From<RequestBaseArgs> for RequestBase
Source§fn from(args: RequestBaseArgs) -> Self
fn from(args: RequestBaseArgs) -> Self
Source§impl JsonSchema for RequestBase
impl JsonSchema for RequestBase
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
$ref keyword. Read moreSource§impl PartialEq for RequestBase
impl PartialEq for RequestBase
Source§fn eq(&self, other: &RequestBase) -> bool
fn eq(&self, other: &RequestBase) -> bool
self and other values to be equal, and is used by ==.Source§impl Serialize for RequestBase
impl Serialize for RequestBase
impl StructuralPartialEq for RequestBase
Auto Trait Implementations§
impl Freeze for RequestBase
impl RefUnwindSafe for RequestBase
impl Send for RequestBase
impl Sync for RequestBase
impl Unpin for RequestBase
impl UnsafeUnpin for RequestBase
impl UnwindSafe for RequestBase
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> 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
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