Line Range • Rust AI Agent SDK

LineRange: A line range within a file.

LineRange

Defined in the context module.

Rust AI Agent SDK

A line range within a file.

Fields

NameTypeDescription
startusizeStart line (1-indexed)
endusizeEnd line (1-indexed)
contentOption<String>Content of the lines (optional)
relevance_scoref32Relevance score (0.0 to 1.0)

Methods

new

rust
fn new(start: usize, end: usize) -> Self

Create a new line range.

Parameters:

NameType
startusize
endusize

content

rust
fn content(mut self, content: impl Into<String>) -> Self

Set content.

Parameters:

NameType
contentimpl Into&lt;String&gt;

relevance_score

rust
fn relevance_score(mut self, score: f32) -> Self

Set relevance score.

Parameters:

NameType
scoref32

line_count

rust
fn line_count(&self) -> usize

Get line count.

Source

View on GitHub

praisonai/src/context/mod.rs at line 555