Login7

Struct Login7 

Source
pub struct Login7 {
Show 25 fields pub tds_version: TdsVersion, pub packet_size: u32, pub client_prog_version: u32, pub client_pid: u32, pub connection_id: u32, pub option_flags1: OptionFlags1, pub option_flags2: OptionFlags2, pub type_flags: TypeFlags, pub option_flags3: OptionFlags3, pub client_timezone: i32, pub client_lcid: u32, pub hostname: String, pub username: String, pub password: String, pub app_name: String, pub server_name: String, pub unused: String, pub library_name: String, pub language: String, pub database: String, pub client_id: [u8; 6], pub sspi_data: Vec<u8>, pub attach_db_file: String, pub new_password: String, pub features: Vec<FeatureExtension>,
}
Expand description

LOGIN7 packet builder.

Fields§

§tds_version: TdsVersion

TDS version to request.

§packet_size: u32

Requested packet size.

§client_prog_version: u32

Client program version.

§client_pid: u32

Client process ID.

§connection_id: u32

Connection ID (for connection pooling).

§option_flags1: OptionFlags1

Option flags 1.

§option_flags2: OptionFlags2

Option flags 2.

§type_flags: TypeFlags

Type flags.

§option_flags3: OptionFlags3

Option flags 3.

§client_timezone: i32

Client timezone offset in minutes.

§client_lcid: u32

Client LCID (locale ID).

§hostname: String

Hostname (client machine name).

§username: String

Username for SQL authentication.

§password: String

Password for SQL authentication.

§app_name: String

Application name.

§server_name: String

Server name.

§unused: String

Unused field.

§library_name: String

Client library name.

§language: String

Language.

§database: String

Database name.

§client_id: [u8; 6]

Client ID (MAC address, typically zeros).

§sspi_data: Vec<u8>

SSPI data for integrated authentication.

§attach_db_file: String

Attach DB filename (for LocalDB).

§new_password: String

New password (for password change).

§features: Vec<FeatureExtension>

Feature extensions.

Implementations§

Source§

impl Login7

Source

pub fn new() -> Self

Create a new Login7 packet builder.

Source

pub fn with_tds_version(self, version: TdsVersion) -> Self

Set the TDS version.

Source

pub fn with_sql_auth( self, username: impl Into<String>, password: impl Into<String>, ) -> Self

Set SQL authentication credentials.

Source

pub fn with_integrated_auth(self, sspi_data: Vec<u8>) -> Self

Enable integrated (Windows) authentication.

Source

pub fn with_database(self, database: impl Into<String>) -> Self

Set the database to connect to.

Source

pub fn with_hostname(self, hostname: impl Into<String>) -> Self

Set the hostname (client machine name).

Source

pub fn with_app_name(self, app_name: impl Into<String>) -> Self

Set the application name.

Source

pub fn with_server_name(self, server_name: impl Into<String>) -> Self

Set the server name.

Source

pub fn with_packet_size(self, packet_size: u32) -> Self

Set the packet size.

Source

pub fn with_read_only_intent(self, read_only: bool) -> Self

Enable read-only intent for readable secondary connections.

Source

pub fn with_feature(self, feature: FeatureExtension) -> Self

Add a feature extension.

Source

pub fn encode(&self) -> Bytes

Encode the LOGIN7 packet to bytes.

Trait Implementations§

Source§

impl Clone for Login7

Source§

fn clone(&self) -> Login7

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Login7

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for Login7

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

§

impl Freeze for Login7

§

impl RefUnwindSafe for Login7

§

impl Send for Login7

§

impl Sync for Login7

§

impl Unpin for Login7

§

impl UnwindSafe for Login7

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.