mirror of
https://github.com/OMGeeky/gdriver2.git
synced 2026-02-15 22:14:31 +01:00
update & remove some unused stuff
This commit is contained in:
@@ -13,10 +13,10 @@ serde.workspace = true
|
||||
libc.workspace = true
|
||||
anyhow = "1.0"
|
||||
futures-sink = "0.3.30"
|
||||
fuser = "0.14.0"
|
||||
fuser = "0.16.0"
|
||||
bimap = "0.6"
|
||||
futures = "0.3"
|
||||
thiserror = "1.0.56"
|
||||
thiserror = "2.0.18"
|
||||
tracing-subscriber = "0.3.18"
|
||||
|
||||
[dependencies.gdriver-common]
|
||||
|
||||
@@ -1,38 +1,3 @@
|
||||
mod reply {
|
||||
#[macro_export]
|
||||
macro_rules! reply_error_o {
|
||||
($option_in:expr, $reply:ident, $error_code:expr, $error_msg:expr) => {
|
||||
reply_error_o!($option_in, $reply, $error_code, $error_msg,)
|
||||
};
|
||||
($option_in:expr, $reply:ident, $error_code:expr, $error_msg:expr, $($arg:tt)*) => {{
|
||||
match $option_in {
|
||||
None=>{
|
||||
::tracing::error!($error_msg, $($arg)*);
|
||||
$reply.error($error_code);
|
||||
return;
|
||||
},
|
||||
Some(x) => x,
|
||||
}
|
||||
}};
|
||||
}
|
||||
#[macro_export]
|
||||
macro_rules! reply_error_e {
|
||||
($result_in:expr, $reply:ident, $error_code:expr, $error_msg:expr) => {
|
||||
reply_error_e!($result_in, $reply, $error_code, $error_msg,)
|
||||
};
|
||||
($result:expr, $reply:ident, $error_code:expr, $error_msg:expr, $($arg:tt)*) => {{
|
||||
match $result {
|
||||
Ok(x) => x,
|
||||
Err(e) => {
|
||||
error!("{}; e:{}",format!($error_msg, $($arg)*), e);
|
||||
$reply.error($error_code);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}};
|
||||
}
|
||||
}
|
||||
|
||||
mod send_requests {
|
||||
#[macro_export]
|
||||
macro_rules! send_request {
|
||||
@@ -42,36 +7,4 @@ mod send_requests {
|
||||
futures::executor::block_on($func)
|
||||
}};
|
||||
}
|
||||
#[macro_export]
|
||||
macro_rules! send_request_handled_internal {
|
||||
($func:expr ,$reply:ident, $error_code:expr, $error_msg:expr, $($arg:tt)*) => {{
|
||||
let x = send_request!($func);
|
||||
reply_error_e!(x, $reply, $error_code, $error_msg, $($arg)*)
|
||||
}};
|
||||
}
|
||||
#[macro_export]
|
||||
macro_rules! send_request_handled {
|
||||
($func:expr ,$reply:ident) => {
|
||||
send_request_handled!($func, $reply, "")
|
||||
};
|
||||
($func:expr ,$reply:ident, $error_msg:expr) => {
|
||||
send_request_handled_internal!(
|
||||
$func,
|
||||
$reply,
|
||||
::libc::EREMOTEIO,
|
||||
"Failed send request: {}",
|
||||
$error_msg
|
||||
)
|
||||
};
|
||||
}
|
||||
|
||||
#[macro_export]
|
||||
macro_rules! send_request_handled_consuming {
|
||||
($func:expr ,$reply:ident) => {
|
||||
send_request_handled_consuming!($func, $reply, "");
|
||||
};
|
||||
($func:expr ,$reply:ident, $error_msg:expr) => {
|
||||
let _ = send_request_handled!($func, $reply, $error_msg);
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,8 +1,5 @@
|
||||
pub(crate) use gdriver_common::prelude::result::*;
|
||||
pub(crate) use gdriver_common::prelude::*;
|
||||
pub(crate) mod macros {
|
||||
pub(crate) use crate::{
|
||||
reply_error_e, reply_error_o, send_request, send_request_handled_internal, send_request_handled,
|
||||
send_request_handled_consuming,
|
||||
};
|
||||
pub(crate) use crate::send_request;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user