pub struct BasicAgentOutput {
pub response: String,
pub done: bool,
}Expand description
Output of the Basic executor
Fields§
§response: String§done: boolImplementations§
Source§impl BasicAgentOutput
impl BasicAgentOutput
Sourcepub fn try_parse<T: for<'de> Deserialize<'de>>(&self) -> Result<T, Error>
pub fn try_parse<T: for<'de> Deserialize<'de>>(&self) -> Result<T, Error>
Try to parse the response string as structured JSON of type T.
Returns serde_json::Error if parsing fails.
Sourcepub fn parse_or_map<T, F>(&self, fallback: F) -> T
pub fn parse_or_map<T, F>(&self, fallback: F) -> T
Parse the response string as structured JSON of type T, or map the raw
text into T using the provided fallback function if parsing fails.
Trait Implementations§
Source§impl Clone for BasicAgentOutput
impl Clone for BasicAgentOutput
Source§fn clone(&self) -> BasicAgentOutput
fn clone(&self) -> BasicAgentOutput
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for BasicAgentOutput
impl Debug for BasicAgentOutput
Source§impl<'de> Deserialize<'de> for BasicAgentOutput
impl<'de> Deserialize<'de> for BasicAgentOutput
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>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl From<BasicAgentOutput> for String
impl From<BasicAgentOutput> for String
Source§fn from(output: BasicAgentOutput) -> Self
fn from(output: BasicAgentOutput) -> Self
Converts to this type from the input type.
Source§impl From<BasicAgentOutput> for Value
impl From<BasicAgentOutput> for Value
Source§fn from(output: BasicAgentOutput) -> Self
fn from(output: BasicAgentOutput) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for BasicAgentOutput
impl RefUnwindSafe for BasicAgentOutput
impl Send for BasicAgentOutput
impl Sync for BasicAgentOutput
impl Unpin for BasicAgentOutput
impl UnwindSafe for BasicAgentOutput
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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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>
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 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>
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 moreSource§impl<T> Message for T
impl<T> Message for T
Source§fn from_boxed(m: BoxedMessage) -> Result<Self, BoxedDowncastErr>
fn from_boxed(m: BoxedMessage) -> Result<Self, BoxedDowncastErr>
Convert a BoxedMessage to this concrete type
Source§fn box_message(self, pid: &ActorId) -> Result<BoxedMessage, BoxedDowncastErr>
fn box_message(self, pid: &ActorId) -> Result<BoxedMessage, BoxedDowncastErr>
Convert this message to a BoxedMessage