Skip to main content

SsAccessToken

Struct SsAccessToken 

Source
#[repr(C)]
pub struct SsAccessToken { pub data_size: u32, pub data: [u8], }
Expand description

Equivalent to ACCESSTOKEN in msodbcsql.h. Value of ConnectionAttribute::SS_ACCESS_TOKEN.

Specific to the Microsoft ODBC Driver for SQL Server. A dynamically sized type: pointers to it are fat and carry the length of data, which must equal data_size. Cast to a thin pointer before passing it to the driver.

See: https://learn.microsoft.com/sql/connect/odbc/using-azure-active-directory#authenticating-with-an-access-token

Fields§

§data_size: u32

Length of data in bytes. Does not include a terminating zero.

§data: [u8]

Flexible array member (BYTE data[] in C). Directly follows data_size.

According to Microsoft, a token obtained from an OAuth 2.0 JSON response must be expanded, so each byte is followed by a zero byte. For the ASCII characters of an access token, this equals UTF-16 with little endian byte order. This holds whether the narrow or wide ODBC functions are used, since the driver manager passes the pointer through unchanged.

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