pub struct Hub { /* private fields */ }Expand description
The host’s jobs and the page’s event stream.
Implementations§
Source§impl Hub
impl Hub
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.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze 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
Mutably borrows from an owned value. Read more
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> ⓘ
Converts
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> ⓘ
Converts
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 moreCreates a shared type from an unshared type.