pub struct RecordingContext {
pub call_id: String,
pub recorder: Arc<dyn Recorder>,
/* private fields */
}Expand description
一次调用的录制上下文(RFC R7 快照绑定):层 A 入口构造一次,
随 CallOptions/HttpRequest 传到底层,禁止各录制点重读全局 recorder。
Fields§
§call_id: String§recorder: Arc<dyn Recorder>Implementations§
Source§impl RecordingContext
impl RecordingContext
pub fn new(call_id: impl Into<String>, recorder: Arc<dyn Recorder>) -> Self
Sourcepub fn child(&self, step: impl Into<String>) -> Self
pub fn child(&self, step: impl Into<String>) -> Self
Derive a context for one composite child step (Router child, MoA reference, or aggregator). The allocator stays shared with the parent so attempt numbers are unique across the whole call, while the current attempt and exchange counter are local to the child. An interleaved sibling cannot relabel an exchange that belongs to an in-flight attempt.
Sourcepub fn step(&self) -> Option<String>
pub fn step(&self) -> Option<String>
The composite step label for exchanges recorded through this context.
Sourcepub fn start_attempt(&self) -> u32
pub fn start_attempt(&self) -> u32
Begin the next Core operation attempt and reset its exchange counter.
Sourcepub fn next_exchange(&self) -> (u32, u32)
pub fn next_exchange(&self) -> (u32, u32)
Allocate the next exchange identity for the current attempt. Direct provider-SPI calls that bypass Core are recorded as attempt 1.
Trait Implementations§
Source§impl Clone for RecordingContext
impl Clone for RecordingContext
Auto Trait Implementations§
impl !RefUnwindSafe for RecordingContext
impl !UnwindSafe for RecordingContext
impl Freeze for RecordingContext
impl Send for RecordingContext
impl Sync for RecordingContext
impl Unpin for RecordingContext
impl UnsafeUnpin for RecordingContext
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more