pub struct ContextTable { /* private fields */ }Expand description
The bounded table of registered decisions.
Implementations§
Source§impl ContextTable
impl ContextTable
pub fn new(max: usize, ttl_ms: u64) -> Self
Sourcepub fn insert(
&mut self,
decision_id: &str,
trace_id: [u8; 16],
root_span_id: [u8; 8],
parent: Option<TraceParent>,
tracestate: Option<String>,
anchor_unix_nanos: u64,
now_ms: u64,
) -> bool
pub fn insert( &mut self, decision_id: &str, trace_id: [u8; 16], root_span_id: [u8; 8], parent: Option<TraceParent>, tracestate: Option<String>, anchor_unix_nanos: u64, now_ms: u64, ) -> bool
Register; false when the table is full.
pub fn take(&mut self, decision_id: &str) -> Option<Context>
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ContextTable
impl RefUnwindSafe for ContextTable
impl Send for ContextTable
impl Sync for ContextTable
impl Unpin for ContextTable
impl UnsafeUnpin for ContextTable
impl UnwindSafe for ContextTable
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