Struct txn_core::sync::HashCm

source ·
pub struct HashCm<K, S = DefaultHasher> { /* private fields */ }
Expand description

A Cm conflict manager implementation that based on the Hash.

Trait Implementations§

source§

impl<K, S: Clone> Clone for HashCm<K, S>

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<K, S> Cm for HashCm<K, S>
where S: BuildHasher, K: Hash + Eq,

§

type Error = Infallible

The error type returned by the conflict manager.
§

type Key = K

The key type.
§

type Options = HashCmOptions<S>

The options type used to create the conflict manager.
source§

fn new(options: Self::Options) -> Result<Self, Self::Error>

Create a new conflict manager with the given options.
source§

fn mark_read(&mut self, key: &K)

Mark the key is read.
source§

fn mark_conflict(&mut self, key: &Self::Key)

Mark the key is .
source§

fn has_conflict(&self, other: &Self) -> bool

Returns true if we have a conflict.
source§

fn rollback(&mut self) -> Result<(), Self::Error>

Rollback the conflict manager.
source§

impl<K, S> CmEquivalent for HashCm<K, S>
where S: BuildHasher, K: Hash + Eq,

source§

fn mark_read_equivalent<Q>(&mut self, key: &Q)
where Self::Key: Borrow<Q>, Q: Hash + Eq + ?Sized,

Optimized version of [mark_read] that accepts borrowed keys. Optional to implement.
source§

fn mark_conflict_equivalent<Q>(&mut self, key: &Q)
where Self::Key: Borrow<Q>, Q: Hash + Eq + ?Sized,

Optimized version of [mark_conflict] that accepts borrowed keys. Optional to implement.

Auto Trait Implementations§

§

impl<K, S> Freeze for HashCm<K, S>
where S: Freeze,

§

impl<K, S> RefUnwindSafe for HashCm<K, S>

§

impl<K, S> Send for HashCm<K, S>
where K: Send, S: Send,

§

impl<K, S> Sync for HashCm<K, S>
where K: Sync, S: Sync,

§

impl<K, S> Unpin for HashCm<K, S>
where K: Unpin, S: Unpin,

§

impl<K, S> UnwindSafe for HashCm<K, S>
where K: UnwindSafe, S: UnwindSafe,

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> AsyncCm for T
where T: Cm,

§

type Error = <T as Cm>::Error

The error type returned by the conflict manager.
§

type Key = <T as Cm>::Key

The key type.
§

type Options = <T as Cm>::Options

The options type used to create the conflict manager.
source§

async fn new( options: <T as AsyncCm>::Options ) -> Result<T, <T as AsyncCm>::Error>

Create a new conflict manager with the given options.
source§

async fn mark_read(&mut self, key: &<T as AsyncCm>::Key)

Mark the key is read.
source§

async fn mark_conflict(&mut self, key: &<T as AsyncCm>::Key)

Mark the key is .
source§

async fn has_conflict(&self, other: &T) -> bool

Returns true if we have a conflict.
source§

async fn rollback(&mut self) -> Result<(), <T as AsyncCm>::Error>

Rollback the conflict manager.
source§

impl<T> AsyncCmEquivalent for T
where T: CmEquivalent,

source§

async fn mark_read_equivalent<Q>(&mut self, key: &Q)
where <T as AsyncCm>::Key: Borrow<Q>, Q: Hash + Eq + ?Sized,

Optimized version of [mark_read] that accepts borrowed keys. Optional to implement.
source§

async fn mark_conflict_equivalent<Q>(&mut self, key: &Q)
where <T as AsyncCm>::Key: Borrow<Q>, Q: Hash + Eq + ?Sized,

Optimized version of [mark_conflict] that accepts borrowed keys. Optional to implement.
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.