Skip to main content

uor_addr/json/
model.rs

1//! `json::AddressModel*` — the JSON realization's `PrismModel`
2//! declarations, one per admissible σ-axis ([`crate::hash`]). Each binds
3//! the shared [`AddressResolverTuple`](crate::resolvers) ψ-tower and the
4//! axis's capacity profile ([`AddrBounds`](crate::bounds::AddrBounds) for
5//! the 32-byte axes, [`AddrBounds64`](crate::bounds::AddrBounds64) for
6//! sha512); the input is the ADR-060 borrowed-carrier handle [`JsonCarrier`].
7//! `AddressModel` (sha256) is the default.
8
9use crate::json::value::JsonCarrier;
10#[allow(unused_imports)]
11use crate::json::verbs::{
12    address_inference, address_inference_blake3, address_inference_keccak256,
13    address_inference_sha3_256, address_inference_sha512, VERB_TERMS_ADDRESS_INFERENCE,
14    VERB_TERMS_ADDRESS_INFERENCE_BLAKE3, VERB_TERMS_ADDRESS_INFERENCE_KECCAK256,
15    VERB_TERMS_ADDRESS_INFERENCE_SHA3_256, VERB_TERMS_ADDRESS_INFERENCE_SHA512,
16};
17use crate::label::{
18    AddressLabelBlake3, AddressLabelKeccak256, AddressLabelSha256, AddressLabelSha3_256,
19    AddressLabelSha512,
20};
21
22addr_models! {
23    input: JsonCarrier<'a>,
24    {
25        hasher: prism::crypto::Sha256Hasher,
26        bounds: crate::bounds::AddrBounds,
27        shape: AddressLabelSha256,
28        model: AddressModel,
29        route: AddressRoute,
30        verb: address_inference
31    },
32    {
33        hasher: prism::crypto::Blake3Hasher,
34        bounds: crate::bounds::AddrBounds,
35        shape: AddressLabelBlake3,
36        model: AddressModelBlake3,
37        route: AddressRouteBlake3,
38        verb: address_inference_blake3
39    },
40    {
41        hasher: prism::crypto::Sha3_256Hasher,
42        bounds: crate::bounds::AddrBounds,
43        shape: AddressLabelSha3_256,
44        model: AddressModelSha3_256,
45        route: AddressRouteSha3_256,
46        verb: address_inference_sha3_256
47    },
48    {
49        hasher: prism::crypto::Keccak256Hasher,
50        bounds: crate::bounds::AddrBounds,
51        shape: AddressLabelKeccak256,
52        model: AddressModelKeccak256,
53        route: AddressRouteKeccak256,
54        verb: address_inference_keccak256
55    },
56    {
57        hasher: prism::crypto::Sha512Hasher,
58        bounds: crate::bounds::AddrBounds64,
59        shape: AddressLabelSha512,
60        model: AddressModelSha512,
61        route: AddressRouteSha512,
62        verb: address_inference_sha512
63    },
64}