Struct sentry_rs::models::SentryCredentials
[−]
[src]
pub struct SentryCredentials { pub scheme: String, pub key: String, pub secret: String, pub host: Option<String>, pub project_id: String, }
Some Sentry Credentials. Which although not immediatly obvious are super easy to get. Firsrt things first, go fetch your Client Keys (DSN) like you normally would for a project. Should look something like:
https://XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX:YYYYYYYYYYYYYYYYYYYYYYYYYYYYYYY@ZZZZ/AAA
The "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" value is your "key". The "YYYYYYYYYYYYYYYYYYYYYYYYYYYYYYY" value is your "secret". The "ZZZZ" value is your "host". The "AAA" value is your "project_id".
Examples
extern crate sentry_rs; use sentry_rs::models::SentryCredentials; use std::env; fn main() { let credentials = SentryCredentials { scheme: env::var("SENTRY_SCHEME").unwrap_or("https".to_owned()), key: env::var("SENTRY_KEY").unwrap_or("XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX".to_owned()), secret: env::var("SENTRY_SECRET").unwrap_or("YYYYYYYYYYYYYYYYYYYYYYYYYYYYYYY".to_owned()), host: Some(env::var("SENTRY_HOST").unwrap_or("sentry.io".to_owned())), project_id: env::var("SENTRY_PROJECT_ID").unwrap_or("XX".to_owned()), }; }
You can also parse sentry credentials from a String:
extern crate sentry_rs; use sentry_rs::models::*; fn main() { let sentry_creds: SentryCredentials = "https://XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX:YYYYYYYYYYYYYYYYYYYYYYYYYYYYYYY@ZZZZ/AAA" .to_owned() .parse::<SentryCredentials>().unwrap(); }
Fields
scheme: String
key: String
secret: String
host: Option<String>
project_id: String
Trait Implementations
impl Clone for SentryCredentials
[src]
fn clone(&self) -> SentryCredentials
[src]
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl Debug for SentryCredentials
[src]
impl Eq for SentryCredentials
[src]
impl PartialEq for SentryCredentials
[src]
fn eq(&self, __arg_0: &SentryCredentials) -> bool
[src]
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &SentryCredentials) -> bool
[src]
This method tests for !=
.
impl FromStr for SentryCredentials
[src]
type Err = CredentialsParseError
The associated error which can be returned from parsing.
fn from_str(to_parse: &str) -> Result<SentryCredentials, CredentialsParseError>
[src]
Parses a string s
to return a value of this type. Read more