Struct Client

Source
pub struct Client<S> { /* private fields */ }
Expand description

MCS client channel

Implementations§

Source§

impl<S: Read + Write> Client<S>

Source

pub fn new(x224: Client<S>) -> Self

Source

pub fn connect( &mut self, client_name: String, screen_width: u16, screen_height: u16, keyboard_layout: KeyboardLayout, ) -> RdpResult<()>

Connect the MCS channel Ask connection for each channel requested and confirmed by server

§Example
let mut mcs = mcs::Client(x224);
mcs.connect(800, 600, KeyboardLayout::French).unwrap()
Source

pub fn write<T>(&mut self, channel_name: &String, message: T) -> RdpResult<()>
where T: Message + 'static,

Send a message to a connected channel MCS stand for multi channel Write function write a message to specific channel

§Example
let mut mcs = mcs::Client(x224);
mcs.connect(800, 600, KeyboardLayout::French).unwrap();
mcs.write("global".to_string(), trame![U16::LE(0)])
Source

pub fn read(&mut self) -> RdpResult<(String, Payload)>

Receive a message for a specific channel Actually by design you can’t ask for a specific channel the caller need to handle all channels

§Example
let mut mcs = mcs::Client(x224);
mcs.connect(800, 600, KeyboardLayout::French).unwrap();
let (channel_name, payload) = mcs.read().unwrap();
match channel_name.as_str() {
    "global" => println!("main channel");
    ...
}
Source

pub fn shutdown(&mut self) -> RdpResult<()>

Send a close event to server

Source

pub fn is_rdp_version_5_plus(&self) -> bool

This function check if the client version protocol choose is 5+

Source

pub fn get_user_id(&self) -> u16

Getter of the user id negotiated during connection steps

Source

pub fn get_global_channel_id(&self) -> u16

Getter of the global channel id

Auto Trait Implementations§

§

impl<S> Freeze for Client<S>
where S: Freeze,

§

impl<S> RefUnwindSafe for Client<S>
where S: RefUnwindSafe,

§

impl<S> Send for Client<S>
where S: Send,

§

impl<S> Sync for Client<S>
where S: Sync,

§

impl<S> Unpin for Client<S>
where S: Unpin,

§

impl<S> UnwindSafe for Client<S>
where S: UnwindSafe,

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