pub struct ChangeCounts {
pub matched: u64,
pub changed: u64,
pub requested: RowCountMode,
}Expand description
The two counts a change produces, and which of them the caller asked for.
They differ, and the difference answers the commonest question a caller has about a change: writing a row the value it already holds matches one row and alters none, so a zero here is not a miss. Reporting a single number leaves the caller unable to tell those two apart, so both always travel.
Fields§
§matched: u64Rows the restriction matched.
changed: u64Rows the server actually altered.
requested: RowCountModeWhich of the two the caller asked to be the headline count.
Implementations§
Source§impl ChangeCounts
impl ChangeCounts
Sourcepub fn read(affected: u64, info: &str, requested: RowCountMode) -> Self
pub fn read(affected: u64, info: &str, requested: RowCountMode) -> Self
Reads both counts from what the server reported.
The server’s own remark carries both numbers for a statement that has both. When it does not, the count the server reported is the one the session was opened to produce, and the other is reported equal to it rather than invented as a different number.
Trait Implementations§
Source§impl Clone for ChangeCounts
impl Clone for ChangeCounts
impl Copy for ChangeCounts
Source§impl Debug for ChangeCounts
impl Debug for ChangeCounts
impl Eq for ChangeCounts
Source§impl PartialEq for ChangeCounts
impl PartialEq for ChangeCounts
impl StructuralPartialEq for ChangeCounts
Auto Trait Implementations§
impl Freeze for ChangeCounts
impl RefUnwindSafe for ChangeCounts
impl Send for ChangeCounts
impl Sync for ChangeCounts
impl Unpin for ChangeCounts
impl UnsafeUnpin for ChangeCounts
impl UnwindSafe for ChangeCounts
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.