IndexedDBEnvironment

Struct IndexedDBEnvironment 

Source
struct IndexedDBEnvironment<E: KvsEngine> {
Show 14 fields engine: E, manager_sender: GenericSender<IndexedDBThreadMsg>, transactions: FxHashMap<u64, KvsTransaction>, next_created_seq: u64, txn_info: FxHashMap<u64, TxnInfo>, queued_readwrite: VecDeque<u64>, queued_readonly: VecDeque<u64>, queued_readwrite_set: FxHashSet<u64>, queued_readonly_set: FxHashSet<u64>, running_readwrite: Option<u64>, running_readonly: HashSet<u64>, handled_next_unhandled_request_id: FxHashMap<u64, u64>, handled_pending: FxHashMap<u64, HashSet<u64>>, pending_commit_callbacks: FxHashMap<u64, Vec<GenericCallback<TxnCompleteMsg>>>,
}

Fields§

§engine: E§manager_sender: GenericSender<IndexedDBThreadMsg>§transactions: FxHashMap<u64, KvsTransaction>§next_created_seq: u64§txn_info: FxHashMap<u64, TxnInfo>§queued_readwrite: VecDeque<u64>§queued_readonly: VecDeque<u64>§queued_readwrite_set: FxHashSet<u64>§queued_readonly_set: FxHashSet<u64>§running_readwrite: Option<u64>§running_readonly: HashSet<u64>§handled_next_unhandled_request_id: FxHashMap<u64, u64>§handled_pending: FxHashMap<u64, HashSet<u64>>§pending_commit_callbacks: FxHashMap<u64, Vec<GenericCallback<TxnCompleteMsg>>>

Implementations§

Source§

impl<E: KvsEngine> IndexedDBEnvironment<E>

Source

fn new( engine: E, manager_sender: GenericSender<IndexedDBThreadMsg>, ) -> IndexedDBEnvironment<E>

Source

fn register_transaction( &mut self, txn: u64, mode: IndexedDBTxnMode, scope: Vec<String>, )

Source

fn scopes_overlap(a: &TxnInfo, b: &TxnInfo) -> bool

Source

fn earlier_overlapping_live_exists<F>(&self, txn: u64, predicate: F) -> bool
where F: Fn(&TxnInfo) -> bool,

Source

fn can_start_by_spec(&self, txn: u64) -> bool

Source

fn enqueue_txn(&mut self, txn: u64, mode: &IndexedDBTxnMode)

Source

fn queue_operation( &mut self, store_name: &str, serial_number: u64, mode: IndexedDBTxnMode, operation: AsyncOperation, )

Source

fn schedule_transactions(&mut self, origin: ImmutableOrigin, db_name: &str)

Source

fn start_transaction( &mut self, origin: ImmutableOrigin, db_name: String, txn: u64, sender: Option<GenericSender<BackendResult<()>>>, )

Source

fn mark_request_handled(&mut self, txn: u64, request_id: u64)

Source

fn can_notify_txn_maybe_commit(&self, txn: u64) -> bool

Source

fn can_commit_now(&self, txn: u64) -> bool

Source

fn queue_pending_commit_callback( &mut self, txn: u64, callback: GenericCallback<TxnCompleteMsg>, )

Source

fn take_pending_commit_callbacks( &mut self, txn: u64, ) -> Vec<GenericCallback<TxnCompleteMsg>>

Source

fn maybe_commit_candidates(&self) -> Vec<u64>

Source

fn finish_transaction(&mut self, txn: u64)

Source

fn abort_transaction(&mut self, txn: u64)

Source

fn key_generator_current_number(&self, store_name: &str) -> Option<i32>

Source

fn key_path(&self, store_name: &str) -> Option<KeyPath>

Source

fn object_store_names(&self) -> DbResult<Vec<String>>

Source

fn indexes(&self, store_name: &str) -> DbResult<Vec<IndexedDBIndex>>

Source

fn create_index( &self, store_name: &str, index_name: String, key_path: KeyPath, unique: bool, multi_entry: bool, ) -> DbResult<CreateObjectResult>

Source

fn delete_index(&self, store_name: &str, index_name: String) -> DbResult<()>

Source

fn create_object_store( &mut self, store_name: &str, key_path: Option<KeyPath>, auto_increment: bool, ) -> DbResult<CreateObjectResult>

Source

fn delete_object_store(&mut self, store_name: &str) -> DbResult<()>

Source

fn delete_database(self) -> BackendResult<()>

Source

fn version(&self) -> Result<u64, E::Error>

Source

fn set_version(&mut self, version: u64) -> DbResult<()>

Trait Implementations§

Source§

impl<E> MallocSizeOf for IndexedDBEnvironment<E>

Source§

fn size_of(&self, ops: &mut MallocSizeOfOps) -> usize

Measure the heap usage of all descendant heap-allocated structures, but not the space taken up by the value itself.

Auto Trait Implementations§

§

impl<E> Freeze for IndexedDBEnvironment<E>
where E: Freeze,

§

impl<E> RefUnwindSafe for IndexedDBEnvironment<E>
where E: RefUnwindSafe,

§

impl<E> Send for IndexedDBEnvironment<E>
where E: Send,

§

impl<E> Sync for IndexedDBEnvironment<E>
where E: Sync,

§

impl<E> Unpin for IndexedDBEnvironment<E>
where E: Unpin,

§

impl<E> UnwindSafe for IndexedDBEnvironment<E>
where E: 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> 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> 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> IntoEither for T

Source§

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

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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

impl<T> MaybeBoxed<Box<T>> for T

Source§

fn maybe_boxed(self) -> Box<T>

Convert
Source§

impl<T> MaybeBoxed<T> for T

Source§

fn maybe_boxed(self) -> T

Convert
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
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<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

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

impl<T> ErasedDestructor for T
where T: 'static,

Source§

impl<T> MaybeSendSync for T