Skip to main content

FileHost

Type Alias FileHost 

Source
pub type FileHost = Host<FileStore<HostState>>;
Expand description

A host provider that keeps its state in one JSON document, so several onevcs invocations see one another’s change requests.

Aliased Type§

pub struct FileHost { /* private fields */ }

Implementations§

Source§

impl FileHost

Source

pub fn create(path: impl Into<PathBuf>) -> Result<Self>

A host keeping its state at path: whatever is already there, or nothing opened against it.

Attaching rather than replacing, so a second host over the same path answers about the change requests the first one opened.

Source

pub fn seeded(path: impl Into<PathBuf>, state: HostState) -> Result<Self>

A host that starts from a scenario, keeping its state at path and replacing whatever was there.

Source

pub fn state(&self) -> Result<HostState>

Everything it knows, read back out of its document.