#[cfg(feature = "secondary-indexes")]
pub use pipecircuit_macros::RangeIndexKey;
pub use pipecircuit_macros::WarpTableRow;
#[doc(hidden)]
pub mod __private {
pub use super::inconsistency::invariant_violation;
#[cfg(feature = "secondary-indexes")]
pub use super::query::{
bind_detached_range_lookup, bind_detached_secondary_lookup, bind_every_row_ordering,
bind_mutable_range_lookup, bind_mutable_secondary_lookup, bind_range_lookup,
bind_range_ordering, bind_secondary_lookup, own_secondary_membership,
};
#[cfg(feature = "secondary-indexes")]
pub use super::secondary_index::{
PreparedRangeIndexInsert, PreparedRangeIndexMove, PreparedRangeIndexRemove,
PreparedSecondaryIndexInsert, PreparedSecondaryIndexMove, PreparedSecondaryIndexRemove,
PreparedSlotSetInsert, PreparedStableSlotInsert, PreparedStableSlotRemove, RangeIndex,
RangeIndexCreationError, RangeIndexInconsistency, RangeIndexInsertError,
RangeIndexInsertOutcome, RangeIndexMembership, RangeIndexMoveError, RangeIndexMoveOutcome,
RangeIndexOrderingDirection, RangeIndexOrderingLevel, RangeIndexRemoveError,
RangeIndexRemoveOutcome, SecondaryIndex, SecondaryIndexCommitRemoveOutcome,
SecondaryIndexCreationError, SecondaryIndexInconsistency, SecondaryIndexInsertError,
SecondaryIndexInsertOutcome, SecondaryIndexMembership, SecondaryIndexMoveError,
SecondaryIndexMoveOutcome, SecondaryIndexPrepareRemoveOutcome, SecondaryIndexRemoveError,
SecondaryIndexRemoveOutcome, SecondaryIndexRemoveResult, SlotSet, SlotSetInsertError,
SlotSetInsertOutcome, SlotSetRemoveOutcome, SlotSetSlots, StableSlot,
StableSlotInsertError, StableSlotRemoveOutcome, StableSlotResolutions,
StableSlotResolveOutcome, StableSlotResolver, StableSlotRowRelocation, StableSlots,
StableSlotsCreationError, StableSlotsInconsistency,
};
pub use super::unique_index::{
PreparedUniqueIndexInsert, PreparedUniqueIndexRemove, PreparedUniqueIndexReplace,
UniqueIndex, UniqueIndexInsertOutcome, UniqueIndexRemoveOutcome, UniqueIndexReplaceOutcome,
};
pub use super::update::{bind_unique_update, bind_unique_update_with};
pub use alloc::{collections::TryReserveError, vec::Vec};
}
mod creation;
mod dense_key_index;
mod entry;
mod get;
mod id;
mod inconsistency;
mod insert;
mod query;
mod remove;
mod replace;
mod row;
mod rows;
#[cfg(feature = "secondary-indexes")]
mod secondary_index;
mod unique_index;
mod update;
mod upsert;
pub use creation::{Capacity, WarpTableCreationError};
use dense_key_index::DenseKeyIndex;
pub use entry::{WarpTableEntry, WarpTableVacantEntry, WarpTableVacantInsertOutcome};
pub use get::{WarpTableGetAtOutcome, WarpTableGetOutcome, WarpTableUniqueGetOutcome};
pub use id::{WarpId, integer_index_word, sequential_index_word};
pub use inconsistency::WarpTableInconsistency;
pub use insert::{WarpTableInsertAllOutcome, WarpTableInsertOutcome, WarpTableInsertWithIdOutcome};
#[cfg(feature = "secondary-indexes")]
#[doc(hidden)]
pub use query::SelectionOperand;
#[cfg(feature = "secondary-indexes")]
#[doc(hidden)]
pub use query::{
DetachedRangeIndexLookupOutcome, DetachedSecondaryIndexLookupOutcome, DetachedSelection,
MutableSelectionOperand,
};
#[cfg(feature = "secondary-indexes")]
pub use query::{
MutableRangeIndexLookupOutcome, MutableSecondaryIndexLookupOutcome, MutableSelection,
MutableSelectionForEachOutcome, MutableSelectionRemoveFirstOutcome, OrderedRowLimit,
OrderedSelection, OrderedSelectionComparingRows, OrderedSelectionFirstCuttingTiesOutcome,
OrderedSelectionFirstKeepingTiesOutcome, RangeIndexLookupOutcome, RangeIndexOrdering,
SecondaryIndexLookupOutcome, Selection, SelectionMembershipInconsistency, SelectionRows,
};
pub use remove::{WarpTableRemoveOutcome, WarpTableRowRelocation};
pub use replace::WarpTableReplaceOutcome;
pub use row::{
IndexKey, WarpTableRow, WarpTableRowGetError, WarpTableRowGetOutcome, WarpTableRowReplaceError,
WarpTableRowReplaceOutcome,
};
pub use rows::WarpTableRows;
#[cfg(feature = "secondary-indexes")]
pub use secondary_index::SecondaryIndexInconsistency;
#[cfg(feature = "secondary-indexes")]
pub use secondary_index::{
RangeIndexBounds, RangeIndexCreationError, RangeIndexInconsistency, RangeIndexInsertFailure,
RangeIndexKey, RangeIndexLookupError, RangeIndexMoveFailure, RangeIndexOrderingError,
RangeIndexRemoveFailure, SecondaryIndexInsertFailure, SecondaryIndexMoveFailure,
SecondaryIndexRemoveFailure, StableMembershipInsertFailure,
};
pub use unique_index::{
UniqueIndexCreationError, UniqueIndexInconsistency, UniqueIndexInsertError,
UniqueIndexLookupError, UniqueIndexLookupOutcome, UniqueIndexRemoveError,
UniqueIndexReplaceError,
};
pub use update::{
WarpTableUniqueUpdateOutcome, WarpTableUniqueUpdateWithError, WarpTableUniqueUpdateWithOutcome,
WarpTableUpdateOutcome, WarpTableUpdateWithOutcome,
};
pub use upsert::WarpTableUpsertOutcome;
pub struct WarpTable<Row: WarpTableRow, Brand = Row> {
capacity: Capacity,
maximum_rows: usize,
len: usize,
next_id: Option<core::num::NonZeroU64>,
ids: __private::Vec<Row::Id>,
columns: Row::Columns,
indexes: Row::Indexes,
primary_index: DenseKeyIndex,
brand: core::marker::PhantomData<fn() -> Brand>,
}
impl<Row: WarpTableRow, Brand> WarpTable<Row, Brand> {
pub const fn capacity(&self) -> Capacity {
self.capacity
}
pub const fn len(&self) -> usize {
self.len
}
pub const fn is_empty(&self) -> bool {
self.len == 0
}
pub fn ids(&self) -> &[Row::Id] {
&self.ids
}
pub const fn columns(&self) -> &Row::Columns {
&self.columns
}
#[doc(hidden)]
pub const fn __indexes(&self) -> &Row::Indexes {
&self.indexes
}
}
#[cfg(test)]
mod derive_tests;
#[cfg(test)]
mod tests;