diff --git a/src/lib.rs b/src/lib.rs index 5f0b77f..a8fa314 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1,5 +1,3 @@ -use ironsea_table::Table; - pub trait Record { fn key(&self) -> K; // Extract key from record. } @@ -8,18 +6,15 @@ pub trait RecordFields { fn fields(&self) -> F; } -pub trait RecordBuild { - fn build(key: &K, fields: &F) -> R; -} - -pub trait Indexed, R: Record, K> { +// Generic types are not sorted alphabetically, to match next trait semantic order +pub trait Indexed { fn find(&self, key: &K) -> Vec<&R>; fn find_range(&self, start: &K, end: &K) -> Vec<&R>; } -pub trait IndexedOwned, R: Record, K> { - fn find(&self, key: &K) -> Vec; +pub trait IndexedDestructured { + fn find(&self, key: &K) -> Vec<&F>; - fn find_range(&self, start: &K, end: &K) -> Vec; + fn find_range(&self, start: &K, end: &K) -> Vec<(K, &F)>; }