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§
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.
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§
Auto Trait Implementations§
impl !Freeze for TestTransport
impl RefUnwindSafe for TestTransport
impl Send for TestTransport
impl Sync for TestTransport
impl Unpin for TestTransport
impl UnwindSafe for TestTransport
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