pub mod convert;
mod framing;
#[cfg(feature = "tls")]
pub mod tls;
pub use framing::{
DEFAULT_MAX_FRAME_LEN, FrameError, FramePoll, FrameReader, read_frame, write_frame,
};
#[cfg(feature = "tokio")]
pub use framing::{read_frame_async, write_frame_async};
#[cfg(feature = "tls")]
pub use tls::{TlsConn, TlsReadHalf, TlsWriteHalf};
pub const PROTOCOL_VERSION: u32 = 1;
#[allow(clippy::all, clippy::pedantic, clippy::nursery)]
pub mod tephra {
include!(concat!(env!("OUT_DIR"), "/generated/generated.rs"));
}
pub fn hello_request(request_id: u64, auth_token: Option<&str>) -> tephra::Request {
let mut hello = tephra::Hello::new();
hello.set_protocol_version(PROTOCOL_VERSION);
if let Some(token) = auth_token {
hello.set_auth_token(token);
}
let mut request = tephra::Request::new();
request.set_request_id(request_id);
request.set_hello(hello);
request
}