pub struct ContentNode {
pub file_path: PathBuf,
pub content_type: ContentType,
pub chunks: Vec<ContentChunk>,
pub ast_nodes: Vec<NodeId>,
pub last_indexed: SystemTime,
pub file_size: usize,
pub is_monitored: bool,
}Expand description
Content node representing an entire file’s content structure
Fields§
§file_path: PathBufFile path
content_type: ContentTypeContent type of the file
chunks: Vec<ContentChunk>All content chunks in this file
ast_nodes: Vec<NodeId>AST nodes associated with this file
last_indexed: SystemTimeWhen this file was last indexed
file_size: usizeFile size in bytes
is_monitored: boolWhether this file is actively monitored for changes
Implementations§
Source§impl ContentNode
impl ContentNode
Sourcepub fn new(file_path: PathBuf, content_type: ContentType) -> Self
pub fn new(file_path: PathBuf, content_type: ContentType) -> Self
Create a new content node
Sourcepub fn add_chunk(&mut self, chunk: ContentChunk)
pub fn add_chunk(&mut self, chunk: ContentChunk)
Add a content chunk
Sourcepub fn add_ast_node(&mut self, node_id: NodeId)
pub fn add_ast_node(&mut self, node_id: NodeId)
Add related AST node
Sourcepub fn get_all_tokens(&self) -> Vec<String>
pub fn get_all_tokens(&self) -> Vec<String>
Get all tokens from all chunks
Trait Implementations§
Source§impl Clone for ContentNode
impl Clone for ContentNode
Source§fn clone(&self) -> ContentNode
fn clone(&self) -> ContentNode
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 ContentNode
impl Debug for ContentNode
Source§impl<'de> Deserialize<'de> for ContentNode
impl<'de> Deserialize<'de> for ContentNode
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>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for ContentNode
impl RefUnwindSafe for ContentNode
impl Send for ContentNode
impl Sync for ContentNode
impl Unpin for ContentNode
impl UnwindSafe for ContentNode
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more