use std::fmt::Debug;
use mountpoint_s3_client::types::ETag;
use crate::sync::Arc;
#[derive(Clone, Hash, PartialEq, Eq)]
pub struct ObjectId {
inner: Arc<InnerObjectId>,
}
impl Debug for ObjectId {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
f.debug_struct("ObjectId")
.field("key", &self.inner.key)
.field("etag", &self.inner.etag)
.finish()
}
}
#[derive(Debug, Hash, PartialEq, Eq)]
struct InnerObjectId {
key: String,
etag: ETag,
}
impl ObjectId {
pub fn new(key: String, etag: ETag) -> Self {
Self {
inner: Arc::new(InnerObjectId { key, etag }),
}
}
pub fn key(&self) -> &str {
&self.inner.key
}
pub fn etag(&self) -> &ETag {
&self.inner.etag
}
}