pub struct Foreign { /* private fields */ }Expand description
The cross-mesh resolver of a mesh: the Client’s fetches and checks, then the import
into the store.
Implementations§
Source§impl Foreign
impl Foreign
Sourcepub fn is_foreign(&self, name: &str) -> bool
pub fn is_foreign(&self, name: &str) -> bool
Whether name (a function name) is under a host this mesh does not own, and
cross-mesh resolution is on (and allows that host).
Sourcepub fn any_cells(&self) -> bool
pub fn any_cells(&self) -> bool
Whether any foreign cell was ever imported (lineage checks are skipped otherwise).
Sourcepub fn take_invalidated(&self) -> Vec<String>
pub fn take_invalidated(&self) -> Vec<String>
The cells whose versions grew since the last call: the caller reports each to the
engine (stored_version_added).
Sourcepub fn keys_for(
&self,
host: &str,
refresh: bool,
) -> Result<KeyDoc, ForeignError>
pub fn keys_for( &self, host: &str, refresh: bool, ) -> Result<KeyDoc, ForeignError>
The key document of host (see Client::key_document).
Sourcepub fn mesh(&self, host: &str) -> Result<MeshDoc, ForeignError>
pub fn mesh(&self, host: &str) -> Result<MeshDoc, ForeignError>
The mesh document of host, resolved with its key document (SPEC 9.6), cached.
Sourcepub fn ensure_name(&self, name: &str) -> Result<(), ForeignError>
pub fn ensure_name(&self, name: &str) -> Result<(), ForeignError>
Brings the bindings of a foreign name up to date (when not confirmed within the TTL).
Sourcepub fn ensure_cell(&self, cell: &Cell) -> Result<bool, ForeignError>
pub fn ensure_cell(&self, cell: &Cell) -> Result<bool, ForeignError>
Brings the versions of a foreign stored cell up to date (when not confirmed within the
TTL). Ok(true) when versions were added.
Sourcepub fn ensure_publisher(&self, ns: &str) -> Result<(), ForeignError>
pub fn ensure_publisher(&self, ns: &str) -> Result<(), ForeignError>
Before this mesh computes a function under a host it does not own (a formula of
another mesh, evaluated here): the publisher’s key document, as cached (fetched again
after its TTL), put in the store, where the engine reads its declarations (SPEC 8.5,
spec-0.4.3). No HTTP response from the host is E_FOREIGN_UNAVAILABLE, its detail
first in the error’s detail (ForeignError::foreign_detail). Nothing for a
namespace this mesh owns, or with cross-mesh resolution off. Since 0.2.1.
Sourcepub fn refresh_deps(
&self,
receipt_hash: &str,
asof: &str,
) -> Result<bool, ForeignError>
pub fn refresh_deps( &self, receipt_hash: &str, asof: &str, ) -> Result<bool, ForeignError>
Confirms the foreign cells an answer rests on, for an answer as of asof: those not
confirmed within the TTL and confirmed before asof are fetched again. Ok(true) when
versions were added (the caller answers again).