pub struct PreLogin {
pub version: TdsVersion,
pub sub_build: u16,
pub encryption: EncryptionLevel,
pub instance: Option<String>,
pub thread_id: Option<u32>,
pub mars: bool,
pub trace_id: Option<TraceId>,
pub fed_auth_required: bool,
pub nonce: Option<[u8; 32]>,
}Expand description
Pre-login message builder and parser.
Fields§
§version: TdsVersionTDS version.
sub_build: u16Sub-build version.
encryption: EncryptionLevelEncryption level.
instance: Option<String>Instance name (for named instances).
thread_id: Option<u32>Thread ID.
mars: boolMARS enabled.
trace_id: Option<TraceId>Trace ID (Activity ID and Sequence).
fed_auth_required: boolFederated authentication required.
nonce: Option<[u8; 32]>Nonce for encryption.
Implementations§
Source§impl PreLogin
impl PreLogin
Sourcepub fn with_version(self, version: TdsVersion) -> Self
pub fn with_version(self, version: TdsVersion) -> Self
Set the TDS version.
Sourcepub fn with_encryption(self, level: EncryptionLevel) -> Self
pub fn with_encryption(self, level: EncryptionLevel) -> Self
Set the encryption level.
Sourcepub fn with_instance(self, instance: impl Into<String>) -> Self
pub fn with_instance(self, instance: impl Into<String>) -> Self
Set the instance name.
Sourcepub fn decode(src: impl Buf) -> Result<Self, ProtocolError>
pub fn decode(src: impl Buf) -> Result<Self, ProtocolError>
Decode a pre-login response from the server.
Per MS-TDS spec 2.2.6.4, PreLogin message structure:
- Option headers: each 5 bytes (type:1 + offset:2 + length:2)
- Terminator: 1 byte (0xFF)
- Option data: variable length, positioned at offsets specified in headers
Offsets in headers are absolute from the start of the PreLogin packet payload.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for PreLogin
impl RefUnwindSafe for PreLogin
impl Send for PreLogin
impl Sync for PreLogin
impl Unpin for PreLogin
impl UnwindSafe for PreLogin
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