io_uring: move fd utility helpers into crate
This commit is contained in:
parent
9606e0892c
commit
e996d9528a
5 changed files with 21 additions and 19 deletions
|
|
@ -63,9 +63,12 @@ macro_rules! map_err {
|
|||
}
|
||||
|
||||
mod debounce;
|
||||
pub mod line_logger;
|
||||
pub mod object_drop_queue;
|
||||
mod ops;
|
||||
mod pending_result;
|
||||
mod sys;
|
||||
pub mod timer;
|
||||
|
||||
#[derive(Debug, Error)]
|
||||
pub enum IoUringError {
|
||||
|
|
|
|||
|
|
@ -1,9 +1,6 @@
|
|||
use {
|
||||
crate::{
|
||||
io_uring::{IoUring, IoUringError},
|
||||
utils::{buf::Buf, vecdeque_ext::VecDequeExt},
|
||||
},
|
||||
isnt::std_1::collections::IsntVecDequeExt,
|
||||
crate::{IoUring, IoUringError},
|
||||
jay_utils::{buf::Buf, vecdeque_ext::VecDequeExt},
|
||||
std::{collections::VecDeque, rc::Rc},
|
||||
uapi::OwnedFd,
|
||||
};
|
||||
|
|
@ -28,7 +25,7 @@ pub async fn log_lines(
|
|||
buf.drain(..=pos);
|
||||
}
|
||||
}
|
||||
if buf.is_not_empty() {
|
||||
if !buf.is_empty() {
|
||||
let (left, right) = buf.as_slices();
|
||||
f(left, right);
|
||||
}
|
||||
|
|
@ -1,8 +1,6 @@
|
|||
use {
|
||||
crate::{
|
||||
io_uring::{IoUring, PendingPoll, PollCallback},
|
||||
utils::{errorfmt::ErrorFmt, oserror::OsError, stack::Stack},
|
||||
},
|
||||
crate::{IoUring, PendingPoll, PollCallback},
|
||||
jay_utils::{errorfmt::ErrorFmt, oserror::OsError, stack::Stack},
|
||||
std::{
|
||||
cell::{Cell, RefCell},
|
||||
rc::Rc,
|
||||
|
|
@ -1,10 +1,8 @@
|
|||
use {
|
||||
crate::{
|
||||
io_uring::{IoUring, IoUringError},
|
||||
utils::{
|
||||
buf::TypedBuf,
|
||||
oserror::{OsError, OsErrorExt2},
|
||||
},
|
||||
crate::{IoUring, IoUringError},
|
||||
jay_utils::{
|
||||
buf::TypedBuf,
|
||||
oserror::{OsError, OsErrorExt2},
|
||||
},
|
||||
std::{cell::RefCell, rc::Rc, time::Duration},
|
||||
thiserror::Error,
|
||||
12
src/utils.rs
12
src/utils.rs
|
|
@ -86,14 +86,20 @@ pub mod event_listener {
|
|||
}
|
||||
}
|
||||
pub mod linkedlist;
|
||||
pub mod line_logger;
|
||||
pub mod object_drop_queue;
|
||||
pub mod line_logger {
|
||||
pub use jay_io_uring::line_logger::*;
|
||||
}
|
||||
pub mod object_drop_queue {
|
||||
pub use jay_io_uring::object_drop_queue::*;
|
||||
}
|
||||
pub mod pending_serial;
|
||||
pub mod run_toplevel {
|
||||
pub use jay_async_engine::RunToplevel;
|
||||
}
|
||||
pub mod scroller;
|
||||
pub mod timer;
|
||||
pub mod timer {
|
||||
pub use jay_io_uring::timer::*;
|
||||
}
|
||||
|
||||
pub mod clonecell {
|
||||
pub use jay_utils::clonecell::*;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue