pub struct Hub {
pub issuer: Arc<Issuer>,
/* private fields */
}Expand description
The host’s jobs and the page’s event stream.
Fields§
§issuer: Arc<Issuer>Signs the person’s own commands this host sends, and checks them.
Implementations§
Source§impl Hub
impl Hub
Sourcepub fn new(root: Root, issuer: Arc<Issuer>) -> Arc<Self> ⓘ
pub fn new(root: Root, issuer: Arc<Issuer>) -> Arc<Self> ⓘ
A hub for the project root is (or will be, once bound), signing
with issuer.
Sourcepub fn progress(self: &Arc<Self>) -> Arc<dyn Progress> ⓘ
pub fn progress(self: &Arc<Self>) -> Arc<dyn Progress> ⓘ
A progress sink onto the page’s event stream, for work that is not a job (an Ask turn).
Sourcepub fn waiting(&self) -> Option<Value>
pub fn waiting(&self) -> Option<Value>
What waits for the person now (an ask or question event).
Sourcepub fn answer(&self, id: u64, reply: Reply) -> Result<(), String>
pub fn answer(&self, id: u64, reply: Reply) -> Result<(), String>
Answers what waits; Err when nothing does, or something else does.
Sourcepub fn stop(&self)
pub fn stop(&self)
Asks the running job to stop before its next task; a call waiting for the person is answered with “stop” (it keeps waiting, resumably).
Sourcepub fn exclusive<T>(&self, f: impl FnOnce() -> T) -> Result<T, String>
pub fn exclusive<T>(&self, f: impl FnOnce() -> T) -> Result<T, String>
Runs f while no job runs and none can start — for a short change
to the checkout (a commit): the check and the change are one step.
§Errors
A job is working.
Sourcepub fn start(
self: &Arc<Self>,
run: Runnable,
input: Option<String>,
feature: Option<String>,
command: String,
root: PathBuf,
) -> Result<u64, String>
pub fn start( self: &Arc<Self>, run: Runnable, input: Option<String>, feature: Option<String>, command: String, root: PathBuf, ) -> Result<u64, String>
Starts run (with input for actions that take one) for feature,
in root (the bound project’s, or a folder of a host not bound yet);
Err when a job is already working.
Sourcepub fn start_fix(
self: &Arc<Self>,
argvs: Vec<Vec<String>>,
root: PathBuf,
) -> Result<u64, String>
pub fn start_fix( self: &Arc<Self>, argvs: Vec<Vec<String>>, root: PathBuf, ) -> Result<u64, String>
Runs the person’s own command — argvs this host issued, checked by
the caller — in root, as a job: its output lines go to the page
(output events), Stop ends it, and it ends in its result.
Sourcepub fn start_speccoder(
self: &Arc<Self>,
args: Vec<String>,
root: PathBuf,
) -> Result<u64, String>
pub fn start_speccoder( self: &Arc<Self>, args: Vec<String>, root: PathBuf, ) -> Result<u64, String>
Runs one of speccoder’s own commands that has no action of its own
(speccoder run --ignore-checklists) — args issued by this host,
checked by the caller — as a job of speccoder’s: no time limit, Stop
asks it to stop, its run shows as any run does (the project’s live
state), and its own result is the job’s.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for Hub
impl Forget for Hub
impl Move for Hub
impl RefUnwindSafe for Hub
impl Send for Hub
impl Sync for Hub
impl Unpin for Hub
impl UnsafeUnpin for Hub
impl UnwindSafe for Hub
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more