pub struct Crate { /* private fields */ }
Expand description
Represents a crate with its data and indexes for quick access to its contents.
This struct stores the complete data of a crate and provides indexes for accessing individual files, directories, and search functionalities within the crate.
Implementations§
Source§impl Crate
impl Crate
Sourcepub fn get_file_by_file_line_range<P: AsRef<Path>>(
&self,
file: P,
_: FileLineRange,
) -> Result<Option<FileContent>>
pub fn get_file_by_file_line_range<P: AsRef<Path>>( &self, file: P, _: FileLineRange, ) -> Result<Option<FileContent>>
Retrieves the content of a file by specifying a line range.
Sourcepub fn get_file_by_line_range<P: AsRef<Path>>(
&self,
file: P,
line_range: impl RangeBounds<NonZeroUsize>,
) -> Result<Option<FileContent>>
pub fn get_file_by_line_range<P: AsRef<Path>>( &self, file: P, line_range: impl RangeBounds<NonZeroUsize>, ) -> Result<Option<FileContent>>
Retrieves the content of a file by specifying a line range.
This method is used to extract a specific range of lines from a file in the crate.
Sourcepub fn read_directory<P: AsRef<Path>>(&self, path: P) -> Option<&Directory>
pub fn read_directory<P: AsRef<Path>>(&self, path: P) -> Option<&Directory>
Reads the content of a specified directory within the crate.
Sourcepub fn search_item(&self, query: &ItemQuery) -> Vec<Item>
pub fn search_item(&self, query: &ItemQuery) -> Vec<Item>
Searches for items in the crate based on a given query.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for Crate
impl RefUnwindSafe for Crate
impl Send for Crate
impl Sync for Crate
impl Unpin for Crate
impl UnwindSafe for Crate
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