pub struct FileReadQuery {
pub path: String,
pub start_line: Option<u64>,
pub end_line: Option<u64>,
}Expand description
Query string for GET /v1/fs/file, which is FsQuery plus an optional line
range.
A separate type rather than two more fields on FsQuery, because a line range
means nothing on PUT /v1/fs/file or on either tar route and a shared type would
publish it on all four. mode is absent here for the same reason pointing the
other way: it is a property of a write.
The semantics are the AI SDK harness contract’s, verbatim, because that is the
consumer: 1-based and inclusive on both ends, and an end_line past the
file’s last line reads through EOF without an error. A caller asking for lines
1..1000 of a 12-line file gets the 12 lines and a 200, not a 416.
Fields§
§path: String§start_line: Option<u64>First line to return, 1-based inclusive. Absent means 1.
Zero is refused with 400 rather than treated as 1. A caller who sends 0 is working from a 0-based mental model, and silently reinterpreting it would hand back a window one line off from the one they will compute offsets against.
end_line: Option<u64>Last line to return, 1-based inclusive. Absent means through EOF.
Past the last line is not an error: the read returns through EOF. A range
ending before start_line is refused with 400, because it can only be a
caller who computed one of the two wrong — there is no file for which it is
the right question.
Trait Implementations§
Source§impl Debug for FileReadQuery
impl Debug for FileReadQuery
Source§impl Default for FileReadQuery
impl Default for FileReadQuery
Source§fn default() -> FileReadQuery
fn default() -> FileReadQuery
Source§impl<'de> Deserialize<'de> for FileReadQuery
impl<'de> Deserialize<'de> for FileReadQuery
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>,
Source§impl JsonSchema for FileReadQuery
impl JsonSchema for FileReadQuery
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
$ref keyword. Read more