Development Documentation (main branch) - For stable release docs, see docs.rs/eidetica

Module ticket

Module ticket 

Source
Expand description

URL-based shareable database link.

A DatabaseTicket encodes a database ID and optional peer address hints into a compact URL that can be shared between peers.

§URL Format

Magnet-style URI with the database ID and peer addresses as query parameters:

eidetica:?db=<database_id>&pr=<peer_address>&pr=<peer_address>
  • db (required): The database ID, passed through as-is (e.g., sha256:hex)
  • pr (optional, repeatable): A peer address prefixed by its transport type (e.g., http:host:port, iroh:endpointABC...)

§Examples

let id = ID::new("sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855");
let ticket = DatabaseTicket::new(id);
let url = ticket.to_string();
assert!(url.starts_with("eidetica:?db=sha256:"));

let parsed: DatabaseTicket = url.parse().unwrap();
assert_eq!(parsed.database_id(), ticket.database_id());

Structs§

DatabaseTicket
A shareable link containing a database ID and optional transport address hints.