pub struct CapturingExporter {
pub spans: Mutex<Vec<SpanData>>,
}Expand description
Captures spans in memory instead of exporting them. Use in unit tests.
use rust_web_server::otel::{CapturingExporter, SpanData};
use std::sync::{Arc, Mutex};
let captured: Arc<Mutex<Vec<SpanData>>> = Arc::new(Mutex::new(Vec::new()));
// (CapturingExporter is constructed internally by the test helpers)Fields§
§spans: Mutex<Vec<SpanData>>Implementations§
Trait Implementations§
Source§impl Default for CapturingExporter
impl Default for CapturingExporter
Auto Trait Implementations§
impl !Freeze for CapturingExporter
impl RefUnwindSafe for CapturingExporter
impl Send for CapturingExporter
impl Sync for CapturingExporter
impl Unpin for CapturingExporter
impl UnsafeUnpin for CapturingExporter
impl UnwindSafe for CapturingExporter
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