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 Serverwhere
Mutex<Stdout>: RefUnwindSafe,
Mutex<HashMap<String, Arc<Atomic<bool>>>>: RefUnwindSafe,
Atomic<bool>: RefUnwindSafe,
Atomic<usize>: RefUnwindSafe,
Mutex<usize>: RefUnwindSafe,
Condvar: RefUnwindSafe,
impl Send for Server
impl Sync for Server
impl Unpin for Server
impl UnsafeUnpin for Serverwhere
*const u8 is !null: UnsafeUnpin,
PhantomData<u8>: UnsafeUnpin,
Align4<u32>: UnsafeUnpin,
Align1<u8>: UnsafeUnpin,
&'static ReentrantLock<RefCell<LineWriter<StdoutRaw>>>: UnsafeUnpin,
PhantomData<(String, Arc<Atomic<bool>>)>: UnsafeUnpin,
Align8<usize>: UnsafeUnpin,
impl UnwindSafe for Serverwhere
RawVecInner: UnwindSafe,
Mutex<Stdout>: UnwindSafe,
Mutex<HashMap<String, Arc<Atomic<bool>>>>: UnwindSafe,
Align1<u8>: UnwindSafe,
Align8<usize>: UnwindSafe,
Mutex<usize>: UnwindSafe,
Condvar: UnwindSafe,
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