convex 0.10.4

Client library for Convex (convex.dev)
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
/// Helper functions for encoding `Bytes`s as `String`s.
pub enum JsonBytes {}

impl JsonBytes {
    /// Encode a binary string as a string.
    pub fn encode(bytes: &Vec<u8>) -> String {
        base64::encode(&bytes[..])
    }

    /// Decode a binary string from a string.
    pub fn decode(s: String) -> anyhow::Result<Vec<u8>> {
        Ok(base64::decode(s.as_bytes())?)
    }
}