pub struct IPCTransport {
SocketPath: Option<PathBuf>,
PipeName: Option<String>,
Configuration: TransportConfig,
Connected: Arc<RwLock<bool>>,
Statistics: Arc<RwLock<TransportStats>>,
}Expand description
IPC transport for local process communication.
Fields§
§SocketPath: Option<PathBuf>Unix domain socket path (macOS/Linux).
PipeName: Option<String>Named pipe identifier (Windows).
Configuration: TransportConfigTransport configuration.
Connected: Arc<RwLock<bool>>Whether the transport is currently connected.
Statistics: Arc<RwLock<TransportStats>>Transport statistics.
Implementations§
Source§impl IPCTransport
impl IPCTransport
Sourcepub fn WithSocketPath<P: AsRef<Path>>(SocketPath: P) -> Result<Self>
pub fn WithSocketPath<P: AsRef<Path>>(SocketPath: P) -> Result<Self>
Creates a new IPC transport with a custom Unix domain socket path.
Sourcefn DefaultSocketPath() -> PathBuf
fn DefaultSocketPath() -> PathBuf
Returns the default socket path for the current platform.
Sourcepub fn GetSocketPath(&self) -> Option<&Path>
pub fn GetSocketPath(&self) -> Option<&Path>
Returns the socket path (Unix only).
Sourcepub async fn GetStatistics(&self) -> TransportStats
pub async fn GetStatistics(&self) -> TransportStats
Returns a snapshot of transport statistics.
Sourceasync fn CleanupSocket(&self) -> Result<()>
async fn CleanupSocket(&self) -> Result<()>
Removes the socket file if it exists.
Trait Implementations§
Source§impl Clone for IPCTransport
impl Clone for IPCTransport
Source§fn clone(&self) -> IPCTransport
fn clone(&self) -> IPCTransport
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 Debug for IPCTransport
impl Debug for IPCTransport
Source§impl TransportStrategy for IPCTransport
impl TransportStrategy for IPCTransport
Source§type Error = IPCTransportError
type Error = IPCTransportError
Error type for this transport
Source§fn connect<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn connect<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Connect to the transport endpoint
Source§fn send<'life0, 'life1, 'async_trait>(
&'life0 self,
request: &'life1 [u8],
) -> Pin<Box<dyn Future<Output = Result<Vec<u8>, Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn send<'life0, 'life1, 'async_trait>(
&'life0 self,
request: &'life1 [u8],
) -> Pin<Box<dyn Future<Output = Result<Vec<u8>, Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Send a request and receive a response
Source§fn send_no_response<'life0, 'life1, 'async_trait>(
&'life0 self,
data: &'life1 [u8],
) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn send_no_response<'life0, 'life1, 'async_trait>(
&'life0 self,
data: &'life1 [u8],
) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Send data without expecting a response (fire and forget)
Source§fn close<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn close<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Close the transport connection
Source§fn is_connected(&self) -> bool
fn is_connected(&self) -> bool
Check if the transport is connected
Source§fn transport_type(&self) -> TransportType
fn transport_type(&self) -> TransportType
Get the transport type identifier
Auto Trait Implementations§
impl Freeze for IPCTransport
impl !RefUnwindSafe for IPCTransport
impl Send for IPCTransport
impl Sync for IPCTransport
impl Unpin for IPCTransport
impl UnsafeUnpin for IPCTransport
impl !UnwindSafe for IPCTransport
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request