kble_socket/
lib.rs

1use std::pin::Pin;
2
3use anyhow::Result;
4use bytes::Bytes;
5use futures_util::{Sink, Stream};
6
7pub type SocketSink = Pin<Box<dyn Sink<Bytes, Error = anyhow::Error> + Send + 'static>>;
8pub type SocketStream = Pin<Box<dyn Stream<Item = Result<Bytes>> + Send + 'static>>;
9
10#[cfg(feature = "stdio")]
11mod stdio;
12#[cfg(feature = "stdio")]
13pub use stdio::{from_stdio, Stdio};
14
15#[cfg(feature = "tungstenite")]
16mod tungstenite;
17#[cfg(feature = "tungstenite")]
18pub use tungstenite::from_tungstenite;
19
20#[cfg(feature = "axum")]
21mod axum;
22#[cfg(feature = "axum")]
23pub use crate::axum::from_axum;