Implement Label for some more wire-types.
Implement `Label` for a few more wire-types and for borrowed versions.
This will allow us to generically refer to `Label` during usage.
@@ -433,6 +433,12 @@ impl Label for Host {
}
}
+impl Label for &Host {
+ fn label(&self) -> &str {
+ &self.label
+ }
+}
+
impl EndpointName for Host {
fn endpoint_name() -> &'static str {
"host"
@@ -771,6 +777,12 @@ impl<T> Label for Target<T> {
}
}
+impl<T> Label for &Target<T> {
+ fn label(&self) -> &str {
+ &self.label
+ }
+}
+
impl<T> EndpointName for Target<T> {
fn endpoint_name() -> &'static str {
"target"
@@ -844,6 +856,12 @@ impl Label for Filesystem {
}
}
+impl Label for &Filesystem {
+ fn label(&self) -> &str {
+ &self.label
+ }
+}
+
impl EndpointName for Filesystem {
fn endpoint_name() -> &'static str {
"filesystem"
@@ -959,7 +977,7 @@ impl EndpointName for StratagemConfiguration {
}
pub mod db {
- use crate::Fqdn;
+ use crate::{Fqdn, Label};
use std::{collections::BTreeSet, fmt, ops::Deref, path::PathBuf};
#[cfg(feature = "postgres-interop")]
@@ -1098,6 +1116,18 @@ pub mod db {
}
}
+ impl Label for VolumeNodeRecord {
+ fn label(&self) -> &str {
+ &self.path
+ }
+ }
+
+ impl Label for &VolumeNodeRecord {
+ fn label(&self) -> &str {
+ &self.path
+ }
+ }
+
pub const VOLUME_NODE_TABLE_NAME: TableName = TableName("chroma_core_volumenode");
impl Name for VolumeNodeRecord {
@@ -1257,6 +1287,18 @@ pub mod db {
}
}
+ impl Label for OstPoolRecord {
+ fn label(&self) -> &str {
+ &self.name
+ }
+ }
+
+ impl Label for &OstPoolRecord {
+ fn label(&self) -> &str {
+ &self.name
+ }
+ }
+
/// Record from the `chroma_core_ostpool_osts` table
#[derive(serde::Deserialize, serde::Serialize, Debug, Clone)]
pub struct OstPoolOstsRecord {
