pub struct TextGenerationListener { /* private fields */ }Expand description
The text generation listener accumulate the generated text in a string that can be obtained at the end of the job with the handle finished method.
Trait Implementations§
Source§impl Default for TextGenerationListener
impl Default for TextGenerationListener
Source§fn default() -> TextGenerationListener
fn default() -> TextGenerationListener
Returns the “default value” for a type. Read more
Source§impl InferenceJobListener for TextGenerationListener
impl InferenceJobListener for TextGenerationListener
Source§type CompletedItem = String
type CompletedItem = String
The item that is returned by the listener.
Source§fn on_text(&mut self, text: String)
fn on_text(&mut self, text: String)
Called when new text is generated from an inference job.
Source§fn on_finished(self) -> Self::CompletedItem
fn on_finished(self) -> Self::CompletedItem
Called when the job is finished. Read more
Auto Trait Implementations§
impl Freeze for TextGenerationListener
impl RefUnwindSafe for TextGenerationListener
impl Send for TextGenerationListener
impl Sync for TextGenerationListener
impl Unpin for TextGenerationListener
impl UnwindSafe for TextGenerationListener
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> 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