pub struct Context {
pub request_id: RequestId,
pub trace_id: Option<TraceId>,
pub parent_span_id: Option<String>,
pub agent_id: Option<AgentId>,
pub session_id: Option<SessionId>,
pub started_at: Timestamp,
pub deadline: Option<Timestamp>,
/* private fields */
}Fields§
§request_id: RequestId§trace_id: Option<TraceId>§parent_span_id: Option<String>§agent_id: Option<AgentId>§session_id: Option<SessionId>§started_at: Timestamp§deadline: Option<Timestamp>Implementations§
Source§impl Context
impl Context
pub fn new() -> Self
pub fn with_timeout(self, timeout: Duration) -> Self
pub fn with_deadline(self, deadline: Timestamp) -> Self
pub fn with_trace_id(self, trace_id: impl Into<String>) -> Self
pub fn with_agent(self, agent_id: AgentId) -> Self
pub fn with_session(self, session_id: SessionId) -> Self
pub fn with_cancellation(self, token: CancellationToken) -> Self
pub fn child(&self) -> Self
pub fn is_cancelled(&self) -> bool
pub fn cancel(&self)
pub fn cancellation_token(&self) -> CancellationToken
pub fn is_timeout(&self) -> bool
pub fn is_done(&self) -> bool
pub fn remaining(&self) -> Option<Duration>
pub fn elapsed(&self) -> Duration
pub fn get_extension(&self, key: &str) -> Option<&String>
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Context
impl RefUnwindSafe for Context
impl Send for Context
impl Sync for Context
impl Unpin for Context
impl UnwindSafe for Context
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