pub struct FileTreeBlock {
pub root_path: String,
pub entries: Vec<FileEntry>,
}Expand description
FILE_TREE block — represents a directory structure.
Used to give the LLM spatial context about the project layout. Entries are nested recursively: directories contain child entries, which may themselves be directories.
Field layout within body:
┌──────────┬───────────┬───────────┬────────────────────────────┐
│ Field ID │ Wire Type │ Name │ Description │
├──────────┼───────────┼───────────┼────────────────────────────┤
│ 1 │ Bytes │ root_path │ Root directory path │
│ 2 │ Nested │ entries │ Repeated FileEntry │
└──────────┴───────────┴───────────┴────────────────────────────┘Each entries field (ID=2) contains one FileEntry encoded as
nested TLV. Multiple entries produce multiple field-2 occurrences,
similar to protobuf repeated fields.
Fields§
§root_path: String§entries: Vec<FileEntry>Implementations§
Source§impl FileTreeBlock
impl FileTreeBlock
Sourcepub fn encode_body(&self) -> Vec<u8> ⓘ
pub fn encode_body(&self) -> Vec<u8> ⓘ
Serialize this block’s fields into a TLV-encoded body.
Sourcepub fn decode_body(buf: &[u8]) -> Result<Self, TypeError>
pub fn decode_body(buf: &[u8]) -> Result<Self, TypeError>
Deserialize a FILE_TREE block from a TLV-encoded body.
Trait Implementations§
Source§impl Clone for FileTreeBlock
impl Clone for FileTreeBlock
Source§fn clone(&self) -> FileTreeBlock
fn clone(&self) -> FileTreeBlock
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for FileTreeBlock
impl Debug for FileTreeBlock
Source§impl PartialEq for FileTreeBlock
impl PartialEq for FileTreeBlock
impl Eq for FileTreeBlock
impl StructuralPartialEq for FileTreeBlock
Auto Trait Implementations§
impl Freeze for FileTreeBlock
impl RefUnwindSafe for FileTreeBlock
impl Send for FileTreeBlock
impl Sync for FileTreeBlock
impl Unpin for FileTreeBlock
impl UnsafeUnpin for FileTreeBlock
impl UnwindSafe for FileTreeBlock
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