Struct Client

Source
pub struct Client { /* private fields */ }

Implementations§

Source§

impl Client

Source

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"
);
Source

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
)
Source

pub fn read<S: Read + Write, T>( &mut self, payload: Payload, mcs: &mut Client<S>, callback: T, ) -> RdpResult<()>
where T: FnMut(RdpEvent),

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 Freeze for Client

§

impl !RefUnwindSafe for Client

§

impl Send for Client

§

impl !Sync for Client

§

impl Unpin for Client

§

impl !UnwindSafe for Client

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V