Skip to main content

SyncSource

Trait SyncSource 

Source
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<Vec<String>>> { ... }
    fn unwatch(&mut self) -> Result<()> { ... }
    fn close(&mut self) -> Result<()> { ... }
}
Expand description

The in-engine handle to a source.

Required Methods§

Source

fn capabilities(&self) -> SourceCapabilities

Source

fn enumerate(&mut self) -> Result<Vec<SourceEntry>>

The full current scope.

Source

fn fetch(&mut self, path: &str) -> Result<Option<SourceItem>>

One member’s current state, or None when it left the scope.

Provided Methods§

Source

fn write(&mut self, _path: &str, _content: &str) -> Result<()>

Persist engine-authored bytes (write-through sources only).

Source

fn remove(&mut self, _path: &str) -> Result<()>

Remove a member (write-through sources only).

Source

fn watch(&mut self) -> Result<Receiver<Vec<String>>>

Subscribe to change batches: each received value is one batch of changed paths (watching sources only).

Source

fn unwatch(&mut self) -> Result<()>

Stop the batches.

Source

fn close(&mut self) -> Result<()>

Release the process / resources.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§