pub struct Sketch {
pub source: String,
pub holes: Vec<Hole>,
}Expand description
A program sketch: a partial program with holes to fill.
Fields§
§source: StringThe sketch source text (holes written as ??<id>).
holes: Vec<Hole>The holes present in this sketch.
Implementations§
Source§impl Sketch
impl Sketch
Sourcepub fn new(source: impl Into<String>, holes: Vec<Hole>) -> Self
pub fn new(source: impl Into<String>, holes: Vec<Hole>) -> Self
Create a new sketch from source text and holes.
Sourcepub fn fill_hole(&self, hole_id: usize, expr: &str) -> Sketch
pub fn fill_hole(&self, hole_id: usize, expr: &str) -> Sketch
Fill a hole with the given expression, returning a new sketch.
Sourcepub fn is_complete(&self) -> bool
pub fn is_complete(&self) -> bool
Check if the sketch is complete (no holes remaining).
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Sketch
impl RefUnwindSafe for Sketch
impl Send for Sketch
impl Sync for Sketch
impl Unpin for Sketch
impl UnsafeUnpin for Sketch
impl UnwindSafe for Sketch
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