Skip to main content

SessionContext

Struct SessionContext 

Source
pub struct SessionContext { /* private fields */ }
Expand description

Session-level state used to manage transactions and defaults for a client connection.

Implementations§

Source§

impl SessionContext

Source

pub fn new(default_isolation: IsolationLevel) -> Self

Source

pub fn default_isolation(&self) -> IsolationLevel

Source

pub fn set_default_isolation(&mut self, isolation: IsolationLevel)

Source

pub fn default_access_mode(&self) -> TransactionAccessMode

Source

pub fn set_default_access_mode(&mut self, mode: TransactionAccessMode)

Source

pub fn set_active_isolation(&mut self, isolation: IsolationLevel)

Apply a new isolation level to the currently active transaction, if one exists.

Source

pub fn autocommit(&self) -> bool

Source

pub fn set_autocommit(&mut self, enabled: bool)

Source

pub fn pending_session_isolation(&self) -> Option<IsolationLevel>

Retrieve the pending session isolation override that will apply to the next transaction.

Source

pub fn set_pending_session_isolation( &mut self, isolation: Option<IsolationLevel>, )

Record a pending session isolation override that should apply to the next transaction.

Source

pub fn pending_session_access(&self) -> Option<TransactionAccessMode>

Source

pub fn set_pending_session_access( &mut self, mode: Option<TransactionAccessMode>, )

Source

pub fn has_active_transaction(&self) -> bool

Source

pub fn active_txn(&self) -> Option<&Transaction>

Source

pub fn active_txn_mut(&mut self) -> Option<&mut Transaction>

Source

pub fn ensure_active_transaction( &mut self, txn_mgr: &Arc<TransactionManager>, ) -> QuillSQLResult<&mut Transaction>

Source

pub fn set_active_transaction(&mut self, txn: Transaction) -> QuillSQLResult<()>

Source

pub fn take_active_transaction(&mut self) -> Option<Transaction>

Source

pub fn clear_active_transaction(&mut self)

Source

pub fn apply_transaction_modes(&mut self, modes: &TransactionModes)

Apply isolation override when a transaction-scoped SET TRANSACTION is issued.

Source

pub fn apply_session_modes(&mut self, modes: &TransactionModes)

Merge SET SESSION TRANSACTION modes into session defaults.

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, 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.