1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
//! The noop fallback client for shim only users.
use uuid::Uuid;

use api::Dsn;
use api::protocol::Event;
use scope::noop::Scope;

/// The "shim only" Sentry client.
///
/// In shim mode the client cannot be constructed and none of the functions can be
/// called.  This is generally irrelevant as there is no way to actually get access
/// to such a client.  However as a result of that not all functions are exposed in
/// that situation.  For instance it's not possible to access the options of the
/// client, but it is possible to access the DSN.
#[derive(Clone)]
pub struct Client;

impl Client {
    /// Returns the DSN that constructed this client.
    ///
    /// Code that works with the shim is permitted to access the DSN to do some operations
    /// on it.
    pub fn dsn(&self) -> &Dsn {
        shim_unreachable!()
    }

    /// Captures an event and sends it to Sentry.
    ///
    /// It is always permissible to send events to sentry from shim user only mode.
    pub fn capture_event(&self, event: Event<'static>, scope: Option<&Scope>) -> Uuid {
        let _event = event;
        let _scope = scope;
        shim_unreachable!()
    }
}