pub struct ProtocolVersionError {
pub client_version: Option<String>,
pub server_version: Option<String>,
pub min_supported: Option<String>,
pub max_supported: Option<String>,
pub message: String,
}Expand description
版本握手被拒错误 / Protocol-version handshake rejection error。
客户端(Agent/Computer)解析服务端返回的 4008 crate::ErrorPayload 后抛出的强类型错误,
承载顶层平铺的版本诊断字段。对标 Python 参考实现 a2c_smcp/exceptions.py 的
ProtocolVersionError(置于共享层、Agent 与 Computer 共用,避免反向依赖)。
由 crate::utils::handshake::build_protocol_version_error 从 4008 负载构造。
Fields§
§client_version: Option<String>客户端版本(4008 body 顶层 client_version)。
server_version: Option<String>服务端版本(server_version)。
min_supported: Option<String>服务端支持的最小版本(min_supported)。
max_supported: Option<String>服务端支持的最大版本(max_supported)。
message: String人类可读错误描述(message)。
Implementations§
Source§impl ProtocolVersionError
impl ProtocolVersionError
Sourcepub fn new(message: impl Into<String>) -> ProtocolVersionError
pub fn new(message: impl Into<String>) -> ProtocolVersionError
以一条 message 构造(版本字段留空)/ Construct from a bare message。
Trait Implementations§
Source§impl Clone for ProtocolVersionError
impl Clone for ProtocolVersionError
Source§fn clone(&self) -> ProtocolVersionError
fn clone(&self) -> ProtocolVersionError
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 ProtocolVersionError
impl Debug for ProtocolVersionError
Source§impl Display for ProtocolVersionError
impl Display for ProtocolVersionError
impl Eq for ProtocolVersionError
Source§impl Error for ProtocolVersionError
impl Error for ProtocolVersionError
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()
Source§impl PartialEq for ProtocolVersionError
impl PartialEq for ProtocolVersionError
Source§fn eq(&self, other: &ProtocolVersionError) -> bool
fn eq(&self, other: &ProtocolVersionError) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for ProtocolVersionError
Auto Trait Implementations§
impl Freeze for ProtocolVersionError
impl RefUnwindSafe for ProtocolVersionError
impl Send for ProtocolVersionError
impl Sync for ProtocolVersionError
impl Unpin for ProtocolVersionError
impl UnsafeUnpin for ProtocolVersionError
impl UnwindSafe for ProtocolVersionError
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