pub enum Put {
NoOverwrite,
Overwrite,
NoDupData,
Current,
}Expand description
Type of put operation for cursors and databases.
Specifies how to insert or update records.
Put operation mode enum.
Variants§
NoOverwrite
Insert if the key doesn’t exist, else return error.
For non-duplicate databases, returns an error if the key exists. For duplicate databases, returns an error if the key/data pair exists.
Overwrite
Insert or update (default behavior).
For non-duplicate databases, inserts if the key doesn’t exist, or replaces the data if the key exists. For duplicate databases, inserts a new duplicate.
NoDupData
Insert if key doesn’t exist, else do nothing.
Similar to NoOverwrite, but returns success (with no update) if the key already exists, rather than an error. For duplicate databases, returns success if the key/data pair exists.
Current
Update the record at the current cursor position.
Replaces the data at the current cursor position. The key cannot be changed. Returns an error if the cursor is not positioned.
Implementations§
Source§impl Put
impl Put
Sourcepub fn allows_overwrite(&self) -> bool
pub fn allows_overwrite(&self) -> bool
Returns whether this operation allows overwriting existing records.
Sourcepub fn errors_if_exists(&self) -> bool
pub fn errors_if_exists(&self) -> bool
Returns whether this operation returns an error if the record exists.
Sourcepub fn requires_positioned_cursor(&self) -> bool
pub fn requires_positioned_cursor(&self) -> bool
Returns whether this operation requires the cursor to be positioned.
Sourcepub fn prevents_duplicates(&self) -> bool
pub fn prevents_duplicates(&self) -> bool
Returns whether this operation prevents duplicate data.
Trait Implementations§
impl Copy for Put
impl Eq for Put
impl StructuralPartialEq for Put
Auto Trait Implementations§
impl Freeze for Put
impl RefUnwindSafe for Put
impl Send for Put
impl Sync for Put
impl Unpin for Put
impl UnsafeUnpin for Put
impl UnwindSafe for Put
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.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