Struct honeybadger::Honeybadger[][src]

pub struct Honeybadger { /* fields omitted */ }

Instance containing the client connection and user configuration for this crate.

Methods

impl Honeybadger
[src]

Constructs a Honeybadger instance, which may be used to send API notify requests.

Arguments

  • config - Config instance, which is built using the ConfigBuilder

Example

let config = ConfigBuilder::new(api_token).build();
 
assert_eq!(true, Honeybadger::new(config).is_ok());

Prepare a payload for the notify request.

Requires the use of the error_chain crate.

Arguments

Example

error_chain! {
  errors {
    MyCustomError
  }
}
 
let error : Result<()> = Err(ErrorKind::MyCustomError.into());
honeybadger.create_payload(&error.unwrap_err(), None);

Trigger the notify request using an async HTTPS request.

Requires an initialized Tokio Runtime, and returns a Future that must be resolved using the Tokio framework orchestration methods.

Arguments

  • request - Request instance constructed with create_payload

Example

let mut rt = current_thread::Runtime::new().unwrap();
let payload = honeybadger.create_payload(&error.unwrap_err(), None).unwrap();
let future = honeybadger.notify(payload);

// note: blocks the current thread!
rt.block_on(future);

Auto Trait Implementations

impl Send for Honeybadger

impl Sync for Honeybadger