Skip to content

Commit dd780bc

Browse files
committed
update readme with latest version of crate
1 parent a194272 commit dd780bc

File tree

1 file changed

+11
-25
lines changed

1 file changed

+11
-25
lines changed

README.md

Lines changed: 11 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -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;
3636
use mach_listener::Client;
3737

3838
let 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;
4747
use std::os::unix::net::UnixStream;
4848

4949
let 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;
5858
use std::fs::OpenOptions;
5959

6060
let 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
213199
use std::os::linux::net::SocketAddrExt;
214200
use std::os::unix::net::{SocketAddr, UnixStream};
215-
use onepassword_ipc_client::platform::send_with_stream;
201+
use onepassword_ipc_client::send_with_stream;
216202

217203
fn main() {
218204
let addr = SocketAddr::from_abstract_name("your_endpoint_name").unwrap();

0 commit comments

Comments
 (0)