bookclerk_plugin_sdk::callback_tunnel
Multiplexed byte tunnel for host-owned OAuth callback listeners.
Thin wrappers around [crate::mux]: the host TunnelHost::opens one
stream per accepted browser connection; the guest TunnelGuest::accepts
them. Flow control is the mux per-stream credit window.
| Item | Kind | Summary |
|---|---|---|
TunnelHost |
struct | Host end of the callback tunnel: opens logical connections toward the guest. |
TunnelGuest |
struct | Guest end of the callback tunnel: accepts logical connections from the host. |
TunnelStream |
type alias | One multiplexed logical connection implementing AsyncRead + AsyncWrite. |
pub struct TunnelHost {
/* private fields */
}
Host end of the callback tunnel: opens logical connections toward the guest.
pub fn new<R, W>(reader: R, writer: W) -> Self
where
R: AsyncRead + Send + Unpin + 'static,
W: AsyncWrite + Send + Unpin + 'static,
Spawns reader/writer tasks on the host half of a duplex IPC link.
reader- Async half that receives guest→host frames.writer- Async half that sends host→guest frames.
pub async fn open(&self) -> Result<TunnelStream>
Opens one logical connection toward the guest and returns its stream.
Returns crate::SdkError when the mux writer has exited.
pub struct TunnelGuest {
/* private fields */
}
Guest end of the callback tunnel: accepts logical connections from the host.
pub fn new<R, W>(reader: R, writer: W) -> Self
where
R: AsyncRead + Send + Unpin + 'static,
W: AsyncWrite + Send + Unpin + 'static,
Spawns reader/writer tasks on the guest half of a duplex IPC link.
reader- Async half that receives host→guest frames.writer- Async half that sends guest→host frames.
pub async fn accept(&mut self) -> Result<TunnelStream>
Waits for the next logical connection opened by TunnelHost::open.
Returns crate::SdkError when the mux reader exits.
pub type TunnelStream = MuxStream;
One multiplexed logical connection implementing AsyncRead + AsyncWrite.
Generated from crates/bookclerk-plugin-sdk at main · View as Markdown