make methods pub (#1843)

This commit is contained in:
Michael Freeborn 2022-06-01 00:57:46 +01:00 committed by GitHub
parent d5f7e4288d
commit a110e75b95
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -50,18 +50,18 @@ impl<'r> PgValueRef<'r> {
}
}
pub(crate) fn format(&self) -> PgValueFormat {
pub fn format(&self) -> PgValueFormat {
self.format
}
pub(crate) fn as_bytes(&self) -> Result<&'r [u8], BoxDynError> {
pub fn as_bytes(&self) -> Result<&'r [u8], BoxDynError> {
match &self.value {
Some(v) => Ok(v),
None => Err(UnexpectedNullError.into()),
}
}
pub(crate) fn as_str(&self) -> Result<&'r str, BoxDynError> {
pub fn as_str(&self) -> Result<&'r str, BoxDynError> {
Ok(from_utf8(self.as_bytes()?)?)
}
}