(
&mut self,
id: &[u8; 32],
bytes: &[u8],
)
| 27 | |
| 28 | impl BindingMutTxnT for WriteTxn<'_> { |
| 29 | fn insert_binding_bytes( |
| 30 | &mut self, |
| 31 | id: &[u8; 32], |
| 32 | bytes: &[u8], |
| 33 | ) -> PristineResult<BindingStoreOutcome> { |
| 34 | let mut table = self.txn.open_table(BINDINGS)?; |
| 35 | if let Some(existing) = table.get(id)? { |
| 36 | if existing.value() == bytes { |
| 37 | return Ok(BindingStoreOutcome::Idempotent); |
| 38 | } |
| 39 | return Err(binding_conflict(&binding_id_hex(id))); |
| 40 | } |
| 41 | table.insert(id, bytes)?; |
| 42 | Ok(BindingStoreOutcome::Stored) |
| 43 | } |
| 44 | } |