pub struct InstructionCandidate {
pub path: PathBuf,
pub scope: String,
pub content_hash: u64,
pub byte_count: usize,
pub content: Option<String>,
pub truncated: bool,
pub applicable: bool,
}Expand description
An instruction source considered for selection.
Mirrors the fields the policy needs from an application’s instruction-source type without forcing the caller to clone full content; selection works on metadata only.
Fields§
§path: PathBufAbsolute source path.
scope: StringScope label — "." for root, or a relative subtree path.
content_hash: u64Content hash of the full source.
byte_count: usizeOriginal byte count (before any truncation at load time).
content: Option<String>Renderable instruction text (size-capped), used for prompt projection
when the source is selected as normal context content. None when only
metadata is needed.
truncated: boolWhether the source was truncated when loaded.
applicable: boolWhether the source is applicable this turn (closest-first ordering is the caller’s responsibility).
Implementations§
Source§impl InstructionCandidate
impl InstructionCandidate
Sourcepub fn scope_depth(&self) -> usize
pub fn scope_depth(&self) -> usize
Depth of the scope: . = 0, src = 1, src/core = 2.
Trait Implementations§
Source§impl Clone for InstructionCandidate
impl Clone for InstructionCandidate
Source§fn clone(&self) -> InstructionCandidate
fn clone(&self) -> InstructionCandidate
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 InstructionCandidate
impl Debug for InstructionCandidate
impl Eq for InstructionCandidate
Source§impl PartialEq for InstructionCandidate
impl PartialEq for InstructionCandidate
impl StructuralPartialEq for InstructionCandidate
Auto Trait Implementations§
impl Freeze for InstructionCandidate
impl RefUnwindSafe for InstructionCandidate
impl Send for InstructionCandidate
impl Sync for InstructionCandidate
impl Unpin for InstructionCandidate
impl UnsafeUnpin for InstructionCandidate
impl UnwindSafe for InstructionCandidate
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