pub struct Sidecar {
pub hello: Value,
pub pid: u32,
pub events: Vec<Value>,
/* private fields */
}Expand description
A running --stdio sidecar speaking
{"type":"request","id":N,"method":{"method":"command","params":{"name","input"}}}
and answering {"type":"response","status":"ok|err","id":N,"result|error":...}.
Fields§
§hello: Value§pid: u32§events: Vec<Value>Frames that were neither hello nor the awaited response (events).
Implementations§
Source§impl Sidecar
impl Sidecar
pub fn stderr_tail(&self) -> String
Sourcepub fn raw(&mut self, frame: Value, timeout: Duration) -> Result<Value>
pub fn raw(&mut self, frame: Value, timeout: Duration) -> Result<Value>
Send an arbitrary frame and return the response with the same id.
Sourcepub fn command(
&mut self,
name: &str,
input: Value,
timeout: Duration,
) -> Result<Value>
pub fn command( &mut self, name: &str, input: Value, timeout: Duration, ) -> Result<Value>
A command; Ok(result) for status: ok, Err("code: message") for err.
pub fn shutdown(&mut self)
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for Sidecar
impl !Sync for Sidecar
impl !UnwindSafe for Sidecar
impl Freeze for Sidecar
impl Send for Sidecar
impl Unpin for Sidecar
impl UnsafeUnpin for Sidecar
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