#[derive(Clone, Debug, PartialEq, Eq, Hash)]
pub(crate) struct PartitionKeyRangeId(String);
impl PartitionKeyRangeId {
pub fn as_str(&self) -> &str {
&self.0
}
}
impl std::fmt::Display for PartitionKeyRangeId {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
f.write_str(&self.0)
}
}
impl std::str::FromStr for PartitionKeyRangeId {
type Err = std::convert::Infallible;
fn from_str(s: &str) -> Result<Self, Self::Err> {
Ok(Self(s.to_owned()))
}
}
impl From<String> for PartitionKeyRangeId {
fn from(s: String) -> Self {
Self(s)
}
}
impl std::borrow::Borrow<str> for PartitionKeyRangeId {
fn borrow(&self) -> &str {
&self.0
}
}