pub struct TrajectoryView<'a> { /* private fields */ }Expand description
Read-only lifetime-scoped view into the trajectory being built mid-run.
Backed by the in-memory tail of the event stream. Distinct from
TrajectoryHandle — the handle is a post-run reference used to load
completed runs, TrajectoryView is a mid-run peek passed to critics.
Critics MUST NOT mutate the trajectory; this type enforces that by exposing only read accessors.
Implementations§
Source§impl<'a> TrajectoryView<'a>
impl<'a> TrajectoryView<'a>
pub fn new(events: &'a [Event]) -> Self
pub fn events(&self) -> &[Event]
Sourcepub fn turn_count(&self) -> u32
pub fn turn_count(&self) -> u32
Count of completed turns in the view — one per turn.finished event.
Sourcepub fn to_handle(&self) -> TrajectoryHandle
pub fn to_handle(&self) -> TrajectoryHandle
Copy the view’s events into an in-memory TrajectoryHandle. Useful
for critics / reflectors that want to pass the view downstream to an
API that takes a handle (e.g., crate::TrajectoryHandle::in_memory
via ReplayLlm).
Auto Trait Implementations§
impl<'a> Freeze for TrajectoryView<'a>
impl<'a> RefUnwindSafe for TrajectoryView<'a>
impl<'a> Send for TrajectoryView<'a>
impl<'a> Sync for TrajectoryView<'a>
impl<'a> Unpin for TrajectoryView<'a>
impl<'a> UnsafeUnpin for TrajectoryView<'a>
impl<'a> UnwindSafe for TrajectoryView<'a>
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