pub struct RuntimeInvocationResult {
pub content: String,
pub overflow_mode: Option<ToolOverflowMode>,
pub template_hint: Option<String>,
pub content_bytes: usize,
pub content_lines: usize,
}Expand description
Unified intermediate result object returned from the Lua runtime to the host. Lua runtime 返回给宿主的统一中间结果对象。
Fields§
§content: StringTool body content, which must always be a string. 工具正文内容,必须始终为字符串。
overflow_mode: Option<ToolOverflowMode>Optional overflow mode; when absent the host applies its own default policy. 可选超限模式;为空时由宿主按自身默认策略处理。
template_hint: Option<String>Optional template hint used only as a host-side suggestion, never rendered directly by the runtime. 可选模板建议名,仅作为宿主层提示,不在 runtime 中直接渲染。
content_bytes: usizeNormalized body byte count used by the host to decide pagination, truncation, or compression. 正文规范化后的字节数,供宿主判断是否需要分页、截断或压缩。
content_lines: usizeNormalized body line count used by the host to decide whether the line budget is exceeded. 正文规范化后的行数,供宿主判断是否命中行预算。
Implementations§
Source§impl RuntimeInvocationResult
impl RuntimeInvocationResult
Sourcepub fn from_content_parts(
content: String,
overflow_mode: Option<ToolOverflowMode>,
template_hint: Option<String>,
) -> Self
pub fn from_content_parts( content: String, overflow_mode: Option<ToolOverflowMode>, template_hint: Option<String>, ) -> Self
Build the unified runtime result from content and optional overflow hints while computing byte and line metrics at creation time. 根据正文和可选超限提示构造统一运行时结果,并在创建时计算字节与行数。
Trait Implementations§
Source§impl Clone for RuntimeInvocationResult
impl Clone for RuntimeInvocationResult
Source§fn clone(&self) -> RuntimeInvocationResult
fn clone(&self) -> RuntimeInvocationResult
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for RuntimeInvocationResult
impl Debug for RuntimeInvocationResult
Source§impl<'de> Deserialize<'de> for RuntimeInvocationResult
impl<'de> Deserialize<'de> for RuntimeInvocationResult
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>,
Source§impl PartialEq for RuntimeInvocationResult
impl PartialEq for RuntimeInvocationResult
Source§impl Serialize for RuntimeInvocationResult
impl Serialize for RuntimeInvocationResult
impl Eq for RuntimeInvocationResult
impl StructuralPartialEq for RuntimeInvocationResult
Auto Trait Implementations§
impl Freeze for RuntimeInvocationResult
impl RefUnwindSafe for RuntimeInvocationResult
impl Send for RuntimeInvocationResult
impl Sync for RuntimeInvocationResult
impl Unpin for RuntimeInvocationResult
impl UnsafeUnpin for RuntimeInvocationResult
impl UnwindSafe for RuntimeInvocationResult
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,
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<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 moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request