pub struct Client { /* private fields */ }Implementations§
Source§impl Client
impl Client
Sourcepub fn new(
user_id: u16,
channel_id: u16,
width: u16,
height: u16,
layout: KeyboardLayout,
name: &str,
) -> Client
pub fn new( user_id: u16, channel_id: u16, width: u16, height: u16, layout: KeyboardLayout, name: &str, ) -> Client
Ctor for a new global channel client user_id and channel_id must come from mcs channel once connected Width and height are screen size
§Example
ⓘ
use rdp::core::global;
use rdp::core::gcc::KeyboardLayout;
let mut global_channel = global::Client::new(
mcs.get_user_id(),
mcs.get_global_channel_id(),
800,
600,
KeyboardLayout::US,
"mstsc-rs"
);Sourcepub fn write_input_event<S: Read + Write>(
&self,
event: TSInputEvent,
mcs: &mut Client<S>,
) -> RdpResult<()>
pub fn write_input_event<S: Read + Write>( &self, event: TSInputEvent, mcs: &mut Client<S>, ) -> RdpResult<()>
Public interface to sent input event
§Example
ⓘ
let mut mcs = mcs::Client::new(...);
let mut global = global::Global::new(...);
global.write_input_event(
ts_pointer_event(
Some(flags),
Some(x),
Some(y)
),
&mut mcs
)
global.write_input_event(
ts_keyboard_event(
Some(flags),
Some(code)
),
&mut self.mcs
)Sourcepub fn read<S: Read + Write, T>(
&mut self,
payload: Payload,
mcs: &mut Client<S>,
callback: T,
) -> RdpResult<()>
pub fn read<S: Read + Write, T>( &mut self, payload: Payload, mcs: &mut Client<S>, callback: T, ) -> RdpResult<()>
Read payload on global channel This is the main read function for global channel
§Example
ⓘ
let mut mcs = mcs::Client::new(...);
let mut global = global::Global::new(...);
let (channel_name, message) = mcs.read().unwrap();
match channel_name.as_str() {
"global" => global.read(message, &mut mcs, |event| {
// do something with event
}),
...
}Auto Trait Implementations§
impl !RefUnwindSafe for Client
impl !Sync for Client
impl !UnwindSafe for Client
impl Freeze for Client
impl Send for Client
impl Unpin for Client
impl UnsafeUnpin for Client
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more