pub struct Host<T> { /* private fields */ }Expand description
The remote-host side of a run, over whichever store holds its state.
It is both interfaces at once: a RemoteHost a journey can call directly, and
the Hosting factory a run is handed. A host taken from the factory shares
this one’s state, so what a publication did is read back through the value the
journey created.
Implementations§
Source§impl Host<MemoryStore<HostState>>
impl Host<MemoryStore<HostState>>
Source§impl Host<FileStore<HostState>>
impl Host<FileStore<HostState>>
Sourcepub fn create(path: impl Into<PathBuf>) -> Result<Self>
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.
Trait Implementations§
Source§impl<T: Store<HostState>> RemoteHost for Host<T>
impl<T: Store<HostState>> RemoteHost for Host<T>
Source§fn ready_for_review(&self, cr: &ChangeRequest) -> Result<()>
fn ready_for_review(&self, cr: &ChangeRequest) -> Result<()>
Take the change request out of its draft state.
The call itself is what is recorded, rather than a flag that would read the same whether it was made once or twice: what a journey asks of this is whether a second publication over an already-lifted change asked the host for anything, and only the calls can answer that. A change already open for review is already what this asks for, so it succeeds — the caller wanted it ready, and it is.
Source§fn required_checks_on(&self, _base: &str) -> Result<RequiredChecks>
fn required_checks_on(&self, _base: &str) -> Result<RequiredChecks>
What the repository requires before a merge into base: the seeded answer,
or — unset — exactly the checks seeded as required, completely.
Source§fn describe_change(
&self,
cr: &ChangeRequest,
title: Option<&str>,
body: &str,
) -> Result<()>
fn describe_change( &self, cr: &ChangeRequest, title: Option<&str>, body: &str, ) -> Result<()>
Replace the description, recording the call.
The title and body go where open_change put the ones it was given, so what
change_description reads back is the same record whichever call wrote it —
and the call itself is kept, for the reason ready_for_review’s is: a journey
about a closeout asks what was written and in what order, and the current
description cannot say. A title that names nothing is refused as the real host
refuses one; a body is prose, and an empty one is a description a caller may
mean.
Source§fn change_description(&self, cr: &ChangeRequest) -> Result<Description>
fn change_description(&self, cr: &ChangeRequest) -> Result<Description>
The description as this host holds it: the title it was opened or last described with, and the body — empty where it was opened with none and never described since, which is what the real host answers for one.
Source§fn authenticated_user(&self) -> Result<String>
fn authenticated_user(&self) -> Result<String>
Source§fn open_change(&self, req: ChangeSpec) -> Result<ChangeRequest>
fn open_change(&self, req: ChangeSpec) -> Result<ChangeRequest>
Source§fn find_changes(&self, head: &str, base: &str) -> Result<Vec<ChangeRequest>>
fn find_changes(&self, head: &str, base: &str) -> Result<Vec<ChangeRequest>>
head into base.Source§fn change_checks(&self, cr: &ChangeRequest) -> Result<ChangeChecks>
fn change_checks(&self, cr: &ChangeRequest) -> Result<ChangeChecks>
Source§fn check_log(&self, cr: &ChangeRequest, check: &Check) -> Result<ArtifactId>
fn check_log(&self, cr: &ChangeRequest, check: &Check) -> Result<ArtifactId>
Source§fn merge(&self, cr: &ChangeRequest, policy: MergePolicy) -> Result<MergeOutcome>
fn merge(&self, cr: &ChangeRequest, policy: MergePolicy) -> Result<MergeOutcome>
Source§fn is_draft(&self, cr: &ChangeRequest) -> Result<bool>
fn is_draft(&self, cr: &ChangeRequest) -> Result<bool>
Source§fn merged_at(&self, cr: &ChangeRequest) -> Result<Option<Sha>>
fn merged_at(&self, cr: &ChangeRequest) -> Result<Option<Sha>>
None while the host
has not merged it. Read more