pub trait SyncSource {
// Required methods
fn capabilities(&self) -> SourceCapabilities;
fn enumerate(&mut self) -> Result<Vec<SourceEntry>>;
fn fetch(&mut self, path: &str) -> Result<Option<SourceItem>>;
// Provided methods
fn write(&mut self, _path: &str, _content: &str) -> Result<()> { ... }
fn remove(&mut self, _path: &str) -> Result<()> { ... }
fn watch(&mut self) -> Result<Receiver<WatchEvent>> { ... }
fn unwatch(&mut self) -> Result<()> { ... }
fn close(&mut self) -> Result<()> { ... }
}Expand description
The in-engine handle to a source.
Required Methods§
fn capabilities(&self) -> SourceCapabilities
Sourcefn enumerate(&mut self) -> Result<Vec<SourceEntry>>
fn enumerate(&mut self) -> Result<Vec<SourceEntry>>
The full current scope.
Provided Methods§
Sourcefn write(&mut self, _path: &str, _content: &str) -> Result<()>
fn write(&mut self, _path: &str, _content: &str) -> Result<()>
Persist engine-authored bytes (write-through sources only).
Sourcefn watch(&mut self) -> Result<Receiver<WatchEvent>>
fn watch(&mut self) -> Result<Receiver<WatchEvent>>
Subscribe to the watch stream (watching sources only): one
WatchEvent::Ready once the feed is primed, then one
WatchEvent::Batch per batch of changed paths.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".