pub struct AcpMessage {
pub jsonrpc: Option<String>,
pub id: Option<u64>,
pub method: Option<String>,
pub params: Option<Value>,
pub result: Option<Value>,
pub error: Option<Value>,
}Expand description
A single NDJSON message received from Kiro’s stdout.
Can be a response (has id + result/error), a notification (has
method + params but no id), or a request from the agent (has
id + method + params, e.g. session/request_permission).
Fields§
§jsonrpc: Option<String>§id: Option<u64>Present on responses and agent-initiated requests.
method: Option<String>Present on notifications and agent-initiated requests.
params: Option<Value>Present on notifications and agent-initiated requests.
result: Option<Value>Present on successful responses.
error: Option<Value>Present on error responses.
Implementations§
Source§impl AcpMessage
impl AcpMessage
Sourcepub fn is_response(&self) -> bool
pub fn is_response(&self) -> bool
Is this a response to a request we sent (has id + result/error, no method)?
Sourcepub fn is_notification(&self) -> bool
pub fn is_notification(&self) -> bool
Is this a notification from the agent (has method, no id)?
Sourcepub fn is_agent_request(&self) -> bool
pub fn is_agent_request(&self) -> bool
Is this a request from the agent to us (has id + method)?
Trait Implementations§
Source§impl Debug for AcpMessage
impl Debug for AcpMessage
Source§impl<'de> Deserialize<'de> for AcpMessage
impl<'de> Deserialize<'de> for AcpMessage
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
Auto Trait Implementations§
impl Freeze for AcpMessage
impl RefUnwindSafe for AcpMessage
impl Send for AcpMessage
impl Sync for AcpMessage
impl Unpin for AcpMessage
impl UnsafeUnpin for AcpMessage
impl UnwindSafe for AcpMessage
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> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.