pub enum Error {
Tokenizer(String),
AnchorTokenMissing {
token: &'static str,
},
TokenBudgetExceeded {
tokens: usize,
budget: usize,
},
AnchorCountMismatch {
expected: usize,
found: usize,
},
QuestionArityMismatch {
question_id: String,
kind: QuestionKind,
expected: usize,
found: usize,
},
BatchMismatch {
batch: usize,
maps: usize,
},
}Expand description
Errors from encoding a [hyprstream_decision::QuestionSet] or validating an
encoded request against its question specs.
Variants§
Tokenizer(String)
The tokenizer failed to encode the canonical serialization.
AnchorTokenMissing
The learned anchor token could not be assigned an id.
TokenBudgetExceeded
The serialized request exceeds the tokenizer-bound token budget
([hyprstream_decision::serialize::MAX_SERIALIZED_SPEC_TOKENS] by default).
Above this budget the two-stage score-then-choice recipe is mandatory (P0.1a).
AnchorCountMismatch
The number of anchor tokens in the encoding does not match the question arities. This means the tokenizer and the serialization contract disagree (e.g. the anchor token id belongs to a different bundle than the tokenizer in use) — fail loudly rather than misalign scorer readout positions.
Fields
QuestionArityMismatch
A question’s recorded anchor count does not match its spec arity when scoring.
Fields
kind: QuestionKindThe question kind.
BatchMismatch
The anchor-position batch passed to the scorer does not match the hidden-state batch dimension.
Trait Implementations§
Source§impl Error for Error
impl Error for Error
1.30.0 · 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()
Auto Trait Implementations§
impl Freeze for Error
impl RefUnwindSafe for Error
impl Send for Error
impl Sync for Error
impl Unpin for Error
impl UnsafeUnpin for Error
impl UnwindSafe for Error
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
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more§impl<T> Pointable for T
impl<T> Pointable for T
§impl<T> ToCompactString for Twhere
T: Display,
impl<T> ToCompactString for Twhere
T: Display,
§fn try_to_compact_string(&self) -> Result<CompactString, ToCompactStringError>
fn try_to_compact_string(&self) -> Result<CompactString, ToCompactStringError>
ToCompactString::to_compact_string()] Read more§fn to_compact_string(&self) -> CompactString
fn to_compact_string(&self) -> CompactString
CompactString]. Read more