pub enum RetryableErrorData {
WorkspaceIndexing {
server_id: ServerId,
elapsed_secs: u64,
},
ServerInitializing {
server_id: ServerId,
},
WorkspaceServersInitializing {},
ListenStreamsExhausted {
max_listen_streams: usize,
},
ServerRestarted {
server_id: ServerId,
},
}Expand description
Structured data payload of a retryable JSON-RPC error.
Each variant pairs a bespoke error code (Self::code) with its own
payload, so a code can never be sent with another variant’s data. Keys
are snake_case; the wire form is the variant’s fields as a bare object.
§Examples
use mcpls_core::config::ServerId;
use mcpls_core::error::{RetryableErrorData, WORKSPACE_INDEXING_ERROR_CODE};
let data = RetryableErrorData::WorkspaceIndexing {
server_id: ServerId::from_static("rust"),
elapsed_secs: 30,
};
assert_eq!(data.code(), WORKSPACE_INDEXING_ERROR_CODE);
assert_eq!(
serde_json::to_value(&data).unwrap(),
serde_json::json!({"server_id": "rust", "elapsed_secs": 30})
);Variants§
WorkspaceIndexing
The routed server is still indexing the workspace.
Fields
ServerInitializing
The routed server has not finished initializing.
WorkspaceServersInitializing
An expected server has not registered yet and no single candidate
could be narrowed down, so there is no server to name. The braces
keep the wire value an empty object rather than null.
ListenStreamsExhausted
The concurrent subscriptions/listen stream limit is reached.
ServerRestarted
The routed server was restarted while the request was in flight.
Implementations§
Trait Implementations§
Source§impl Clone for RetryableErrorData
impl Clone for RetryableErrorData
Source§impl Debug for RetryableErrorData
impl Debug for RetryableErrorData
impl Eq for RetryableErrorData
Source§impl PartialEq for RetryableErrorData
impl PartialEq for RetryableErrorData
Source§impl Serialize for RetryableErrorData
impl Serialize for RetryableErrorData
impl StructuralPartialEq for RetryableErrorData
Auto Trait Implementations§
impl Freeze for RetryableErrorData
impl RefUnwindSafe for RetryableErrorData
impl Send for RetryableErrorData
impl Sync for RetryableErrorData
impl Unpin for RetryableErrorData
impl UnsafeUnpin for RetryableErrorData
impl UnwindSafe for RetryableErrorData
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<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
Compare self to
key and return true if they are equal.