pub struct IpcRpcServer<U: UserMessage> { /* private fields */ }
Expand description
Used to send messages to the connected client (assuming one does connect)
Implementations§
Source§impl<U: UserMessage> IpcRpcServer<U>
impl<U: UserMessage> IpcRpcServer<U>
Sourcepub async fn initialize_server<F, Fut>(
message_handler: F,
) -> Result<(ConnectionKey, IpcRpcServer<U>), IpcRpcError>
pub async fn initialize_server<F, Fut>( message_handler: F, ) -> Result<(ConnectionKey, IpcRpcServer<U>), IpcRpcError>
Initializes a server and provides a ConnectionKey
which clients can use to connect to it,
even out of process.
Sourcepub fn send(
&self,
user_message: U,
) -> impl Future<Output = Result<U, IpcRpcError>> + Send + 'static
pub fn send( &self, user_message: U, ) -> impl Future<Output = Result<U, IpcRpcError>> + Send + 'static
Sends a message, will give up on receiving a reply after the DEFAULT_REPLY_TIMEOUT
has passed.
Sourcepub fn send_timeout(
&self,
user_message: U,
timeout: Duration,
) -> impl Future<Output = Result<U, IpcRpcError>> + Send + 'static
pub fn send_timeout( &self, user_message: U, timeout: Duration, ) -> impl Future<Output = Result<U, IpcRpcError>> + Send + 'static
Sends a message, waiting the given timeout
for a reply.
pub fn client_connected(&self) -> bool
pub fn wait_for_client_to_connect( &mut self, ) -> impl Future<Output = Result<(), IpcRpcError>> + Send + 'static
pub fn wait_for_client_to_disconnect( &mut self, ) -> impl Future<Output = Result<(), IpcRpcError>> + Send + 'static
Sourcepub async fn schema_validated(
&mut self,
) -> Result<SchemaValidationStatus, IpcRpcError>
pub async fn schema_validated( &mut self, ) -> Result<SchemaValidationStatus, IpcRpcError>
Returns the outcome of automatic schema validation testing. This testing is performed on connection initiation.
Trait Implementations§
Source§impl<U: Clone + UserMessage> Clone for IpcRpcServer<U>
impl<U: Clone + UserMessage> Clone for IpcRpcServer<U>
Source§fn clone(&self) -> IpcRpcServer<U>
fn clone(&self) -> IpcRpcServer<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 IpcRpcServer<U>
impl<U: Debug + UserMessage> Debug for IpcRpcServer<U>
Source§impl<U: UserMessage> Drop for IpcRpcServer<U>
impl<U: UserMessage> Drop for IpcRpcServer<U>
Auto Trait Implementations§
impl<U> Freeze for IpcRpcServer<U>
impl<U> RefUnwindSafe for IpcRpcServer<U>
impl<U> Send for IpcRpcServer<U>
impl<U> Sync for IpcRpcServer<U>
impl<U> Unpin for IpcRpcServer<U>
impl<U> UnwindSafe for IpcRpcServer<U>
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