View aha.rs
pub fn add_scope_processor<F, B>(&mut self, f: F)
where
F: Fn(&mut Event) + Sync + Send,
Box<F>: im::shared::Shared<Box<Fn(&mut Event) + Sync + Send>>,
{
self.scope_processors = self.scope_processors.push_back(Box::new(f));
}
View hmm.rs
pub fn add_scope_processor<F>(&mut self, f: Box<F>)
where
F: Fn(&mut Event) + Sync + Send + ?Sized,
Box<F>: im::shared::Shared<Box<Fn(&mut Event) + Sync + Send>>,
{
self.scope_processors = self.scope_processors.push_back(f);
}
View gist:08420503db1b40aef2611ff447013b38
#[derive(Clone)]
pub struct Scope {
pub(crate) fingerprint: Option<Arc<Vec<Cow<'static, str>>>>,
pub(crate) transaction: Option<Arc<String>>,
pub(crate) breadcrumbs: im::Vector<Breadcrumb>,
pub(crate) user: Option<Arc<User>>,
pub(crate) extra: im::HashMap<String, Value>,
pub(crate) tags: im::HashMap<String, String>,
pub(crate) contexts: im::HashMap<String, Option<Context>>,
pub(crate) scope_processors: im::Vector<Box<FnMut(&mut Event) + Sync + Send>>,
View broken.rs
use std::fmt::Debug;
trait Foo: Debug + 'static {
// either remove this method
fn debug(&self) -> String where Self: Sized {
format!("{:?}", self)
}
}
impl Foo {
View asfail.rs
/// Helper trait to downcast a response error into a fail.
pub trait ResponseErrorAsFail {
/// Returns the response error as fail.
fn as_fail(&self) -> &Fail;
/// Returns the response error as mut fail.
fn as_mut_fail(&mut self) -> &mut Fail;
}
#[doc(hidden)]
impl<T: ResponseError> ResponseErrorAsFail for T {
View gist:241d44daa818c3417448805bc70e8bee
sentry-cli-Darwin-x86_64`thread_local::thread_id::get::hc2a84d0e0859fd2f:
-> 0x1005d384b <+123>: movdqa (%rax), %xmm0
0x1005d384f <+127>: movq $0x1, (%rax)
0x1005d3856 <+134>: movq %rcx, 0x8(%rax)
0x1005d385a <+138>: movdqa %xmm0, -0x20(%rbp)
Target 0: (sentry-cli-Darwin-x86_64) stopped.
(lldb) bt
* thread #2, stop reason = EXC_BAD_ACCESS (code=EXC_I386_GPFLT)
* frame #0: 0x00000001005d384b sentry-cli-Darwin-x86_64`thread_local::thread_id::get::hc2a84d0e0859fd2f + 123
frame #1: 0x00000001005763d6 sentry-cli-Darwin-x86_64`regex::re_unicode::Regex::captures::hd2ce31a6cd7fdbc7 + 70
View ugly.rs
use std::mem;
use std::ptr;
use std::sync::Arc;
use std::collections::HashMap;
fn main() {
let mut hm = HashMap::new();
let key = (Arc::new("1".to_string()), Arc::new("2".to_string()));
let data = vec![key.0.clone(), key.1.clone()];
View sentrystuff.rs
use std::panic;
extern crate sentry;
extern crate log;
pub struct Logger;
impl log::Log for Logger {
fn enabled(&self, metadata: &log::Metadata) -> bool {
metadata.level() <= log::max_level()
View domains.js
let domain = require('domain');
let fallbackCrumbs = [];
function getCrumbs() {
if (domain.active) {
let rv = domain.active.crumbs = domain.active.crumbs || [];
return rv;
}
return fallbackCrumbs;
View bufferingbreaks.rs
#[macro_use] extern crate serde_derive;
extern crate serde_json;
use std::collections::HashMap;
#[derive(Debug, PartialEq, Serialize, Deserialize)]
#[serde(tag = "type")]
enum X {
Hash { x: HashMap<u32, u32> },
}