pub struct Connector { /* private fields */ }
Implementations§
Source§impl Connector
impl Connector
Sourcepub fn new() -> Self
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());
Sourcepub fn connect<S: Read + Write>(&mut self, stream: S) -> RdpResult<RdpClient<S>>
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();
Sourcepub fn screen(self, width: u16, height: u16) -> Self
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
Sourcepub fn credentials(
self,
domain: String,
username: String,
password: String,
) -> Self
pub fn credentials( self, domain: String, username: String, password: String, ) -> Self
Configure credentials for the session Credentials use to logon on server
Sourcepub fn set_restricted_admin_mode(self, state: bool) -> Self
pub fn set_restricted_admin_mode(self, state: bool) -> Self
Enable or disable restricted admin mode
Sourcepub fn set_password_hash(self, password_hash: Vec<u8>) -> Self
pub fn set_password_hash(self, password_hash: Vec<u8>) -> Self
Try authenticate using NTLM hashes and restricted admin mode
Sourcepub fn layout(self, layout: KeyboardLayout) -> Self
pub fn layout(self, layout: KeyboardLayout) -> Self
Set the keyboard layout
Sourcepub fn auto_logon(self, auto_logon: bool) -> Self
pub fn auto_logon(self, auto_logon: bool) -> Self
Switch on the AutoLogon flag
Sourcepub fn blank_creds(self, blank_creds: bool) -> Self
pub fn blank_creds(self, blank_creds: bool) -> Self
Send blank creds at the end of CRedSSP
Sourcepub fn check_certificate(self, check_certificate: bool) -> Self
pub fn check_certificate(self, check_certificate: bool) -> Self
Enable or not the check of SSL certificate
Auto Trait Implementations§
impl Freeze for Connector
impl RefUnwindSafe for Connector
impl Send for Connector
impl Sync for Connector
impl Unpin for Connector
impl UnwindSafe for Connector
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