MCPcopy Create free account
hub / github.com/hashintel/hash / current_context

Method current_context

libs/error-stack/src/report.rs:443–458  ·  view source on GitHub ↗
(&self)

Source from the content-addressed store, hash-verified

441 /// ```
442 #[must_use]
443 pub fn current_context(&self) -> &C
444 where
445 C: Send + Sync + 'static,
446 {
447 self.downcast_ref().unwrap_or_else(|| {
448 // Panics if there isn't an attached context which matches `T`. As it's not possible to
449 // create a `Report` without a valid context and this method can only be called when `T`
450 // is a valid context, it's guaranteed that the context is available.
451 unreachable!(
452 "Report does not contain a context. This should not happen as a Report must \
453 always contain at least one frame.\n\n
454 Please file an issue to https://github.com/hashintel/hash/issues/new?template=bug-report-error-stack.yml\n\n
455 Report:\n{self:?}",
456 )
457 })
458 }
459
460 /// Converts this `Report` to an [`Error`].
461 #[must_use]

Callers 10

anyhow_outputFunction · 0.80
eyre_outputFunction · 0.80
insert_teamMethod · 0.80
create_base_urlMethod · 0.80
create_ontology_idMethod · 0.80
assert_encode_errorFunction · 0.80
assert_decode_errorFunction · 0.80
swarm_shutdown_clientFunction · 0.80
too_many_connectionsFunction · 0.80

Calls 1

downcast_refMethod · 0.45

Tested by 4

anyhow_outputFunction · 0.64
eyre_outputFunction · 0.64
swarm_shutdown_clientFunction · 0.64
too_many_connectionsFunction · 0.64