Skip to content

Commit df13221

Browse files
committed
refactor(eql-types): rename OreBlock newtype U64_8_256 -> 256
The ob-term newtype tracks the SEM constructor name (terms.rs module doc), which this branch renamed eql_v3.ore_block_u64_8_256 -> eql_v3.ore_block_256 once the comparator went width-agnostic (8/12/14 blocks). Finish that rename on the Rust side so the newtype no longer claims a fixed u64/8-block width. Mechanical: struct, field types, From impl, uses, and the README table.
1 parent 4418dc2 commit df13221

9 files changed

Lines changed: 24 additions & 24 deletions

File tree

crates/eql-types/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ Shared wire fields are reusable newtypes in
3434
|---------|----------|-------|-------|
3535
| `Ciphertext` | `c` | `String` | every domain (envelope) |
3636
| `Hmac256` | `hm` | `String` | `_eq` domains |
37-
| `OreBlockU64_8_256` | `ob` | `Vec<String>` | `_ord` / `_ord_ore` domains |
37+
| `OreBlock256` | `ob` | `Vec<String>` | `_ord` / `_ord_ore` domains |
3838
| `BloomFilter` | `bf` | `Vec<i16>` (signed!) | `_match` domains |
3939

4040
Note "v3" names the SQL schema generation (`eql_v3.*`); the JSON envelope

crates/eql-types/src/v3/date.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
//! ciphertext, so dates order like integers); see that module for the
44
//! capability table.
55
6-
use crate::v3::terms::{Ciphertext, Hmac256, OreBlockU64_8_256};
6+
use crate::v3::terms::{Ciphertext, Hmac256, OreBlock256};
77
use crate::v3::DomainType;
88
use crate::{Identifier, SchemaVersion};
99
use serde::{Deserialize, Serialize};
@@ -68,7 +68,7 @@ pub struct DateOrdOre {
6868
/// mp_base85 source ciphertext. Required by the domain CHECK.
6969
pub c: Ciphertext,
7070
/// Block-ORE order term. Serves equality too.
71-
pub ob: OreBlockU64_8_256,
71+
pub ob: OreBlock256,
7272
}
7373

7474
impl DomainType for DateOrdOre {
@@ -93,7 +93,7 @@ pub struct DateOrd {
9393
/// mp_base85 source ciphertext. Required by the domain CHECK.
9494
pub c: Ciphertext,
9595
/// Block-ORE order term. Serves equality too.
96-
pub ob: OreBlockU64_8_256,
96+
pub ob: OreBlock256,
9797
}
9898

9999
impl DomainType for DateOrd {

crates/eql-types/src/v3/int2.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//! The `int2` encrypted-domain family. Same four-domain ordered shape as
22
//! [`crate::v3::int4`] — see that module for the capability table.
33
4-
use crate::v3::terms::{Ciphertext, Hmac256, OreBlockU64_8_256};
4+
use crate::v3::terms::{Ciphertext, Hmac256, OreBlock256};
55
use crate::v3::DomainType;
66
use crate::{Identifier, SchemaVersion};
77
use serde::{Deserialize, Serialize};
@@ -66,7 +66,7 @@ pub struct Int2OrdOre {
6666
/// mp_base85 source ciphertext. Required by the domain CHECK.
6767
pub c: Ciphertext,
6868
/// Block-ORE order term. Serves equality too.
69-
pub ob: OreBlockU64_8_256,
69+
pub ob: OreBlock256,
7070
}
7171

7272
impl DomainType for Int2OrdOre {
@@ -91,7 +91,7 @@ pub struct Int2Ord {
9191
/// mp_base85 source ciphertext. Required by the domain CHECK.
9292
pub c: Ciphertext,
9393
/// Block-ORE order term. Serves equality too.
94-
pub ob: OreBlockU64_8_256,
94+
pub ob: OreBlock256,
9595
}
9696

9797
impl DomainType for Int2Ord {

crates/eql-types/src/v3/int4.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
//! | [`Int4OrdOre`] | `eql_v3.int4_ord_ore` | `v` `i` `c` `ob` | `=` `<>` `<` `<=` `>` `>=` |
88
//! | [`Int4Ord`] | `eql_v3.int4_ord` | `v` `i` `c` `ob` | `=` `<>` `<` `<=` `>` `>=` |
99
10-
use crate::v3::terms::{Ciphertext, Hmac256, OreBlockU64_8_256};
10+
use crate::v3::terms::{Ciphertext, Hmac256, OreBlock256};
1111
use crate::v3::DomainType;
1212
use crate::{Identifier, SchemaVersion};
1313
use serde::{Deserialize, Serialize};
@@ -74,7 +74,7 @@ pub struct Int4OrdOre {
7474
pub c: Ciphertext,
7575
/// Block-ORE order term. Serves equality too — ORE over a
7676
/// full-domain `int4` is lossless, so no separate `hm` is carried.
77-
pub ob: OreBlockU64_8_256,
77+
pub ob: OreBlock256,
7878
}
7979

8080
impl DomainType for Int4OrdOre {
@@ -99,7 +99,7 @@ pub struct Int4Ord {
9999
/// mp_base85 source ciphertext. Required by the domain CHECK.
100100
pub c: Ciphertext,
101101
/// Block-ORE order term. Serves equality too.
102-
pub ob: OreBlockU64_8_256,
102+
pub ob: OreBlock256,
103103
}
104104

105105
impl DomainType for Int4Ord {

crates/eql-types/src/v3/int8.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//! The `int8` encrypted-domain family. Same four-domain ordered shape as
22
//! [`crate::v3::int4`] — see that module for the capability table.
33
4-
use crate::v3::terms::{Ciphertext, Hmac256, OreBlockU64_8_256};
4+
use crate::v3::terms::{Ciphertext, Hmac256, OreBlock256};
55
use crate::v3::DomainType;
66
use crate::{Identifier, SchemaVersion};
77
use serde::{Deserialize, Serialize};
@@ -66,7 +66,7 @@ pub struct Int8OrdOre {
6666
/// mp_base85 source ciphertext. Required by the domain CHECK.
6767
pub c: Ciphertext,
6868
/// Block-ORE order term. Serves equality too.
69-
pub ob: OreBlockU64_8_256,
69+
pub ob: OreBlock256,
7070
}
7171

7272
impl DomainType for Int8OrdOre {
@@ -91,7 +91,7 @@ pub struct Int8Ord {
9191
/// mp_base85 source ciphertext. Required by the domain CHECK.
9292
pub c: Ciphertext,
9393
/// Block-ORE order term. Serves equality too.
94-
pub ob: OreBlockU64_8_256,
94+
pub ob: OreBlock256,
9595
}
9696

9797
impl DomainType for Int8Ord {

crates/eql-types/src/v3/numeric.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
//! more block strings — and the generalized `eql_v3.ore_block_256` comparator
99
//! orders any block count, so no new type is needed here.
1010
11-
use crate::v3::terms::{Ciphertext, Hmac256, OreBlockU64_8_256};
11+
use crate::v3::terms::{Ciphertext, Hmac256, OreBlock256};
1212
use crate::v3::DomainType;
1313
use crate::{Identifier, SchemaVersion};
1414
use serde::{Deserialize, Serialize};
@@ -73,7 +73,7 @@ pub struct NumericOrdOre {
7373
/// mp_base85 source ciphertext. Required by the domain CHECK.
7474
pub c: Ciphertext,
7575
/// Block-ORE order term (14 blocks for numeric). Serves equality too.
76-
pub ob: OreBlockU64_8_256,
76+
pub ob: OreBlock256,
7777
}
7878

7979
impl DomainType for NumericOrdOre {
@@ -98,7 +98,7 @@ pub struct NumericOrd {
9898
/// mp_base85 source ciphertext. Required by the domain CHECK.
9999
pub c: Ciphertext,
100100
/// Block-ORE order term (14 blocks for numeric). Serves equality too.
101-
pub ob: OreBlockU64_8_256,
101+
pub ob: OreBlock256,
102102
}
103103

104104
impl DomainType for NumericOrd {

crates/eql-types/src/v3/terms.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ pub struct Hmac256(pub String);
3030
/// array just carries more block strings. SQL-side constructor:
3131
/// `eql_v3.ore_block_256`.
3232
#[derive(Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)]
33-
pub struct OreBlockU64_8_256(pub Vec<String>);
33+
pub struct OreBlock256(pub Vec<String>);
3434

3535
/// Bloom-filter match term — the `bf` wire key. Backs the `_match` domains
3636
/// (`~~` containment via `@>`/`<@`).
@@ -53,7 +53,7 @@ impl From<String> for Hmac256 {
5353
}
5454
}
5555

56-
impl From<Vec<String>> for OreBlockU64_8_256 {
56+
impl From<Vec<String>> for OreBlock256 {
5757
fn from(value: Vec<String>) -> Self {
5858
Self(value)
5959
}

crates/eql-types/src/v3/text.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
//! [`crate::v3::int4`] plus a `_match` domain backed by the Bloom-filter
33
//! term (`@>`/`<@` containment for `LIKE`-style matching).
44
5-
use crate::v3::terms::{BloomFilter, Ciphertext, Hmac256, OreBlockU64_8_256};
5+
use crate::v3::terms::{BloomFilter, Ciphertext, Hmac256, OreBlock256};
66
use crate::v3::DomainType;
77
use crate::{Identifier, SchemaVersion};
88
use serde::{Deserialize, Serialize};
@@ -93,7 +93,7 @@ pub struct TextOrdOre {
9393
/// mp_base85 source ciphertext. Required by the domain CHECK.
9494
pub c: Ciphertext,
9595
/// Block-ORE order term. Serves equality too.
96-
pub ob: OreBlockU64_8_256,
96+
pub ob: OreBlock256,
9797
}
9898

9999
impl DomainType for TextOrdOre {
@@ -119,7 +119,7 @@ pub struct TextOrd {
119119
/// mp_base85 source ciphertext. Required by the domain CHECK.
120120
pub c: Ciphertext,
121121
/// Block-ORE order term. Serves equality too.
122-
pub ob: OreBlockU64_8_256,
122+
pub ob: OreBlock256,
123123
}
124124

125125
impl DomainType for TextOrd {

crates/eql-types/src/v3/timestamptz.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
//! length, the 12-block `ob` term orders correctly and the ordered domains
1010
//! ship. The wire shape is unchanged — the `ob` array just carries 12 blocks.
1111
12-
use crate::v3::terms::{Ciphertext, Hmac256, OreBlockU64_8_256};
12+
use crate::v3::terms::{Ciphertext, Hmac256, OreBlock256};
1313
use crate::v3::DomainType;
1414
use crate::{Identifier, SchemaVersion};
1515
use serde::{Deserialize, Serialize};
@@ -74,7 +74,7 @@ pub struct TimestamptzOrdOre {
7474
/// mp_base85 source ciphertext. Required by the domain CHECK.
7575
pub c: Ciphertext,
7676
/// Block-ORE order term (12 blocks for timestamptz). Serves equality too.
77-
pub ob: OreBlockU64_8_256,
77+
pub ob: OreBlock256,
7878
}
7979

8080
impl DomainType for TimestamptzOrdOre {
@@ -99,7 +99,7 @@ pub struct TimestamptzOrd {
9999
/// mp_base85 source ciphertext. Required by the domain CHECK.
100100
pub c: Ciphertext,
101101
/// Block-ORE order term (12 blocks for timestamptz). Serves equality too.
102-
pub ob: OreBlockU64_8_256,
102+
pub ob: OreBlock256,
103103
}
104104

105105
impl DomainType for TimestamptzOrd {

0 commit comments

Comments
 (0)