mirror of
https://github.com/weyne85/rustdesk.git
synced 2025-10-29 17:00:05 +00:00
use official async trait (#6765)
Signed-off-by: 21pages <pages21@163.com>
This commit is contained in:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user