pub struct RowidAllocator { /* private fields */ }Implementations§
Source§impl RowidAllocator
impl RowidAllocator
Sourcepub fn get_next_rowid(&self) -> Option<(i64, Option<i64>)>
pub fn get_next_rowid(&self) -> Option<(i64, Option<i64>)>
Lock-free rowid allocation via atomic CAS. Returns None only when at i64::MAX (triggers random fallback). Returns Some((new_rowid, prev_rowid)) where prev_rowid is None if table was empty.
Sourcepub fn insert_row_id_maybe_update(&self, rowid: i64)
pub fn insert_row_id_maybe_update(&self, rowid: i64)
Bump the counter to at least rowid. Used for user-specified rowids
(e.g. INSERT INTO t(rowid,…) VALUES(1000,…)).
pub fn is_uninitialized(&self) -> bool
Sourcepub fn initialize(&self, rowid: Option<i64>)
pub fn initialize(&self, rowid: Option<i64>)
Initialize from btree max. Called once per table, under lock.
pub fn lock(&self) -> bool
pub fn unlock(&self)
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for RowidAllocator
impl RefUnwindSafe for RowidAllocator
impl Send for RowidAllocator
impl Sync for RowidAllocator
impl Unpin for RowidAllocator
impl UnsafeUnpin for RowidAllocator
impl UnwindSafe for RowidAllocator
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
impl<T> ErasedDestructor for Twhere
T: 'static,
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> ⓘ
Converts
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> ⓘ
Converts
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