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 */
}Expand description
The MCP server over one node root.
Fields§
§root: PathBufThe node root.
runner: PathBufThe optimization-run executable that every tool calls.
launch: LaunchHow jobs are started.
input_dir: PathBufThe directory that relative input files of inline jobs are read from.
input_store_bytes: u64Limit of the input store’s total size.
shutdown: AtomicBoolSet at the end of input; waiting requests stop, jobs keep running.
Implementations§
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.
Auto Trait Implementations§
impl !Freeze for Server
impl Forget for Server
impl Move 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