pub struct ContextBundle {
pub file: LeanFile,
pub line: u32,
pub total_lines: usize,
pub declaration: Option<Declaration>,
pub imports: Vec<String>,
pub surrounding: SourceWindow,
pub diagnostics: Vec<Diagnostic>,
pub goal_state: Option<GoalState>,
pub provenance: Option<Provenance>,
pub suggested_prompt: String,
}Expand description
A compact context bundle around one line of a Lean file.
Fields§
§file: LeanFileSource file the bundle describes.
line: u32One-based target line, clamped into the file’s range.
total_lines: usizeTotal number of source lines in the file.
declaration: Option<Declaration>Enclosing declaration, when one is detectable.
imports: Vec<String>Import lines found in the file, in source order.
surrounding: SourceWindowSurrounding source window.
diagnostics: Vec<Diagnostic>Diagnostics relevant to the target line, when a trace was run.
goal_state: Option<GoalState>Goal state extracted from a relevant diagnostic, when present.
provenance: Option<Provenance>Tooling provenance, when a trace was run.
suggested_prompt: StringReady-to-paste prompt assembled from the fields above.
Implementations§
Source§impl ContextBundle
impl ContextBundle
Sourcepub fn to_markdown(&self) -> String
pub fn to_markdown(&self) -> String
Render the bundle as Markdown for human review or a chat paste.
Trait Implementations§
Source§impl Clone for ContextBundle
impl Clone for ContextBundle
Source§fn clone(&self) -> ContextBundle
fn clone(&self) -> ContextBundle
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 ContextBundle
impl Debug for ContextBundle
Source§impl<'de> Deserialize<'de> for ContextBundle
impl<'de> Deserialize<'de> for ContextBundle
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 Eq for ContextBundle
Source§impl PartialEq for ContextBundle
impl PartialEq for ContextBundle
Source§fn eq(&self, other: &ContextBundle) -> bool
fn eq(&self, other: &ContextBundle) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl Serialize for ContextBundle
impl Serialize for ContextBundle
impl StructuralPartialEq for ContextBundle
Auto Trait Implementations§
impl Freeze for ContextBundle
impl RefUnwindSafe for ContextBundle
impl Send for ContextBundle
impl Sync for ContextBundle
impl Unpin for ContextBundle
impl UnsafeUnpin for ContextBundle
impl UnwindSafe for ContextBundle
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