Skip to main content

ckb_sentry_types/
lib.rs

1//! This crate provides common types for working with the Sentry protocol or the
2//! Sentry server.  It's used by the Sentry Relay infrastructure as well as the
3//! rust Sentry client.
4//!
5//! Most of the types in this crate are serializable in one form or another.
6//! The types in the `protocol` module are generally really only serializable
7//! to JSON as other formats are not supported by Sentry at this date.
8//!
9//! ## Contents
10//!
11//! The crate provides a bunch of common types for working with Sentry as
12//! such (DSN, ProjectIDs, authentication headers) as well as types for
13//! the Sentry event protocol.
14//!
15//! Right now only `v7` of the protocol is implemented but it's versioned
16//! so later versions might be added later.
17//!
18//! ## API Concepts
19//!
20//! Most types are directly serializable or deserializable and try to implement
21//! the `Default` type.  This means that objects can be created conviently
22//! and missing attributes can be filled in:
23//!
24//! ```rust
25//! use ckb_sentry_types as sentry_types;
26//!
27//! use sentry_types::protocol::v7;
28//!
29//! let event = v7::Event {
30//!     message: Some("Hello World!".to_string()),
31//!     culprit: Some("foo in bar".to_string()),
32//!     level: v7::Level::Info,
33//!     ..Default::default()
34//! };
35//! ```
36
37#![doc(html_favicon_url = "https://sentry-brand.storage.googleapis.com/favicon.ico")]
38#![doc(html_logo_url = "https://sentry-brand.storage.googleapis.com/sentry-glyph-black.png")]
39#![warn(missing_docs)]
40
41#[macro_use]
42mod macros;
43
44mod auth;
45mod dsn;
46mod project_id;
47pub mod protocol;
48mod utils;
49
50pub use crate::auth::*;
51pub use crate::dsn::*;
52pub use crate::project_id::*;
53
54// Re-export external types and traits for convenience
55pub use chrono::{DateTime, ParseError as ChronoParseError, TimeZone, Utc};
56pub use debugid::*;
57pub use uuid::{Uuid, Variant as UuidVariant, Version as UuidVersion};