use official async trait (#6765)
Signed-off-by: 21pages <pages21@163.com>
This commit is contained in:
parent
6953efc2d8
commit
e873188775
1
Cargo.lock
generated
1
Cargo.lock
generated
@ -5236,7 +5236,6 @@ dependencies = [
|
||||
"android_logger",
|
||||
"arboard",
|
||||
"async-process",
|
||||
"async-trait",
|
||||
"base64",
|
||||
"bytes",
|
||||
"cc",
|
||||
|
@ -60,7 +60,6 @@ magnum-opus = { git = "https://github.com/rustdesk/magnum-opus" }
|
||||
dasp = { version = "0.11", features = ["signal", "interpolate-linear", "interpolate"], optional = true }
|
||||
rubato = { version = "0.12", optional = true }
|
||||
samplerate = { version = "0.2", optional = true }
|
||||
async-trait = "0.1"
|
||||
uuid = { version = "1.3", features = ["v4"] }
|
||||
clap = "4.2"
|
||||
rpassword = "7.2"
|
||||
|
@ -41,7 +41,6 @@ impl Session {
|
||||
}
|
||||
}
|
||||
|
||||
#[async_trait]
|
||||
impl Interface for Session {
|
||||
fn get_login_config_handler(&self) -> Arc<RwLock<LoginConfigHandler>> {
|
||||
return self.lc.clone();
|
||||
|
@ -6,7 +6,6 @@ use std::{
|
||||
sync::{mpsc, Arc, Mutex, RwLock},
|
||||
};
|
||||
|
||||
pub use async_trait::async_trait;
|
||||
use bytes::Bytes;
|
||||
#[cfg(not(any(target_os = "android", target_os = "linux")))]
|
||||
use cpal::{
|
||||
@ -2649,7 +2648,6 @@ async fn send_switch_login_request(
|
||||
}
|
||||
|
||||
/// Interface for client to send data and commands.
|
||||
#[async_trait]
|
||||
pub trait Interface: Send + Clone + 'static + Sized {
|
||||
/// Send message data to remote peer.
|
||||
fn send(&self, data: Data);
|
||||
|
@ -741,10 +741,11 @@ fn try_broadcast_display_changed(
|
||||
) {
|
||||
log::info!("Display {} changed", display);
|
||||
if let Some(msg_out) = make_display_changed_msg(display_idx, Some(display)) {
|
||||
sp.send(msg_out.clone());
|
||||
let msg_out = Arc::new(msg_out);
|
||||
sp.send_shared(msg_out.clone());
|
||||
// switch display may occur before the first video frame, add snapshot to send to new subscribers
|
||||
sp.snapshot(move |sps| {
|
||||
sps.send(msg_out.clone());
|
||||
sps.send_shared(msg_out.clone());
|
||||
Ok(())
|
||||
})?;
|
||||
bail!("SWITCH");
|
||||
|
@ -2,7 +2,6 @@ use crate::{
|
||||
common::{get_supported_keyboard_modes, is_keyboard_mode_supported},
|
||||
input::{MOUSE_BUTTON_LEFT, MOUSE_TYPE_DOWN, MOUSE_TYPE_UP, MOUSE_TYPE_WHEEL},
|
||||
};
|
||||
use async_trait::async_trait;
|
||||
use bytes::Bytes;
|
||||
use rdev::{Event, EventType::*, KeyCode};
|
||||
use std::{
|
||||
@ -1305,7 +1304,6 @@ impl<T: InvokeUiSession> DerefMut for Session<T> {
|
||||
|
||||
impl<T: InvokeUiSession> FileManager for Session<T> {}
|
||||
|
||||
#[async_trait]
|
||||
impl<T: InvokeUiSession> Interface for Session<T> {
|
||||
fn get_lch(&self) -> Arc<RwLock<LoginConfigHandler>> {
|
||||
return self.lc.clone();
|
||||
|
Loading…
x
Reference in New Issue
Block a user