pub enum IpcConnection {
Secured {
conn: Box<TransportConnection>,
crypto: SessionCrypto,
},
Plain {
conn: Box<TransportConnection>,
},
}Expand description
One negotiated IPC connection.
Variants§
Secured
v1 session: every envelope frame is sealed (WBS-509/510).
Plain
Legacy plaintext envelopes — migration window only, server-side accepted and announced (ADR-007; removed in 1.0).
Fields
§
conn: Box<TransportConnection>Implementations§
Source§impl IpcConnection
impl IpcConnection
Sourcepub async fn connect_client(
conn: TransportConnection,
token: &str,
) -> TransportResult<Self>
pub async fn connect_client( conn: TransportConnection, token: &str, ) -> TransportResult<Self>
Client-side negotiation (WBS-509): send SessionHello, read SessionAccept, derive the directional session keys.
Sourcepub async fn accept_server(
conn: TransportConnection,
token: &str,
) -> TransportResult<(Self, Option<Vec<u8>>)>
pub async fn accept_server( conn: TransportConnection, token: &str, ) -> TransportResult<(Self, Option<Vec<u8>>)>
Server-side negotiation: peek the first frame. A SessionHello → SECURED (reply SessionAccept, derive keys). Anything else → the legacy PLAIN envelope protocol; the first frame is handed back to the caller for normal processing.
Sourcepub async fn send_frame(&mut self, envelope_bytes: &[u8]) -> TransportResult<()>
pub async fn send_frame(&mut self, envelope_bytes: &[u8]) -> TransportResult<()>
Send one envelope frame (sealed in secured mode), write-bounded by the session deadline (WBS-511).
Sourcepub async fn recv_frame(&mut self) -> TransportResult<Vec<u8>>
pub async fn recv_frame(&mut self) -> TransportResult<Vec<u8>>
Receive one envelope frame (opened in secured mode), bounded by the read deadline (WBS-511).
Auto Trait Implementations§
impl Freeze for IpcConnection
impl RefUnwindSafe for IpcConnection
impl Send for IpcConnection
impl Sync for IpcConnection
impl Unpin for IpcConnection
impl UnsafeUnpin for IpcConnection
impl UnwindSafe for IpcConnection
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