[][src]Struct rdp::core::global::Client

pub struct Client { /* fields omitted */ }

Methods

impl Client[src]

pub fn new(
    user_id: u16,
    channel_id: u16,
    width: u16,
    height: u16,
    layout: KeyboardLayout,
    name: &str
) -> Client
[src]

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

This example is not tested
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"
);

pub fn write_input_event<S: Read + Write>(
    &self,
    event: TSInputEvent,
    mcs: &mut Client<S>
) -> RdpResult<()>
[src]

Public interface to sent input event

Example

This example is not tested
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
)

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

Read payload on global channel This is the main read function for global channel

Example

This example is not tested
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 Send for Client

impl !Sync for Client

impl Unpin for Client

impl !UnwindSafe for Client

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

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