mod pull;
mod push;
use std::path::PathBuf;
pub use pull::*;
pub use push::*;
pub mod annotations;
pub mod media_types;
#[derive(Debug, Clone)]
pub struct PackageFile {
package_path: PathBuf,
hash: String,
media_type: String,
contents: bytes::Bytes,
}
impl PackageFile {
pub fn new(package_path: PathBuf, hash: String, media_type: String, contents: bytes::Bytes) -> Self {
Self {
package_path,
hash,
media_type,
contents,
}
}
#[must_use]
pub const fn package_path(&self) -> &PathBuf {
&self.package_path
}
#[must_use]
pub fn hash(&self) -> &str {
&self.hash
}
#[must_use]
pub fn media_type(&self) -> &str {
&self.media_type
}
#[must_use]
pub fn contents(&self) -> &[u8] {
&self.contents
}
#[must_use]
#[allow(clippy::missing_const_for_fn)]
pub fn into_contents(self) -> bytes::Bytes {
self.contents
}
}