add as_str getter

This commit is contained in:
yggverse 2025-01-18 03:26:11 +02:00
parent 90bff09269
commit cac544043e

View file

@ -54,6 +54,13 @@ impl Data {
None => Err(Error::Protocol),
}
}
// Getters
/// Get `Self` as `std::str`
pub fn as_str(&self) -> &str {
self.0.as_str()
}
}
impl std::fmt::Display for Data {