pub struct MemoryProvider { /* private fields */ }Expand description
Ephemeral in-memory VFS provider.
All data lives for the lifetime of the backend instance. Suitable for agent scratchpads and test fixtures.
Implementations§
Trait Implementations§
Source§impl Clone for MemoryProvider
impl Clone for MemoryProvider
Source§fn clone(&self) -> MemoryProvider
fn clone(&self) -> MemoryProvider
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 MemoryProvider
impl Debug for MemoryProvider
Source§impl Default for MemoryProvider
impl Default for MemoryProvider
Source§impl Vfs for MemoryProvider
impl Vfs for MemoryProvider
Source§fn ls(
&self,
path: &str,
opts: LsOptions,
) -> BoxFuture<'_, Result<Vec<DirEntry>, VfsError>>
fn ls( &self, path: &str, opts: LsOptions, ) -> BoxFuture<'_, Result<Vec<DirEntry>, VfsError>>
List directory contents.
ls [opts] <path> Read moreSource§fn read(&self, path: &str) -> BoxFuture<'_, Result<FileContent, VfsError>>
fn read(&self, path: &str) -> BoxFuture<'_, Result<FileContent, VfsError>>
Read entire file contents.
cat <path>Source§fn write(
&self,
path: &str,
content: &[u8],
) -> BoxFuture<'_, Result<WriteResult, VfsError>>
fn write( &self, path: &str, content: &[u8], ) -> BoxFuture<'_, Result<WriteResult, VfsError>>
Write bytes to a file (creates or overwrites).
>Source§fn edit(
&self,
path: &str,
old: &str,
new: &str,
) -> BoxFuture<'_, Result<EditResult, VfsError>>
fn edit( &self, path: &str, old: &str, new: &str, ) -> BoxFuture<'_, Result<EditResult, VfsError>>
Edit a file by replacing
old with new (first occurrence). sed-like.Source§fn grep(
&self,
pattern: &str,
opts: GrepOptions,
) -> BoxFuture<'_, Result<Vec<GrepMatch>, VfsError>>
fn grep( &self, pattern: &str, opts: GrepOptions, ) -> BoxFuture<'_, Result<Vec<GrepMatch>, VfsError>>
Search file contents.
grep [opts] <pattern>Source§fn glob(&self, pattern: &str) -> BoxFuture<'_, Result<Vec<GlobEntry>, VfsError>>
fn glob(&self, pattern: &str) -> BoxFuture<'_, Result<Vec<GlobEntry>, VfsError>>
Glob for file paths matching a pattern.
Source§fn upload(
&self,
_from: &str,
_to: &str,
) -> BoxFuture<'_, Result<TransferResult, VfsError>>
fn upload( &self, _from: &str, _to: &str, ) -> BoxFuture<'_, Result<TransferResult, VfsError>>
Upload a file from
from (local path) to to (VFS path).Source§fn download(
&self,
_from: &str,
_to: &str,
) -> BoxFuture<'_, Result<TransferResult, VfsError>>
fn download( &self, _from: &str, _to: &str, ) -> BoxFuture<'_, Result<TransferResult, VfsError>>
Download a file from
from (VFS path) to to (local path).Source§fn pwd(&self) -> BoxFuture<'_, Result<String, VfsError>>
fn pwd(&self) -> BoxFuture<'_, Result<String, VfsError>>
Return the current working directory.
pwdSource§fn cd(&self, path: &str) -> BoxFuture<'_, Result<(), VfsError>>
fn cd(&self, path: &str) -> BoxFuture<'_, Result<(), VfsError>>
Change the current working directory.
cd <path>Source§fn head(
&self,
path: &str,
opts: HeadTailOptions,
) -> BoxFuture<'_, Result<String, VfsError>>
fn head( &self, path: &str, opts: HeadTailOptions, ) -> BoxFuture<'_, Result<String, VfsError>>
Read the first N lines or bytes.
head [opts] <path> Read moreSource§fn tail(
&self,
path: &str,
opts: HeadTailOptions,
) -> BoxFuture<'_, Result<String, VfsError>>
fn tail( &self, path: &str, opts: HeadTailOptions, ) -> BoxFuture<'_, Result<String, VfsError>>
Read the last N lines or bytes.
tail [opts] <path> Read moreSource§fn read_range(
&self,
path: &str,
range: ReadRange,
) -> BoxFuture<'_, Result<String, VfsError>>
fn read_range( &self, path: &str, range: ReadRange, ) -> BoxFuture<'_, Result<String, VfsError>>
Read a sub-range of a file by line numbers or byte offsets. Read more
Source§fn stat(&self, path: &str) -> BoxFuture<'_, Result<FileInfo, VfsError>>
fn stat(&self, path: &str) -> BoxFuture<'_, Result<FileInfo, VfsError>>
File metadata.
stat <path>Source§fn wc(&self, path: &str) -> BoxFuture<'_, Result<WordCount, VfsError>>
fn wc(&self, path: &str) -> BoxFuture<'_, Result<WordCount, VfsError>>
Line, word, and byte counts.
wc <path>Source§fn du(
&self,
path: &str,
opts: DuOptions,
) -> BoxFuture<'_, Result<DiskUsage, VfsError>>
fn du( &self, path: &str, opts: DuOptions, ) -> BoxFuture<'_, Result<DiskUsage, VfsError>>
Disk usage.
du [opts] <path> Read moreSource§fn append(
&self,
path: &str,
content: &[u8],
) -> BoxFuture<'_, Result<WriteResult, VfsError>>
fn append( &self, path: &str, content: &[u8], ) -> BoxFuture<'_, Result<WriteResult, VfsError>>
Append bytes to a file (creates if absent).
>>Source§fn mkdir(
&self,
_path: &str,
_opts: MkdirOptions,
) -> BoxFuture<'_, Result<(), VfsError>>
fn mkdir( &self, _path: &str, _opts: MkdirOptions, ) -> BoxFuture<'_, Result<(), VfsError>>
Create a directory.
mkdir [opts] <path> Read moreSource§fn touch(&self, path: &str) -> BoxFuture<'_, Result<(), VfsError>>
fn touch(&self, path: &str) -> BoxFuture<'_, Result<(), VfsError>>
Create an empty file or update its timestamp.
touch <path>Source§fn diff(
&self,
a: &str,
b: &str,
opts: DiffOptions,
) -> BoxFuture<'_, Result<DiffResult, VfsError>>
fn diff( &self, a: &str, b: &str, opts: DiffOptions, ) -> BoxFuture<'_, Result<DiffResult, VfsError>>
Compare two files.
diff [opts] <a> <b> Read moreSource§fn rm(&self, path: &str, opts: RmOptions) -> BoxFuture<'_, Result<(), VfsError>>
fn rm(&self, path: &str, opts: RmOptions) -> BoxFuture<'_, Result<(), VfsError>>
Remove a file or directory.
rm [opts] <path> Read moreSource§fn cp(
&self,
from: &str,
to: &str,
opts: CpOptions,
) -> BoxFuture<'_, Result<TransferResult, VfsError>>
fn cp( &self, from: &str, to: &str, opts: CpOptions, ) -> BoxFuture<'_, Result<TransferResult, VfsError>>
Source§fn find(
&self,
path: &str,
opts: FindOptions,
) -> BoxFuture<'_, Result<Vec<FindEntry>, VfsError>>
fn find( &self, path: &str, opts: FindOptions, ) -> BoxFuture<'_, Result<Vec<FindEntry>, VfsError>>
Search for files by criteria.
find [opts] <path> Read moreSource§fn tree(
&self,
path: &str,
opts: TreeOptions,
) -> BoxFuture<'_, Result<TreeEntry, VfsError>>
fn tree( &self, path: &str, opts: TreeOptions, ) -> BoxFuture<'_, Result<TreeEntry, VfsError>>
Recursive directory tree.
tree [opts] <path> Read moreSource§fn mv_file(
&self,
from: &str,
to: &str,
) -> BoxFuture<'_, Result<TransferResult, VfsError>>
fn mv_file( &self, from: &str, to: &str, ) -> BoxFuture<'_, Result<TransferResult, VfsError>>
Move / rename
from to to. mv <from> <to>Source§fn capabilities(&self) -> VfsCapabilities
fn capabilities(&self) -> VfsCapabilities
Return the capabilities supported by this provider.
Source§fn provider_name(&self) -> &'static str
fn provider_name(&self) -> &'static str
Source§fn ln(
&self,
target: &str,
link: &str,
symbolic: bool,
) -> BoxFuture<'_, Result<(), VfsError>>
fn ln( &self, target: &str, link: &str, symbolic: bool, ) -> BoxFuture<'_, Result<(), VfsError>>
Create a link.
ln [-s] <target> <link>Source§fn chmod(&self, path: &str, mode: u32) -> BoxFuture<'_, Result<(), VfsError>>
fn chmod(&self, path: &str, mode: u32) -> BoxFuture<'_, Result<(), VfsError>>
Change file permissions.
chmod <mode> <path>Source§fn watch(&self, path: &str) -> BoxFuture<'_, Result<(), VfsError>>
fn watch(&self, path: &str) -> BoxFuture<'_, Result<(), VfsError>>
Begin watching a path for external modifications. Read more
Source§fn check_stale(&self, path: &str) -> BoxFuture<'_, Result<(), VfsError>>
fn check_stale(&self, path: &str) -> BoxFuture<'_, Result<(), VfsError>>
Check whether a previously-read file has been modified externally. Read more
Source§fn index(
&self,
path: &str,
opts: IndexOptions,
) -> BoxFuture<'_, Result<IndexHandle, VfsError>>
fn index( &self, path: &str, opts: IndexOptions, ) -> BoxFuture<'_, Result<IndexHandle, VfsError>>
Start indexing a directory for semantic search. Read more
Source§fn index_status(
&self,
index_id: &str,
) -> BoxFuture<'_, Result<IndexStatus, VfsError>>
fn index_status( &self, index_id: &str, ) -> BoxFuture<'_, Result<IndexStatus, VfsError>>
Check the status of an indexing operation.
Source§fn semantic_search(
&self,
query: &str,
opts: SemanticSearchOptions,
) -> BoxFuture<'_, Result<Vec<SemanticSearchResult>, VfsError>>
fn semantic_search( &self, query: &str, opts: SemanticSearchOptions, ) -> BoxFuture<'_, Result<Vec<SemanticSearchResult>, VfsError>>
Semantic search across indexed content. Read more
Source§fn hybrid_search(
&self,
query: &str,
opts: HybridSearchOptions,
) -> BoxFuture<'_, Result<Vec<HybridSearchResult>, VfsError>>
fn hybrid_search( &self, query: &str, opts: HybridSearchOptions, ) -> BoxFuture<'_, Result<Vec<HybridSearchResult>, VfsError>>
Hybrid BM25 + vector search across indexed content. Read more
Source§fn skeleton<'a>(
&'a self,
path: &'a str,
) -> BoxFuture<'a, Result<String, VfsError>>
fn skeleton<'a>( &'a self, path: &'a str, ) -> BoxFuture<'a, Result<String, VfsError>>
Return only the function and method signatures of a source file,
stripping all body content. Read more
Source§fn list_communities(
&self,
) -> BoxFuture<'_, Result<Vec<CommunityEntry>, VfsError>>
fn list_communities( &self, ) -> BoxFuture<'_, Result<Vec<CommunityEntry>, VfsError>>
List all detected communities with their member counts. Read more
Source§fn community_members(
&self,
community_id: u64,
) -> BoxFuture<'_, Result<CommunityMembersResult, VfsError>>
fn community_members( &self, community_id: u64, ) -> BoxFuture<'_, Result<CommunityMembersResult, VfsError>>
List the symbol members of a specific community. Read more
Source§fn community_search(
&self,
query: &str,
opts: CommunitySearchOptions,
) -> BoxFuture<'_, Result<Vec<CommunitySearchResult>, VfsError>>
fn community_search( &self, query: &str, opts: CommunitySearchOptions, ) -> BoxFuture<'_, Result<Vec<CommunitySearchResult>, VfsError>>
Search for communities whose member names match
query. Read moreSource§fn community_summary(
&self,
community_id: u64,
) -> BoxFuture<'_, Result<CommunitySummaryResult, VfsError>>
fn community_summary( &self, community_id: u64, ) -> BoxFuture<'_, Result<CommunitySummaryResult, VfsError>>
Get (or generate) a natural-language summary for a community. Read more
Auto Trait Implementations§
impl Freeze for MemoryProvider
impl RefUnwindSafe for MemoryProvider
impl Send for MemoryProvider
impl Sync for MemoryProvider
impl Unpin for MemoryProvider
impl UnsafeUnpin for MemoryProvider
impl UnwindSafe for MemoryProvider
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