Skip to main content

PluginProcess

Struct PluginProcess 

Source
pub struct PluginProcess {
    pub program: String,
    /* private fields */
}
Expand description

A running plugin server.

Fields§

§program: String

The program it runs.

Implementations§

Source§

impl PluginProcess

Source

pub fn start(program: &str) -> Result<Self, String>

Starts program serve.

Source

pub fn start_command(program: &str, args: &[&str]) -> Result<Self, String>

Starts program args… as a server speaking this protocol: a program whose serve means something else (dspk tool serve), or one started through another (podman run … dspk tool serve).

Source

pub fn alive(&mut self) -> bool

Whether the program is still running.

Source

pub fn request<R: Serialize>( &mut self, req: &R, progress: &mut dyn FnMut(&str, Option<f32>), ) -> Result<Value, String>

Sends a request (any type with a "request" tag) and reads events until its answer; progress sees the progress events. A line that is not an event is skipped.

Trait Implementations§

Source§

impl Drop for PluginProcess

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more
Source§

fn pin_drop(self: Pin<&mut Self>)

🔬This is a nightly-only experimental API. (pin_ergonomics)
Execute the destructor for this type, but different to Drop::drop, it requires self to be pinned. Read more

Auto Trait Implementations§

§

impl Forget for PluginProcess

§

impl Freeze for PluginProcess
where *const u8 is !null: Freeze, PhantomData<u8>: Freeze, I32NotAllOnes: Freeze, *const [MaybeUninit<u8>] is !null: Freeze, PhantomData<[MaybeUninit<u8>]>: Freeze,

§

impl Move for PluginProcess

§

impl RefUnwindSafe for PluginProcess
where I32NotAllOnes: RefUnwindSafe,

§

impl Send for PluginProcess
where RawVecInner: Send, I32NotAllOnes: Send, BoxRaw<[MaybeUninit<u8>]>: Send,

§

impl Sync for PluginProcess
where RawVecInner: Sync, I32NotAllOnes: Sync, BoxRaw<[MaybeUninit<u8>]>: Sync,

§

impl Unpin for PluginProcess
where *const u8 is !null: Unpin, I32NotAllOnes: Unpin, Box<[MaybeUninit<u8>]>: Unpin,

§

impl UnsafeUnpin for PluginProcess

§

impl UnwindSafe for PluginProcess
where RawVecInner: UnwindSafe, I32NotAllOnes: UnwindSafe, BoxRaw<[MaybeUninit<u8>]>: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.