Struct sentry_core::test::TestTransport
source · [−]pub struct TestTransport { /* private fields */ }
Expand description
Collects events instead of sending them.
Examples
use sentry::test::TestTransport;
use sentry::{ClientOptions, Hub};
use std::sync::Arc;
let transport = TestTransport::new();
let options = ClientOptions {
dsn: Some("https://public@example.com/1".parse().unwrap()),
transport: Some(Arc::new(transport.clone())),
..ClientOptions::default()
};
Hub::current().bind_client(Some(Arc::new(options.into())));
Implementations
sourceimpl 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.
sourcepub fn fetch_and_clear_envelopes(&self) -> Vec<Envelope>
pub fn fetch_and_clear_envelopes(&self) -> Vec<Envelope>
Fetches and clears the contained envelopes.
Trait Implementations
sourceimpl Transport for TestTransport
impl Transport for TestTransport
Auto Trait Implementations
impl RefUnwindSafe for TestTransport
impl Send for TestTransport
impl Sync for TestTransport
impl Unpin for TestTransport
impl UnwindSafe for TestTransport
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more