#![doc(html_root_url = "https://docs.rs/stripe-rust/")]
#![recursion_limit = "128"]
#![allow(clippy::needless_pass_by_value)]
#![allow(clippy::large_enum_variant)]
#[cfg(not(feature = "async"))]
mod client;
mod error;
mod ids;
mod params;
mod resources;
#[cfg(feature = "async")]
pub mod r#async;
#[cfg(not(feature = "async"))]
pub use crate::client::Client;
pub use crate::error::{Error, ErrorCode, ErrorType, RequestError, WebhookError};
pub use crate::ids::*;
pub use crate::params::{
Expandable, Headers, List, Metadata, Object, RangeBounds, RangeQuery, Timestamp,
};
pub use crate::resources::*;
#[cfg(not(feature = "async"))]
mod config {
use crate::error::Error;
pub type Response<T> = Result<T, Error>;
pub(crate) type Client = crate::client::Client;
#[inline]
pub fn ok<T>(ok: T) -> Response<T> {
Ok(ok)
}
#[inline]
pub fn err<T>(err: Error) -> Response<T> {
Err(err)
}
}
#[cfg(feature = "async")]
mod config {
use crate::error::Error;
use futures::future::{self, Future};
pub type Response<T> = Box<dyn Future<Item = T, Error = Error> + Send>;
pub(crate) type Client = crate::r#async::Client;
#[inline]
pub(crate) fn ok<T: Send + 'static>(ok: T) -> Response<T> {
Box::new(future::ok(ok))
}
#[inline]
pub(crate) fn err<T: Send + 'static>(err: Error) -> Response<T> {
Box::new(future::err(err))
}
}
pub use self::config::Response;