Skip to main content

render_code_frame

Function render_code_frame 

Source
pub fn render_code_frame(
    source: &str,
    location: &CodeFrameLocation,
    options: &CodeFrameOptions,
) -> Result<Option<String>>
Expand description

Renders a code frame showing the location of an error in source code.

Returns Ok(None) when the location is out of range (e.g., the source is empty or the start line exceeds the number of lines). This lets callers distinguish “no code frame to show” from a genuine rendering error.