pub struct LoadedInstructions {
pub path: PathBuf,
pub content: String,
pub mtime: SystemTime,
pub byte_len: usize,
pub truncated: bool,
pub sources: Vec<InstructionSource>,
}Expand description
One-shot snapshot of loaded project instructions. Stored on App and
NonInteractiveRunner so the per-turn auto-reload check has
something to compare against.
Fields§
§path: PathBufPrimary absolute path the content was read from. Kept for
compatibility with older renderer/status code; sources
carries the full set.
content: StringFile body, possibly truncated. The truncation marker is appended in-place so the model sees the elision.
mtime: SystemTimemtime at last read — compared against the next stat() to
decide whether to re-read.
byte_len: usizeOriginal file size on disk (before any truncation).
truncated: boolTrue when the file was larger than MAX_INSTRUCTIONS_BYTES
and the content was clipped + marker appended.
sources: Vec<InstructionSource>All files that contributed to content.
Implementations§
Source§impl LoadedInstructions
impl LoadedInstructions
Sourcepub fn approx_tokens(&self) -> usize
pub fn approx_tokens(&self) -> usize
Approximate token count for status messages. ~4 chars/token is the rule of thumb that’s correct enough for user-facing display.
Trait Implementations§
Source§impl Clone for LoadedInstructions
impl Clone for LoadedInstructions
Source§fn clone(&self) -> LoadedInstructions
fn clone(&self) -> LoadedInstructions
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for LoadedInstructions
impl RefUnwindSafe for LoadedInstructions
impl Send for LoadedInstructions
impl Sync for LoadedInstructions
impl Unpin for LoadedInstructions
impl UnsafeUnpin for LoadedInstructions
impl UnwindSafe for LoadedInstructions
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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>
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>
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