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>
impl<U: UserMessage> IpcRpcBuilder<U>
Sourcepub fn env<K: Into<OsString>, V: Into<OsString>>(
&mut self,
key: K,
value: V,
) -> &mut Self
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.
Sourcepub fn envs<K: Into<OsString>, V: Into<OsString>, I: Iterator<Item = (K, V)>>(
&mut self,
iter: I,
) -> &mut Self
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.
Sourcepub fn current_dir<P: Into<PathBuf>>(&mut self, path: P) -> &mut Self
pub fn current_dir<P: Into<PathBuf>>(&mut self, path: P) -> &mut Self
Sets the current directory for the new client process
Sourcepub async fn finish<SE, F, Fut, A>(
&mut self,
path_to_exe: SE,
message_handler: F,
arguments_fn: A,
) -> Result<IpcRpc<U>, IpcRpcError>
pub async fn finish<SE, F, Fut, A>( &mut self, path_to_exe: SE, message_handler: F, arguments_fn: A, ) -> Result<IpcRpc<U>, IpcRpcError>
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>
impl<U: Clone + UserMessage> Clone for IpcRpcBuilder<U>
Source§fn clone(&self) -> IpcRpcBuilder<U>
fn clone(&self) -> IpcRpcBuilder<U>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl<U: Debug + UserMessage> Debug for IpcRpcBuilder<U>
impl<U: Debug + UserMessage> Debug for IpcRpcBuilder<U>
Source§impl<U: UserMessage> Default for IpcRpcBuilder<U>
impl<U: UserMessage> Default for IpcRpcBuilder<U>
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> 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