pub enum Event {
InferDone {
text: String,
tokens_out: u32,
},
Opened {
handle: Handle,
len: u64,
},
Sliced {
text: String,
next_offset: u64,
},
Emitted,
}Expand description
What the host feeds back into the guest’s step export after carrying out a
Command.
Variants§
InferDone
Generation finished.
Fields
Opened
A file was opened.
Fields
§
handle: HandleUse this in subsequent Command::Slice calls.
Sliced
A window of a file was read.
Fields
§
next_offset: u64Where the returned text actually ended.
This is not always offset + len from the request: the host cuts
a window back to a UTF-8 character boundary, because a caller picking
window sizes has no idea where characters begin, and a naive split
would corrupt a multi-byte character at nearly every seam. A guest
walking a file must resume from this value rather than advancing by
the length it asked for.
Emitted
Progress was forwarded. Carries nothing; it exists so Emit has a reply
and the command loop keeps its shape.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Event
impl<'de> Deserialize<'de> for Event
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl StructuralPartialEq for Event
Auto Trait Implementations§
impl Freeze for Event
impl RefUnwindSafe for Event
impl Send for Event
impl Sync for Event
impl Unpin for Event
impl UnsafeUnpin for Event
impl UnwindSafe for Event
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