pub struct Server {
pub root: PathBuf,
pub runner: PathBuf,
pub launch: Launch,
pub input_dir: PathBuf,
pub input_store_bytes: u64,
pub shutdown: AtomicBool,
/* private fields */
}Fields§
§root: PathBuf§runner: PathBuf§launch: Launch§input_dir: PathBuf§input_store_bytes: u64Limit of the input store’s total size.
shutdown: AtomicBoolImplementations§
Source§impl Server
impl Server
Sourcepub fn cli(
&self,
args: &[&str],
timeout: Duration,
ctx: &Ctx,
) -> Result<Value, Fail>
pub fn cli( &self, args: &[&str], timeout: Duration, ctx: &Ctx, ) -> Result<Value, Fail>
Runs optimization-run --root ROOT ARGS and returns its JSON output,
or its coded error. A read stops early when the request is cancelled.
Sourcepub fn cli_mutating(&self, args: &[&str]) -> Result<Value, Fail>
pub fn cli_mutating(&self, args: &[&str]) -> Result<Value, Fail>
Server::cli for commands that change a job: once started they run
to their end, even when the request is cancelled (whose response is
then dropped), because killing the runner halfway could leave a job
half created or half stopped.
Source§impl Server
impl Server
Sourcepub fn validation_permit(&self, ctx: &Ctx) -> Result<Permit<'_>, Fail>
pub fn validation_permit(&self, ctx: &Ctx) -> Result<Permit<'_>, Fail>
Waits for a validation place; a cancelled request stops waiting.
Sourcepub fn send(&self, message: &Value)
pub fn send(&self, message: &Value)
Writes one message as one line; a closed stdout ends the server.
pub fn notify(&self, method: &str, params: Value)
Auto Trait Implementations§
impl !Freeze for Server
impl RefUnwindSafe for Server
impl Send for Server
impl Sync for Server
impl Unpin for Server
impl UnsafeUnpin for Server
impl UnwindSafe for Server
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