Skip to main content

MemoryProvider

Struct MemoryProvider 

Source
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§

Source§

impl MemoryProvider

Source

pub fn new() -> Self

Create a new empty provider with / as the working directory.

Trait Implementations§

Source§

impl Clone for MemoryProvider

Source§

fn clone(&self) -> MemoryProvider

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for MemoryProvider

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for MemoryProvider

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl Vfs for MemoryProvider

Source§

fn ls( &self, path: &str, opts: LsOptions, ) -> BoxFuture<'_, Result<Vec<DirEntry>, VfsError>>

List directory contents. ls [opts] <path> Read more
Source§

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>>

Write bytes to a file (creates or overwrites). >
Source§

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>>

Search file contents. grep [opts] <pattern>
Source§

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>>

Upload a file from from (local path) to to (VFS path).
Source§

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>>

Return the current working directory. pwd
Source§

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>>

Read the first N lines or bytes. head [opts] <path> Read more
Source§

fn tail( &self, path: &str, opts: HeadTailOptions, ) -> BoxFuture<'_, Result<String, VfsError>>

Read the last N lines or bytes. tail [opts] <path> Read more
Source§

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>>

File metadata. stat <path>
Source§

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>>

Disk usage. du [opts] <path> Read more
Source§

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>>

Create a directory. mkdir [opts] <path> Read more
Source§

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>>

Compare two files. diff [opts] <a> <b> Read more
Source§

fn rm(&self, path: &str, opts: RmOptions) -> BoxFuture<'_, Result<(), VfsError>>

Remove a file or directory. rm [opts] <path> Read more
Source§

fn cp( &self, from: &str, to: &str, opts: CpOptions, ) -> BoxFuture<'_, Result<TransferResult, VfsError>>

Copy from to to. cp [opts] <from> <to> Read more
Source§

fn find( &self, path: &str, opts: FindOptions, ) -> BoxFuture<'_, Result<Vec<FindEntry>, VfsError>>

Search for files by criteria. find [opts] <path> Read more
Source§

fn tree( &self, path: &str, opts: TreeOptions, ) -> BoxFuture<'_, Result<TreeEntry, VfsError>>

Recursive directory tree. tree [opts] <path> Read more
Source§

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

Return the capabilities supported by this provider.
Source§

fn provider_name(&self) -> &'static str

Human-readable provider type name (e.g. "LocalProvider", "MemoryProvider"). Read more
Source§

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>>

Change file permissions. chmod <mode> <path>
Source§

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>>

Check whether a previously-read file has been modified externally. Read more
Source§

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>>

Check the status of an indexing operation.
Semantic search across indexed content. Read more
Hybrid BM25 + vector search across indexed content. Read more
Source§

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>>

List all detected communities with their member counts. Read more
Source§

fn community_members( &self, community_id: u64, ) -> BoxFuture<'_, Result<CommunityMembersResult, VfsError>>

List the symbol members of a specific community. Read more
Search for communities whose member names match query. Read more
Source§

fn community_summary( &self, community_id: u64, ) -> BoxFuture<'_, Result<CommunitySummaryResult, VfsError>>

Get (or generate) a natural-language summary for a community. Read more
Source§

fn mount_info(&self) -> Vec<MountInfo>

Return mount information for this provider. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DynClone for T
where T: Clone,

Source§

fn __clone_box(&self, _: Private) -> *mut ()

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> FutureExt for T

Source§

fn with_context(self, otel_cx: Context) -> WithContext<Self>

Attaches the provided Context to this type, returning a WithContext wrapper. Read more
Source§

fn with_current_context(self) -> WithContext<Self>

Attaches the current Context to this type, returning a WithContext wrapper. Read more
Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more