MCPcopy Index your code
hub / github.com/aiscriptdev/aiscript / enter

Method enter

aiscript-arena/src/context.rs:620–636  ·  view source on GitHub ↗
(cx: &'a Context, phase: Option<Phase>)

Source from the content-addressed store, hash-verified

618
619impl<'a> PhaseGuard<'a> {
620 fn enter(cx: &'a Context, phase: Option<Phase>) -> Self {
621 if let Some(phase) = phase {
622 cx.phase.set(phase);
623 }
624
625 Self {
626 cx,
627 #[cfg(feature = "tracing")]
628 span: {
629 let mut span = cx.phase_span.replace(tracing::Span::none());
630 if let Some(phase) = phase {
631 span = Self::span_for(&cx.metrics, phase);
632 }
633 span.entered()
634 },
635 }
636 }
637
638 fn switch(&mut self, phase: Phase) {
639 self.cx.phase.set(phase);

Callers

nothing calls this directly

Calls 1

setMethod · 0.45

Tested by

no test coverage detected