Struct sentry::test::TestTransport
source · pub struct TestTransport { /* private fields */ }
Expand description
Collects events instead of sending them.
Example usage:
use std::sync::Arc;
use sentry::{Hub, ClientOptions};
use sentry::test::TestTransport;
let transport = TestTransport::new();
let options = ClientOptions {
dsn: Some("https://public@example.com/1".parse().unwrap()),
transport: Box::new(transport.clone()),
..ClientOptions::default()
};
Hub::current().bind_client(Some(Arc::new(options.into())));
Implementations§
source§impl TestTransport
impl TestTransport
sourcepub fn new() -> Arc<TestTransport>
pub fn new() -> Arc<TestTransport>
Creates a new test transport.
sourcepub fn fetch_and_clear_events(&self) -> Vec<Event<'static>> ⓘ
pub fn fetch_and_clear_events(&self) -> Vec<Event<'static>> ⓘ
Fetches and clears the contained events.