pub struct PreupdateHookResult<'a> {
pub operation: SqliteOperation,
pub database: &'a str,
pub table: &'a str,
/* private fields */
}
_sqlite
only.Fieldsยง
ยงoperation: SqliteOperation
ยงdatabase: &'a str
ยงtable: &'a str
Implementationsยง
Sourceยงimpl<'a> PreupdateHookResult<'a>
impl<'a> PreupdateHookResult<'a>
Sourcepub fn get_column_count(&self) -> i32
pub fn get_column_count(&self) -> i32
Gets the amount of columns in the row being inserted, deleted, or updated.
Sourcepub fn get_query_depth(&self) -> i32
pub fn get_query_depth(&self) -> i32
Gets the depth of the query that triggered the preupdate hook. Returns 0 if the preupdate callback was invoked as a result of a direct insert, update, or delete operation; 1 for inserts, updates, or deletes invoked by top-level triggers; 2 for changes resulting from triggers called by top-level triggers; and so forth.
Sourcepub fn get_old_row_id(&self) -> Result<i64, PreupdateError>
pub fn get_old_row_id(&self) -> Result<i64, PreupdateError>
Gets the row id of the row being updated/deleted. Returns an error if called from an insert operation.
Sourcepub fn get_new_row_id(&self) -> Result<i64, PreupdateError>
pub fn get_new_row_id(&self) -> Result<i64, PreupdateError>
Gets the row id of the row being inserted/updated. Returns an error if called from a delete operation.
Sourcepub fn get_old_column_value(
&self,
i: i32,
) -> Result<SqliteValueRef<'a>, PreupdateError>
pub fn get_old_column_value( &self, i: i32, ) -> Result<SqliteValueRef<'a>, PreupdateError>
Gets the value of the row being updated/deleted at the specified index. Returns an error if called from an insert operation or the index is out of bounds.
Sourcepub fn get_new_column_value(
&self,
i: i32,
) -> Result<SqliteValueRef<'a>, PreupdateError>
pub fn get_new_column_value( &self, i: i32, ) -> Result<SqliteValueRef<'a>, PreupdateError>
Gets the value of the row being inserted/updated at the specified index. Returns an error if called from a delete operation or the index is out of bounds.
Trait Implementationsยง
Auto Trait Implementationsยง
impl<'a> Freeze for PreupdateHookResult<'a>
impl<'a> RefUnwindSafe for PreupdateHookResult<'a>
impl<'a> !Send for PreupdateHookResult<'a>
impl<'a> !Sync for PreupdateHookResult<'a>
impl<'a> Unpin for PreupdateHookResult<'a>
impl<'a> UnwindSafe for PreupdateHookResult<'a>
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
Sourceยงimpl<T> Instrument for T
impl<T> Instrument for T
Sourceยงfn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Sourceยงfn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Sourceยงimpl<T> IntoEither for T
impl<T> IntoEither for T
Sourceยงfn into_either(self, into_left: bool) -> Either<Self, Self> โ
fn into_either(self, into_left: bool) -> Either<Self, Self> โ
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSourceยงfn into_either_with<F>(self, into_left: F) -> Either<Self, Self> โ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> โ
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more