1
0
Fork 0
forked from wry/wry

autocommit 2022-01-02 15:13:33 CET

This commit is contained in:
Julian Orth 2022-01-02 15:13:33 +01:00
commit d6172b273f
50 changed files with 5807 additions and 0 deletions

31
src/utils/buffd/mod.rs Normal file
View file

@ -0,0 +1,31 @@
use crate::async_engine::AsyncError;
pub use buf_in::BufFdIn;
pub use buf_out::BufFdOut;
use thiserror::Error;
pub use wl_formatter::WlFormatter;
pub use wl_parser::{WlParser, WlParserError};
mod buf_in;
mod buf_out;
mod wl_formatter;
mod wl_parser;
#[derive(Debug, Error)]
pub enum BufFdError {
#[error("An IO error occurred")]
Io(#[source] std::io::Error),
#[error("An async error occurred")]
Async(#[from] AsyncError),
#[error("The peer did not send a file descriptor")]
NoFd,
#[error("The peer sent too many file descriptors")]
TooManyFds,
#[error("The peer closed the connection")]
Closed,
#[error("The connection timed out")]
Timeout,
}
const BUF_SIZE: usize = 4096;
const CMSG_BUF_SIZE: usize = 4096;
const MAX_IN_FD: usize = 4;