pub enum WireError {
StreamClosed,
Timeout(Duration),
SpawnFailed(String),
JsonParse(String),
JsonSerialize(String),
RequestFailed {
code: i32,
message: String,
},
UnexpectedResponseId {
expected: String,
got: String,
},
MethodNotFound(String),
UnknownMessageType(String),
InvalidPayloadType,
Io(String),
Internal(String),
}Expand description
Errors that can occur when interacting with the Kimi Wire protocol.
Variants§
StreamClosed
The wire stream closed unexpectedly.
Timeout(Duration)
A read or write operation timed out.
SpawnFailed(String)
Failed to spawn the Kimi CLI process.
JsonParse(String)
Failed to parse a JSON message.
JsonSerialize(String)
Failed to serialize a value to JSON.
RequestFailed
The server returned a JSON-RPC error response. The server returned a JSON-RPC error response.
UnexpectedResponseId
Received a response with an unexpected request id. Received a response with an unexpected request id.
MethodNotFound(String)
The server does not support the requested method.
UnknownMessageType(String)
An unknown wire message type was received.
InvalidPayloadType
The payload was not a JSON object.
Io(String)
An I/O error occurred.
Internal(String)
A generic internal error.
Trait Implementations§
Source§impl Error for WireError
impl Error for WireError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0:
use the Display impl or to_string()
impl StructuralPartialEq for WireError
Auto Trait Implementations§
impl Freeze for WireError
impl RefUnwindSafe for WireError
impl Send for WireError
impl Sync for WireError
impl Unpin for WireError
impl UnsafeUnpin for WireError
impl UnwindSafe for WireError
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