pub struct IndexAllocator {
pub content_index: u32,
pub next_output_index: u32,
pub text_output_index: Option<u32>,
pub reasoning_output_index: Option<u32>,
pub next_sequence_number: u64,
}Expand description
Output-index / content-index / sequence-number allocators for the stream’s lifetime.
Fields§
§content_index: u32§next_output_index: u32§text_output_index: Option<u32>§reasoning_output_index: Option<u32>§next_sequence_number: u64Monotonic sequence counter for SSE events (spec-required
sequence_number).
Implementations§
Source§impl IndexAllocator
impl IndexAllocator
Sourcepub fn take_sequence_number(&mut self) -> u64
pub fn take_sequence_number(&mut self) -> u64
Allocate and return the next sequence number, then advance the counter.
Trait Implementations§
Source§impl Clone for IndexAllocator
impl Clone for IndexAllocator
Source§fn clone(&self) -> IndexAllocator
fn clone(&self) -> IndexAllocator
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for IndexAllocator
impl Debug for IndexAllocator
Source§impl Default for IndexAllocator
impl Default for IndexAllocator
Source§fn default() -> IndexAllocator
fn default() -> IndexAllocator
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for IndexAllocator
impl RefUnwindSafe for IndexAllocator
impl Send for IndexAllocator
impl Sync for IndexAllocator
impl Unpin for IndexAllocator
impl UnsafeUnpin for IndexAllocator
impl UnwindSafe for IndexAllocator
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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