pub struct Transaction {
pub id: u32,
pub tx_type: TransactionType,
pub status: TransactionStatus,
pub isolation_level: IsolationLevel,
pub start_time: u64,
pub depth: u8,
/* private fields */
}Expand description
事务上下文
Fields§
§id: u32事务ID
tx_type: TransactionType事务类型
status: TransactionStatus事务状态
isolation_level: IsolationLevel事务隔离级别
start_time: u64开始时间戳(微秒)
depth: u8嵌套深度(不支持嵌套事务,固定为1)
Implementations§
Source§impl Transaction
impl Transaction
Sourcepub unsafe fn add_log_item(
&mut self,
op_type: LogOperation,
table_id: u8,
record_id: u16,
old_data: *const u8,
new_data: *const u8,
data_size: usize,
) -> Result<()>
pub unsafe fn add_log_item( &mut self, op_type: LogOperation, table_id: u8, record_id: u16, old_data: *const u8, new_data: *const u8, data_size: usize, ) -> Result<()>
添加日志项
Sourcepub fn duration_us(&self) -> u64
pub fn duration_us(&self) -> u64
获取事务持续时间(微秒)
Sourcepub fn log_item_count(&self) -> usize
pub fn log_item_count(&self) -> usize
获取日志项数量
Sourcepub fn is_read_only(&self) -> bool
pub fn is_read_only(&self) -> bool
检查事务是否只读
Auto Trait Implementations§
impl Freeze for Transaction
impl RefUnwindSafe for Transaction
impl !Send for Transaction
impl !Sync for Transaction
impl Unpin for Transaction
impl UnwindSafe for Transaction
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