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

Method change_context

libs/error-stack/src/report.rs:574–588  ·  view source on GitHub ↗
(mut self, context: T)

Source from the content-addressed store, hash-verified

572 /// Please see the [`Error`] documentation for more information.
573 #[track_caller]
574 pub fn change_context<T>(mut self, context: T) -> Report<T>
575 where
576 T: Error + Send + Sync + 'static,
577 {
578 let old_frames = mem::replace(self.frames.as_mut(), Vec::with_capacity(1));
579 let context_frame = vec![Frame::from_context(context, old_frames.into_boxed_slice())];
580 self.frames.push(Frame::from_attachment(
581 *Location::caller(),
582 context_frame.into_boxed_slice(),
583 ));
584 Report {
585 frames: self.frames,
586 _context: PhantomData,
587 }
588 }
589
590 /// Returns an iterator over the [`Frame`] stack of the report.
591 pub fn frames(&self) -> Frames<'_> {

Callers 15

migrateFunction · 0.45
snapshotFunction · 0.45
reindex_cacheFunction · 0.45
run_rest_serverFunction · 0.45
create_temporal_clientFunction · 0.45
start_rpc_serverFunction · 0.45
serverFunction · 0.45
healthcheckFunction · 0.45
run_type_fetcherFunction · 0.45
type_fetcherFunction · 0.45
healthcheckFunction · 0.45
run_admin_serverFunction · 0.45

Calls 3

with_capacityFunction · 0.85
pushMethod · 0.65
as_mutMethod · 0.45

Tested by 15

buildFunction · 0.36
create_sources_nestedFunction · 0.36
linearFunction · 0.36
linear_extFunction · 0.36
multiline_contextFunction · 0.36
sourcesFunction · 0.36
sources_transparentFunction · 0.36
complexFunction · 0.36
hook_providerFunction · 0.36
downcast_mut_deepFunction · 0.36
errorFunction · 0.36
request_contextFunction · 0.36