pub enum SequenceDecoderOutput {
Text(String),
Held,
Stopped,
StoppedWithText(String),
}Expand description
The output conditions/values of a SequenceDecoder::add_token_id operation. Result of decoding a token, indicating whether text was produced or a stop condition was met
Variants§
Text(String)
The text for the appended token_id
Held
A sequence of token_ids has been partially matched a stop sequence, so the text is held until either a match or a divergence
Stopped
Indicates that a stop sequence has been matched and the decoder is stopped. Subsequent calls to append_token_id will return an error
StoppedWithText(String)
Indicates that a stop token_id has been matched and the decoder is stopped. Subsequent calls to append_token_id will return an error The text for the stop token_id is returned
Auto Trait Implementations§
impl Freeze for SequenceDecoderOutput
impl RefUnwindSafe for SequenceDecoderOutput
impl Send for SequenceDecoderOutput
impl Sync for SequenceDecoderOutput
impl Unpin for SequenceDecoderOutput
impl UnsafeUnpin for SequenceDecoderOutput
impl UnwindSafe for SequenceDecoderOutput
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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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>
Converts
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>
Converts
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