Struct Connector

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

Implementations§

Source§

impl Connector

Source

pub fn new() -> Self

Create a new RDP client You can configure your client

§Example
use rdp::core::client::Connector;
let mut connector = Connector::new()
    .screen(800, 600)
    .credentials("domain".to_string(), "username".to_string(), "password".to_string());
Source

pub fn connect<S: Read + Write>(&mut self, stream: S) -> RdpResult<RdpClient<S>>

Connect to a target server This function will produce a RdpClient object use to interact with server

§Example
use std::net::{SocketAddr, TcpStream};
use rdp::core::client::Connector;
let addr = "127.0.0.1:3389".parse::<SocketAddr>().unwrap();
let tcp = TcpStream::connect(&addr).unwrap();
let mut connector = Connector::new()
    .screen(800, 600)
    .credentials("domain".to_string(), "username".to_string(), "password".to_string());
let mut client = connector.connect(tcp).unwrap();
Source

pub fn screen(self, width: u16, height: u16) -> Self

Configure the screen size of the session You need to set a power of two definition

Source

pub fn credentials( self, domain: String, username: String, password: String, ) -> Self

Configure credentials for the session Credentials use to logon on server

Source

pub fn set_restricted_admin_mode(self, state: bool) -> Self

Enable or disable restricted admin mode

Source

pub fn set_password_hash(self, password_hash: Vec<u8>) -> Self

Try authenticate using NTLM hashes and restricted admin mode

Source

pub fn layout(self, layout: KeyboardLayout) -> Self

Set the keyboard layout

Source

pub fn auto_logon(self, auto_logon: bool) -> Self

Switch on the AutoLogon flag

Source

pub fn blank_creds(self, blank_creds: bool) -> Self

Send blank creds at the end of CRedSSP

Source

pub fn check_certificate(self, check_certificate: bool) -> Self

Enable or not the check of SSL certificate

Source

pub fn name(self, name: String) -> Self

Set the default name send to server

Source

pub fn use_nla(self, use_nla: bool) -> Self

Enable or disable Network Level Authentication

Auto Trait Implementations§

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