pub enum ParseA2aVersionError {
MissingMinor {
input: String,
},
InvalidMajor {
input: String,
error: ParseIntError,
},
InvalidMinor {
input: String,
error: ParseIntError,
},
}Expand description
Why an A2A version string failed to parse.
The variants are named for the part that was wrong, not the
string, because a peer that says "foo" is making a different
mistake than one that says "1" or "1.x".
Variants§
MissingMinor
The string had no . separator. The A2A wire form is always
Major.Minor; 1 alone is not a valid A2A-Version header.
Fields
InvalidMajor
The Major part did not parse as a u16. Carries the parse
error so the caller can decide whether to fall back to a
default or surface it to the peer.
Fields
error: ParseIntErrorThe parse error the u16 parser returned. Surfaced
rather than absorbed because the consumer (the
dispatcher, an HTTP error handler) decides whether
1.x is a peer mistake to report or an
accept-and-default case.
InvalidMinor
The Minor part did not parse as a u16. Same shape as
InvalidMajor; a separate variant so the error message names
the offending part.
Fields
error: ParseIntErrorThe parse error the u16 parser returned.
Trait Implementations§
Source§impl Clone for ParseA2aVersionError
impl Clone for ParseA2aVersionError
Source§impl Debug for ParseA2aVersionError
impl Debug for ParseA2aVersionError
Source§impl Display for ParseA2aVersionError
impl Display for ParseA2aVersionError
impl Eq for ParseA2aVersionError
Source§impl Error for ParseA2aVersionError
impl Error for ParseA2aVersionError
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()