Struct IpcRpcBuilder

Source
pub struct IpcRpcBuilder<U: UserMessage> { /* private fields */ }
Expand description

Builds an IpcRpc. This is initialized via IpcRpc::build()

Implementations§

Source§

impl<U: UserMessage> IpcRpcBuilder<U>

Source

pub fn env<K: Into<OsString>, V: Into<OsString>>( &mut self, key: K, value: V, ) -> &mut Self

Additional environment variable to pass in to the new client.

Source

pub fn envs<K: Into<OsString>, V: Into<OsString>, I: Iterator<Item = (K, V)>>( &mut self, iter: I, ) -> &mut Self

Additional environment variables to pass in to the new client.

Source

pub fn current_dir<P: Into<PathBuf>>(&mut self, path: P) -> &mut Self

Sets the current directory for the new client process

Source

pub async fn finish<SE, F, Fut, A>( &mut self, path_to_exe: SE, message_handler: F, arguments_fn: A, ) -> Result<IpcRpc<U>, IpcRpcError>
where SE: AsRef<OsStr>, F: Fn(U) -> Fut + Send + Sync + 'static, Fut: Future<Output = Option<U>> + Send, A: FnOnce(ConnectionKey, &mut Command),

Initializes a server and client, connects the two, then returns a combination structure which can be used for the server side of the relationship.

  • path_to_exe: The path to the exe which is expected to connect to the server on startup
  • message_handler: A function for handling spontaneous messages from the new client
  • arguments_fn: This method MUST provide the server connect key to the client. The easiest way to do this is to pass in the key as a command line argument. The client must be prepared to read the key from wherever this function puts it.

Trait Implementations§

Source§

impl<U: Clone + UserMessage> Clone for IpcRpcBuilder<U>

Source§

fn clone(&self) -> IpcRpcBuilder<U>

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<U: Debug + UserMessage> Debug for IpcRpcBuilder<U>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<U: UserMessage> Default for IpcRpcBuilder<U>

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

§

impl<U> Freeze for IpcRpcBuilder<U>

§

impl<U> RefUnwindSafe for IpcRpcBuilder<U>
where U: RefUnwindSafe,

§

impl<U> Send for IpcRpcBuilder<U>

§

impl<U> Sync for IpcRpcBuilder<U>
where U: Sync,

§

impl<U> Unpin for IpcRpcBuilder<U>
where U: Unpin,

§

impl<U> UnwindSafe for IpcRpcBuilder<U>
where U: 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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DynClone for T
where T: Clone,

Source§

fn __clone_box(&self, _: Private) -> *mut ()

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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

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

Source§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V