pub struct Mesh { /* private fields */ }Expand description
A Datumesh mesh: the engine behind the endpoints. Cheap to clone (shared).
Implementations§
Source§impl Mesh
impl Mesh
Source§impl Mesh
impl Mesh
Sourcepub fn builder(
config: Config,
store: Arc<dyn Store + Send + Sync>,
) -> MeshBuilder
pub fn builder( config: Config, store: Arc<dyn Store + Send + Sync>, ) -> MeshBuilder
A builder for a mesh on store with config.
Sourcepub fn clear_memo(&self)
pub fn clear_memo(&self)
Forgets every memoised answer (the engine’s memo and the mesh’s), for a process that wrote versions without telling the mesh.
Sourcepub fn keys(&self) -> &KeyCache
pub fn keys(&self) -> &KeyCache
The key documents the mesh holds for other hosts (fetched, or inserted here): what
POST /verify verifies with, besides the store’s namespace records.
Sourcepub fn stored_version_added(&self, cell_id: &str)
pub fn stored_version_added(&self, cell_id: &str)
Tells the engine that a stored version was added for cell_id outside the mesh.
Sourcepub fn cell(&self, rest: &str, principal: Option<&Principal>) -> Reply
pub fn cell(&self, rest: &str, principal: Option<&Principal>) -> Reply
The envelope for rest (a call or a cell URI’s rest, query included, as received at
/cell/), for principal. Blocking, and without a budget: what a /cell request
gets when it finishes within its budget, or its job’s result.
Sourcepub fn cells(
&self,
rests: &[String],
principal: Option<&Principal>,
) -> Vec<Reply>
pub fn cells( &self, rests: &[String], principal: Option<&Principal>, ) -> Vec<Reply>
The envelopes of a batch, in order (blocking, no budget).
Sourcepub fn resolve(&self, rest: &str, slice: bool) -> Result<Arc<Target>, Rejection>
pub fn resolve(&self, rest: &str, slice: bool) -> Result<Arc<Target>, Rejection>
Resolves a request to its cell, as /cell does (or to its slice, with slice).
Sourcepub fn verify(
&self,
receipt: &[u8],
signed_only: bool,
blob: Option<&[u8]>,
) -> Verified
pub fn verify( &self, receipt: &[u8], signed_only: bool, blob: Option<&[u8]>, ) -> Verified
Verifies a receipt (SPEC 10.1) with the mesh’s keys; at level recomputed with the
engine as the resolver unless signed_only; blob is content for step 7.7.
Sourcepub fn verify_offered(
&self,
receipt: &[u8],
recompute: Option<&Value>,
blob: Option<&[u8]>,
) -> Verified
pub fn verify_offered( &self, receipt: &[u8], recompute: Option<&Value>, blob: Option<&[u8]>, ) -> Verified
Verifies a receipt with the mesh’s keys and what the caller offers for step 7: a
recompute object as SPEC 11 describes it (descriptor, inputs, manifests,
lineage, value), the core’s MapResolver over it. Without one, steps 1-6 only.
Sourcepub fn mesh_document(&self) -> Vec<u8> ⓘ
pub fn mesh_document(&self) -> Vec<u8> ⓘ
The mesh document (SPEC 9.6) this mesh serves: its URLs on the base URL when one is
set (Config::base_url), else on https://<host>.
Sourcepub fn key_document(&self) -> Option<Vec<u8>>
pub fn key_document(&self) -> Option<Vec<u8>>
The key document this mesh serves: the store’s namespace record for its host.
Sourcepub fn requests_of(&self, route: &str) -> u64
pub fn requests_of(&self, route: &str) -> u64
The number of requests counted for a route template (e.g. /cell/{cell}).