Skip to main content

SourcePreviewResponse

Struct SourcePreviewResponse 

Source
pub struct SourcePreviewResponse {
    pub frame_id: FrameId,
    pub source_file: String,
    pub target_line: u32,
    pub target_col: Option<u32>,
    pub total_lines: u32,
    pub html: String,
    pub context_lines: Option<Vec<SourceContextLine>>,
    pub compact_context_lines: Option<Vec<SourceContextLine>>,
    pub context_line: Option<String>,
    pub frame_header: Option<String>,
}
Expand description

Response for GET /api/source/preview.

Fields§

§frame_id: FrameId§source_file: String§target_line: u32§target_col: Option<u32>§total_lines: u32§html: String

Full arborium-highlighted HTML for the entire file. The frontend splits this into per-line strings using splitHighlightedHtml.

§context_lines: Option<Vec<SourceContextLine>>

Highlighted, collapsed context lines for the cut scope excerpt. Separators replace elided regions; line numbers are original file line numbers.

§compact_context_lines: Option<Vec<SourceContextLine>>

Highlighted, collapsed context lines for the aggressively cut scope excerpt. Intended for compact/collapsed displays.

§context_line: Option<String>

Highlighted HTML for a compact target-statement snippet.

Preserves statement structure (may include newlines) and aggressively elides long inner block bodies with a placeholder. Used for compact collapsed-frame display.

§frame_header: Option<String>

Highlighted HTML for the frame header — the label identifying which function or method this frame belongs to.

Format: fn name(params...) for free functions, Type::fn name(params...) for impl methods (module path included when present). Visibility modifiers are omitted. Currently only populated for Rust.

Trait Implementations§

Source§

impl<'ʄ> Facet<'ʄ> for SourcePreviewResponse

Source§

const SHAPE: &'static Shape

The shape of this type, including: whether it’s a Struct, an Enum, something else? Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.