pub struct Surface { /* private fields */ }Expand description
The catalog bound to a store, a default repo and optional providers.
Implementations§
Source§impl Surface
impl Surface
Sourcepub fn new(
store: Store,
default_repo: &str,
provider: Option<Box<dyn EmbeddingProvider>>,
) -> Self
pub fn new( store: Store, default_repo: &str, provider: Option<Box<dyn EmbeddingProvider>>, ) -> Self
A surface over store whose default repo is default_repo (an id).
Mutations derive each repo’s root from its fs source.
Sourcepub fn with_doc_store(self, doc_store: Box<dyn DocStore>) -> Self
pub fn with_doc_store(self, doc_store: Box<dyn DocStore>) -> Self
Route every mutation’s file writes through doc_store regardless of
the repo’s sources (a runner’s in-memory store).
Sourcepub fn with_clock(self, clock: impl FnMut() -> String + 'static) -> Self
pub fn with_clock(self, clock: impl FnMut() -> String + 'static) -> Self
Stamp commits with clock() instead of the wall clock.
Sourcepub fn with_mutation_hook(self, hook: impl FnMut() + 'static) -> Self
pub fn with_mutation_hook(self, hook: impl FnMut() + 'static) -> Self
Called after every successful write (never after a dry run).
Sourcepub fn with_config(self, config: Config) -> Self
pub fn with_config(self, config: Config) -> Self
The matcher thresholds the observe tools pass through.
pub fn store(&self) -> &Store
pub fn store_mut(&mut self) -> &mut Store
pub fn default_repo(&self) -> &str
Sourcepub fn is_write_tool(name: &str) -> bool
pub fn is_write_tool(name: &str) -> bool
Whether name is a tool that can commit (a host serializes these
under the writer lock of spec/sync §7; dry_run calls still count
here — only the mutation hook knows a write actually happened).
Sourcepub fn call(&mut self, name: &str, args: Json) -> ToolOutcome
pub fn call(&mut self, name: &str, args: Json) -> ToolOutcome
Run a tool: its JSON result, or the error envelope.
Auto Trait Implementations§
impl !Freeze for Surface
impl !RefUnwindSafe for Surface
impl !Send for Surface
impl !Sync for Surface
impl !UnwindSafe for Surface
impl Unpin for Surface
impl UnsafeUnpin for Surface
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