use std::fmt;
use crate::S3Uri;
impl PartialEq<str> for S3Uri {
fn eq(&self, other: &str) -> bool {
self.to_string().eq(other)
}
fn ne(&self, other: &str) -> bool {
!self.eq(other)
}
}
impl PartialEq<&str> for S3Uri {
fn eq(&self, other: &&str) -> bool {
self.to_string().eq(other)
}
fn ne(&self, other: &&str) -> bool {
!self.eq(other)
}
}
impl fmt::Display for S3Uri {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "s3://{}/{}", self.bucket, self.key)
}
}
impl S3Uri {
pub fn join(&self, part: &str) -> S3Uri {
S3Uri {
bucket: self.bucket.clone(),
key: self.key.join(part),
}
}
}