use crate::{
Ro, RoSync, Rw, RwSync,
tx::{
PtrSync, PtrUnsync,
cursor::Cursor,
r#impl::Tx,
iter::{Iter, IterDupFixed, IterDupFixedOfKey},
},
};
use std::{borrow::Cow, sync::Arc};
pub type TxSync<K> = Tx<K, Arc<PtrSync>>;
pub type TxUnsync<K> = Tx<K, PtrUnsync>;
pub type RoTxSync = TxSync<RoSync>;
pub type RwTxSync = TxSync<RwSync>;
pub type RoTxUnsync = TxUnsync<Ro>;
pub type RwTxUnsync = TxUnsync<Rw>;
unsafe impl Send for RoTxSync {}
unsafe impl Send for RwTxSync {}
unsafe impl Send for RoTxUnsync {}
pub type RoCursorSync<'tx> = Cursor<'tx, RoSync>;
pub type RwCursorSync<'tx> = Cursor<'tx, RwSync>;
pub type RoCursorUnsync<'tx> = Cursor<'tx, Ro>;
pub type RwCursorUnsync<'tx> = Cursor<'tx, Rw>;
pub type IterKeyVals<'tx, 'cur, K, Key = Cow<'tx, [u8]>, Value = Cow<'tx, [u8]>> =
Iter<'tx, 'cur, K, Key, Value, { ffi::MDBX_NEXT }>;
pub type IterDupKeys<'tx, 'cur, K, Key = Cow<'tx, [u8]>, Value = Cow<'tx, [u8]>> =
Iter<'tx, 'cur, K, Key, Value, { ffi::MDBX_NEXT_NODUP }>;
pub type IterDupVals<'tx, 'cur, K, Key = Cow<'tx, [u8]>, Value = Cow<'tx, [u8]>> =
Iter<'tx, 'cur, K, Key, Value, { ffi::MDBX_NEXT_DUP }>;
pub type RoIterSync<'tx, 'cur, Key = Cow<'tx, [u8]>, Value = Cow<'tx, [u8]>> =
IterKeyVals<'tx, 'cur, RoSync, Key, Value>;
pub type RwIterSync<'tx, 'cur, Key = Cow<'tx, [u8]>, Value = Cow<'tx, [u8]>> =
IterKeyVals<'tx, 'cur, RwSync, Key, Value>;
pub type RoIterUnsync<'tx, 'cur, Key = Cow<'tx, [u8]>, Value = Cow<'tx, [u8]>> =
IterKeyVals<'tx, 'cur, Ro, Key, Value>;
pub type RwIterUnsync<'tx, 'cur, Key = Cow<'tx, [u8]>, Value = Cow<'tx, [u8]>> =
IterKeyVals<'tx, 'cur, Rw, Key, Value>;
pub type RoDupFixedIterSync<'tx, 'cur, Key = Cow<'tx, [u8]>, const VALUE_SIZE: usize = 0> =
IterDupFixed<'tx, 'cur, RoSync, Key, VALUE_SIZE>;
pub type RwDupFixedIterSync<'tx, 'cur, Key = Cow<'tx, [u8]>, const VALUE_SIZE: usize = 0> =
IterDupFixed<'tx, 'cur, RwSync, Key, VALUE_SIZE>;
pub type RoDupFixedIterUnsync<'tx, 'cur, Key = Cow<'tx, [u8]>, const VALUE_SIZE: usize = 0> =
IterDupFixed<'tx, 'cur, Ro, Key, VALUE_SIZE>;
pub type RwDupFixedIterUnsync<'tx, 'cur, Key = Cow<'tx, [u8]>, const VALUE_SIZE: usize = 0> =
IterDupFixed<'tx, 'cur, Rw, Key, VALUE_SIZE>;
pub type RoDupFixedIterOfKeySync<'tx, 'cur, const VALUE_SIZE: usize = 0> =
IterDupFixedOfKey<'tx, 'cur, RoSync, VALUE_SIZE>;
pub type RwDupFixedIterOfKeySync<'tx, 'cur, const VALUE_SIZE: usize = 0> =
IterDupFixedOfKey<'tx, 'cur, RwSync, VALUE_SIZE>;
pub type RoDupFixedIterOfKeyUnsync<'tx, 'cur, const VALUE_SIZE: usize = 0> =
IterDupFixedOfKey<'tx, 'cur, Ro, VALUE_SIZE>;
pub type RwDupFixedIterOfKeyUnsync<'tx, 'cur, const VALUE_SIZE: usize = 0> =
IterDupFixedOfKey<'tx, 'cur, Rw, VALUE_SIZE>;