|
|
|
@ -70,6 +70,10 @@ pub mod serialise
|
|
|
|
|
{
|
|
|
|
|
use super::*;
|
|
|
|
|
|
|
|
|
|
/// Serialise this object into base64 text
|
|
|
|
|
///
|
|
|
|
|
/// # TODO
|
|
|
|
|
/// Line wrapping
|
|
|
|
|
#[instrument(err, skip(value), fields(value_type=?std::any::type_name::<T>()))]
|
|
|
|
|
pub fn into_text<T: Serialize>(value: &T) -> Result<String, Error>
|
|
|
|
|
{
|
|
|
|
@ -108,6 +112,7 @@ pub mod serialise
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// Try to deserialise this object from text.
|
|
|
|
|
#[instrument(err, skip(string), fields(string = ?string.as_ref()))]
|
|
|
|
|
pub fn from_text<T: serde::de::DeserializeOwned>(string: impl AsRef<[u8]>) -> Result<T, Error>
|
|
|
|
|
{
|
|
|
|
|