pub struct A2AError {
pub code: i32,
pub message: String,
pub details: Option<HashMap<String, Value>>,
}Expand description
An A2A protocol error.
Fields§
§code: i32§message: String§details: Option<HashMap<String, Value>>Implementations§
Source§impl A2AError
impl A2AError
pub fn new(code: i32, message: impl Into<String>) -> Self
pub fn with_details(self, details: HashMap<String, Value>) -> Self
pub fn task_not_found(task_id: &str) -> Self
pub fn task_not_cancelable(task_id: &str) -> Self
pub fn push_notification_not_supported() -> Self
pub fn unsupported_operation(msg: impl Into<String>) -> Self
pub fn content_type_not_supported() -> Self
pub fn invalid_agent_response() -> Self
pub fn version_not_supported(version: &str) -> Self
pub fn internal(msg: impl Into<String>) -> Self
pub fn invalid_params(msg: impl Into<String>) -> Self
pub fn parse_error(msg: impl Into<String>) -> Self
pub fn invalid_request(msg: impl Into<String>) -> Self
pub fn method_not_found(method: &str) -> Self
Sourcepub fn http_status_code(&self) -> u16
pub fn http_status_code(&self) -> u16
Map A2A error code to HTTP status code for REST binding.
Sourcepub fn to_jsonrpc_error(&self) -> JsonRpcError
pub fn to_jsonrpc_error(&self) -> JsonRpcError
Convert to a JSON-RPC error object.
Trait Implementations§
Source§impl Error for A2AError
impl Error for A2AError
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()
Auto Trait Implementations§
impl Freeze for A2AError
impl RefUnwindSafe for A2AError
impl Send for A2AError
impl Sync for A2AError
impl Unpin for A2AError
impl UnsafeUnpin for A2AError
impl UnwindSafe for A2AError
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