Skip to main content

Session

Struct Session 

Source
pub struct Session<'w> {
    pub database: &'w mut dyn Database,
    pub pending: bool,
    /* private fields */
}
Expand description

A run unit’s connection to its database, and the state the runtime keeps rather than asking the backend, so every backend answers alike.

Fields§

§database: &'w mut dyn Database§pending: bool

Whether any statement has reached the database since the last COMMIT or ROLLBACK.

Implementations§

Source§

impl<'w> Session<'w>

Source

pub fn new(database: &'w mut (dyn Database + '_)) -> Self

Source

pub fn cursor(&mut self, program: &str, name: &str) -> Option<&mut OpenCursor>

Source

pub fn opened(&mut self, program: &str, name: &str, with_hold: bool)

Source

pub fn closed(&mut self, program: &str, name: &str)

Source

pub fn committed(&mut self)

COMMIT closes every cursor not declared WITH HOLD, and leaves a held one before its next row.

Source

pub fn rolled_back(&mut self)

Source

pub fn settle(&mut self, program: &str, commit: bool) -> Answer

Ends a unit of work that no EXEC SQL statement ends: at SYNCPOINT, or at the end of a run unit or task. The database is asked only while it holds work or an open cursor, and the call names program with ordinal 0.

Source

pub fn end_task(&mut self, program: &str, commit: bool) -> Answer

Ends a CICS task: settles its unit of work, then closes the held cursors a commit leaves open, as the end of a task closes every cursor.

Auto Trait Implementations§

§

impl<'w> !RefUnwindSafe for Session<'w>

§

impl<'w> !Send for Session<'w>

§

impl<'w> !Sync for Session<'w>

§

impl<'w> !UnwindSafe for Session<'w>

§

impl<'w> Freeze for Session<'w>

§

impl<'w> Unpin for Session<'w>

§

impl<'w> UnsafeUnpin for Session<'w>

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 = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

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.