#![deny(missing_docs)]
#![deny(clippy::all)]
#[cfg(all(feature = "runtime-async-std", feature = "runtime-tokio"))]
compile_error!(
"Features `runtime-async-std` and `runtime-tokio` are mutually exclusive. Please enable only one."
);
#[cfg(not(any(feature = "runtime-async-std", feature = "runtime-tokio")))]
compile_error!("Either `runtime-async-std` or `runtime-tokio` feature must be enabled.");
use std::io::Error;
pub use crate::{
archive::{Archive, ArchiveBuilder, Entries},
builder::Builder,
entry::{Entry, Unpacked},
entry_type::EntryType,
header::{
GnuExtSparseHeader, GnuHeader, GnuSparseHeader, Header, HeaderMode, OldHeader, UstarHeader,
},
pax::{PaxExtension, PaxExtensions},
};
mod archive;
mod builder;
mod entry;
mod entry_type;
mod error;
mod header;
mod pax;
#[cfg(test)]
#[macro_use]
extern crate static_assertions;
fn other(msg: &str) -> Error {
Error::other(msg)
}
#[cfg(feature = "runtime-async-std")]
pub(crate) async fn fs_canonicalize(
path: &async_std::path::Path,
) -> async_std::io::Result<async_std::path::PathBuf> {
path.canonicalize().await
}
#[cfg(feature = "runtime-tokio")]
pub(crate) async fn fs_canonicalize(
path: &std::path::Path,
) -> tokio::io::Result<std::path::PathBuf> {
tokio::fs::canonicalize(path).await
}
#[cfg(feature = "runtime-async-std")]
async fn symlink_metadata(
p: &async_std::path::Path,
) -> async_std::io::Result<async_std::fs::Metadata> {
p.symlink_metadata().await
}
#[cfg(feature = "runtime-tokio")]
async fn symlink_metadata(p: &std::path::Path) -> tokio::io::Result<std::fs::Metadata> {
tokio::fs::symlink_metadata(p).await
}
#[cfg(feature = "runtime-async-std")]
async fn metadata(p: &async_std::path::Path) -> async_std::io::Result<async_std::fs::Metadata> {
p.metadata().await
}
#[cfg(feature = "runtime-tokio")]
async fn metadata(p: &std::path::Path) -> tokio::io::Result<std::fs::Metadata> {
tokio::fs::metadata(p).await
}