@@ -32,7 +32,7 @@ Each platform exposes a lower-level function that accepts an existing connection
3232** macOS:**
3333
3434``` rust
35- use onepassword_ipc_client :: platform :: send_with_client;
35+ use onepassword_ipc_client :: send_with_client;
3636use mach_listener :: Client ;
3737
3838let mut client = Client :: connect (" your_endpoint_name" ). unwrap ();
@@ -43,7 +43,7 @@ let response2 = send_with_client(&mut client, request2).unwrap();
4343** Linux:**
4444
4545``` rust
46- use onepassword_ipc_client :: platform :: send_with_stream;
46+ use onepassword_ipc_client :: send_with_stream;
4747use std :: os :: unix :: net :: UnixStream ;
4848
4949let mut stream = /* connect to abstract socket */ ;
@@ -54,7 +54,7 @@ let response2 = send_with_stream(&mut stream, request2).unwrap();
5454** Windows:**
5555
5656``` rust
57- use onepassword_ipc_client :: platform :: send_with_pipe;
57+ use onepassword_ipc_client :: send_with_pipe;
5858use std :: fs :: OpenOptions ;
5959
6060let mut pipe = OpenOptions :: new ()
@@ -111,32 +111,18 @@ Sends a message over an existing named pipe. Allows reusing the same connection
111111
112112## Error Handling
113113
114- Each platform defines its own `ErrorCode ` enum . The enum is re - exported from the crate root as `onepassword_ipc_client :: ErrorCode `.
115-
116- ### macOS ErrorCode
117-
118- | Value | Description |
119- | : ---- | : ---------- |
120- | `InvalidArguments ` | Invalid arguments were provided (e . g. bad endpoint name ). |
121- | `UnexpectedOsError ` | An unexpected operating system error occurred . |
122- | `RegistrationError ` | Failed to register with the Mach port . |
123- | `CorruptMessage ` | A received message was malformed or corrupt . |
124- | `MessageTooLarge ` | The message exceeds the maximum allowed size . |
125- | `FailedToSend ` | Failed to send the message to the Mach port . |
126- | `NoReply ` | No reply was received from the server . |
127- | `Internal ` | An internal error occurred (e . g. unexpected empty response or invalid chunk ). |
128-
129- ### Linux / Windows ErrorCode
114+ All platforms share a single `ErrorCode ` enum , re - exported from the crate root as `onepassword_ipc_client :: ErrorCode `.
130115
131116| Value | Description |
132117| : ---- | : ---------- |
133118| `InvalidArguments ` | Invalid arguments were provided (e . g. bad endpoint name ). |
134- | `FailedToConnect ` | Failed to connect to the Unix socket or named pipe . |
135- | `FailedToSendMessage ` | Failed to write the message to the connection . |
136- | `FailedToReceiveResponse ` | Failed to read a response from the connection . |
137- | `FailedToEncodeMessage ` | Failed to encode the message into the wire format . |
138- | `FailedToDecodeMessage ` | Failed to decode the response from the wire format . |
119+ | `FailedToConnect ` | Failed to connect to the IPC endpoint . |
120+ | `FailedToSend ` | Failed to send the message . |
121+ | `FailedToReceive ` | Failed to receive a response from the server . |
122+ | `FailedToEncode ` | Failed to encode the message into the wire format . |
123+ | `FailedToDecode ` | Failed to decode the response from the wire format . |
139124| `ServerClosedConnection ` | The server closed the connection unexpectedly . |
125+ | `Internal ` | An internal error occurred . |
140126
141127## Wire Protocol
142128
@@ -212,7 +198,7 @@ fn main() {
212198``` rust
213199use std :: os :: linux :: net :: SocketAddrExt ;
214200use std :: os :: unix :: net :: {SocketAddr , UnixStream };
215- use onepassword_ipc_client :: platform :: send_with_stream;
201+ use onepassword_ipc_client :: send_with_stream;
216202
217203fn main () {
218204 let addr = SocketAddr :: from_abstract_name (" your_endpoint_name" ). unwrap ();
0 commit comments