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