lemon_bugsnag_rs 0.1.2

A library for interacting with the BugSnag error-reporting and sessions APIs.
Documentation
/// Trait to implement on client builders that provide asynchronous clients
///
/// This trait provides the non_blocking() interface for selecting which sort of
/// networking client to create and return to the caller.
/// See [Implementors](#implementors)
///
/// # Example
/// ```
/// use lemon_bugsnag_rs::common::traits::decider_trait_async::DeciderTraitAsync;
///
/// struct MySyncDecider {}
/// // A struct implementing BackendBuilderTrait. Impl not shown here.
/// struct MyAsyncBuilder {}
/// impl DeciderTraitAsync<MyAsyncBuilder> for MySyncDecider {
///   fn non_blocking(self) -> MyAsyncBuilder {
///     MyAsyncBuilder {}
///   }
/// }
/// ```
pub trait DeciderTraitAsync<A> {
    #[cfg_attr(docsrs, doc(cfg(feature = "async")))]
    #[cfg(feature = "async")]
    /// Returns A where A is an [asynchronous client](crate::common::traits::client_trait_async::ClientTraitAsync).
    /// See [ReqwestErrorDecider::non_blocking()](crate::error::reqwest::builder::decider::ReqwestErrorDecider::non_blocking()).
    ///
    /// # Examples
    /// ```
    /// // This example requires the session-client feature.
    ///
    /// // For network backends that support both blocking and non-blocking
    /// // requests, such as Reqwest.
    /// use lemon_bugsnag_rs::common::builder::client_builder::ClientBuilder;
    /// use lemon_bugsnag_rs::common::traits::{
    ///   decider_trait_async::DeciderTraitAsync,
    ///   backend_builder_trait_async::BackendBuilderTraitAsync
    /// };
    ///
    /// let mut cb = ClientBuilder::session();
    /// cb.configure(
    ///   "Fake API Key",
    ///   "NAB BugSnag library notifier",
    ///   "Version 2.0",
    ///   Some("development"),
    ///   Some("1.0.0")
    /// );
    ///
    /// // Get your non_blocking client using the Reqwest backend, like so:
    /// let client = cb.reqwest().non_blocking().build();
    /// ```
    fn non_blocking(self) -> A;
}