MCPcopy Create free account
hub / github.com/argumentcomputer/ix / try_get_const

Method try_get_const

crates/kernel/src/tc.rs:246–260  ·  view source on GitHub ↗
(
    &mut self,
    id: &KId<M>,
  )

Source from the content-addressed store, hash-verified

244 }
245
246 pub fn try_get_const(
247 &mut self,
248 id: &KId<M>,
249 ) -> Result<Option<KConst<M>>, TcError<M>> {
250 if let Some(c) = self.env.get(id) {
251 return Ok(Some(c));
252 }
253 let lazy_enabled = self.lazy_ixon.is_some() || self.lazy_anon.is_some();
254 self.lazy_ingress_addr(&id.addr)?;
255 match self.env.get(id) {
256 Some(c) => Ok(Some(c)),
257 None if lazy_enabled => Err(TcError::UnknownConst(id.addr.clone())),
258 None => Ok(None),
259 }
260 }
261
262 pub fn get_const(&mut self, id: &KId<M>) -> Result<KConst<M>, TcError<M>> {
263 self

Callers 15

coordinated_block_forMethod · 0.45
walk_for_unsafeMethod · 0.45
try_def_eq_unitMethod · 0.45
try_eta_structMethod · 0.45
def_rank_idMethod · 0.45
delta_unfold_oneMethod · 0.45
try_delta_unfoldMethod · 0.45
try_iota_with_flagsMethod · 0.45
is_struct_likeMethod · 0.45
try_struct_eta_iotaMethod · 0.45

Calls 3

lazy_ingress_addrMethod · 0.80
getMethod · 0.45
cloneMethod · 0.45

Tested by

no test coverage detected