pub enum MtpSessionError {
Show 14 variants
Init,
Process,
Begin,
Draft,
Accept,
PromptTooLong {
size: usize,
maximum: usize,
},
IncompatibleContexts(&'static str),
BadSeqId {
seq_id: i32,
n_seq: u32,
},
InvalidConfig(&'static str),
Decode(DecodeError),
ProposalPending {
seq_id: i32,
},
NoPendingProposal {
seq_id: i32,
},
AcceptedTooMany {
accepted: u16,
proposed: usize,
},
State(SpeculativeStateError),
}Expand description
Errors raised by the MTP draft session.
Variants§
Init
Returned when mtp_session_new fails (typically: model lacks MTP heads,
or one of the contexts is incompatible).
Process
mtp_session_process returned false.
Begin
Native prompt initialization failed or raised a contained exception.
Draft
Native draft generation failed or raised a contained exception.
Accept
Native proposal acceptance failed or raised a contained exception.
PromptTooLong
Prompt storage exceeds the safe speculative-session bound.
Fields
IncompatibleContexts(&'static str)
The supplied contexts do not satisfy the native MTP contract.
BadSeqId
Caller passed a sequence id outside [0, n_seq).
InvalidConfig(&'static str)
Invalid session configuration (e.g. n_draft_max <= 0).
Decode(DecodeError)
The target context failed to decode.
ProposalPending
An operation requires all draft proposals to be completed first.
NoPendingProposal
accept was called without a preceding nonempty draft.
AcceptedTooMany
The accepted prefix exceeds the proposal length.
State(SpeculativeStateError)
Exact speculative-state capture or restore failed.
Trait Implementations§
Source§impl Debug for MtpSessionError
impl Debug for MtpSessionError
Source§impl Display for MtpSessionError
impl Display for MtpSessionError
Source§impl Error for MtpSessionError
impl Error for MtpSessionError
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()