implement display for copy behavior

This commit is contained in:
albertlockett
2024-04-02 15:16:22 -04:00
parent f6bd785398
commit ada28d3f81

View File

@@ -58,7 +58,10 @@ impl MirroringObjectStore {
impl std::fmt::Display for MirroringObjectStore {
fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
writeln!(f, "MirroringObjectStore")?;
write!(f, "MirroringObjectStore(secondary_copy_behavior=")?;
self.secondary_copy_behavior.fmt(f)?;
writeln!(f, ")")?;
writeln!(f, "primary:")?;
self.primary.fmt(f)?;
writeln!(f, "secondary:")?;
@@ -94,6 +97,17 @@ impl Default for MirroringSecondaryCopy {
}
}
impl std::fmt::Display for MirroringSecondaryCopy {
fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
match self {
Self::Copy => write!(f, "Copy"),
Self::SkipIfNotFound => write!(f, "SkipIfNotFound"),
}?;
Ok(())
}
}
/// An object store that mirrors write to secondary object store first
/// and than commit to primary object store.
///