Struct HashCm

Source
pub struct HashCm<K, S = RandomState> { /* private fields */ }
Expand description

A Cm conflict manager implementation that based on the Hash.

Trait Implementations§

Source§

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

Source§

fn clone(&self) -> HashCm<K, S>

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,

Source§

type Error = Infallible

The error type returned by the conflict manager.
Source§

type Key = K

The key type.
Source§

type Options = HashCmOptions<S>

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

fn new( options: <HashCm<K, S> as Cm>::Options, ) -> Result<HashCm<K, S>, <HashCm<K, S> as Cm>::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: &<HashCm<K, S> as Cm>::Key)

Mark the key is .
Source§

fn has_conflict(&self, other: &HashCm<K, S>) -> bool

Returns true if we have a conflict.
Source§

fn rollback(&mut self) -> Result<(), <HashCm<K, S> as Cm>::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 <HashCm<K, S> as Cm>::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 <HashCm<K, S> as Cm>::Key: Borrow<Q>, Q: Hash + Eq + ?Sized,

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

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

Source§

fn mark_iter(&mut self)

Mark the iterator is operated, this is useful to detect the indirect conflict.

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,

Source§

type Error = <T as Cm>::Error

The error type returned by the conflict manager.
Source§

type Key = <T as Cm>::Key

The key type.
Source§

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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,

Source§

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>,

Source§

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>,

Source§

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.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more