1pub use mediatype;
2pub use ppo::Error;
3pub use ppo::PresignedPostData;
4
5mod ppo;
6
7pub fn error_chain_fmt(
8 e: &impl std::error::Error,
9 f: &mut std::fmt::Formatter<'_>,
10) -> std::fmt::Result {
11 writeln!(f, "{}\n", e)?;
12 let mut current = e.source();
13 while let Some(cause) = current {
14 writeln!(f, "Caused by:\n\t{}", cause)?;
15 current = cause.source();
16 }
17 Ok(())
18}
19
20#[macro_export]
21macro_rules! impl_debug {
22 ($type:ident) => {
23 use crate::error_chain_fmt;
24 impl std::fmt::Debug for $type {
25 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
26 error_chain_fmt(self, f)
27 }
28 }
29 };
30}