Skip to content

Commit

Permalink
ref: Rename Future exports and document features (#233)
Browse files Browse the repository at this point in the history
  • Loading branch information
Swatinem authored Jul 3, 2020
1 parent 301fcb7 commit 36218ea
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 4 deletions.
6 changes: 3 additions & 3 deletions sentry-core/src/futures.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ where
}

/// Future extensions for Sentry.
pub trait FutureExt: Sized {
pub trait SentryFutureExt: Sized {
/// Binds a hub to the execution of this future.
///
/// This ensures that the future is polled within the given hub.
Expand All @@ -63,12 +63,12 @@ pub trait FutureExt: Sized {
}
}

impl<F> FutureExt for F where F: Future {}
impl<F> SentryFutureExt for F where F: Future {}

#[cfg(all(test, feature = "test"))]
mod tests {
use crate::test::with_captured_events;
use crate::{capture_message, configure_scope, FutureExt, Hub, Level};
use crate::{capture_message, configure_scope, Hub, Level, SentryFutureExt};
use tokio::runtime::Runtime;

#[test]
Expand Down
8 changes: 7 additions & 1 deletion sentry-core/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -73,13 +73,19 @@ pub use crate::api::*;
pub use crate::breadcrumbs::IntoBreadcrumbs;
pub use crate::clientoptions::ClientOptions;
pub use crate::error::{capture_error, event_from_error, parse_type_from_debug};
pub use crate::futures::{FutureExt, SentryFuture as Future};
pub use crate::futures::{SentryFuture, SentryFutureExt};
pub use crate::hub::Hub;
pub use crate::integration::Integration;
pub use crate::intodsn::IntoDsn;
pub use crate::scope::{Scope, ScopeGuard};
pub use crate::transport::{Transport, TransportFactory};

// deprecated exports
#[deprecated = "The export was renamed to `SentryFuture`"]
pub use crate::futures::SentryFuture as Future;
#[deprecated = "The export was renamed to `SentryFutureExt`"]
pub use crate::futures::SentryFutureExt as FutureExt;

// client feature
#[cfg(feature = "client")]
mod client;
Expand Down
1 change: 1 addition & 0 deletions sentry/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ anyhow = ["sentry-anyhow"]
debug-images = ["sentry-debug-images"]
error-chain = ["sentry-error-chain"]
log = ["sentry-log"]
env_logger = ["sentry-log", "sentry-log/env_logger"]
slog = ["sentry-slog"]
# other features
test = ["sentry-core/test"]
Expand Down
3 changes: 3 additions & 0 deletions sentry/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@
//! * `debug-images`: Attaches a list of loaded libraries to events (currently only supported on unix).
//! * `error-chain`: Enables support for the `error-chain` crate.
//! * `log`: Enables support for the `log` crate.
//! * `env_logger`: Enables support for the `log` crate with additional `env_logger` support.
//! * `slog`: Enables support for the `slog` crate.
//! * `test`: Enables testing support.
//! * `debug-logs`: Uses the `log` crate for internal logging.
Expand All @@ -74,6 +75,8 @@
//! * `native-tls`: Uses the `native-tls` crate, which is currently the default.
//! This only has an effect on the `reqwest` transport.
//! * `rustls`: Enables the `rustls` support of the `reqwest` transport.
//! Please note that `native-tls` is a default feature, and one needs to use
//! `default-features = false` to completely disable building `native-tls` dependencies.

#![warn(missing_docs)]

Expand Down

0 comments on commit 36218ea

Please sign in to comment.