huskarl-core 0.2.0

Base library for huskarl (OAuth2 client) ecosystem.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
use crate::secrets::{DecodingError, SecretBytes, SecretDecoder};

/// Uses raw bytes directly, returning `SecretBytes`.
///
/// No transformation is applied - bytes pass through as-is.
#[derive(Debug, Clone, Copy, Default)]
pub struct BinaryEncoding;

impl SecretDecoder for BinaryEncoding {
    type Output = SecretBytes;

    fn decode(&self, bytes: &[u8]) -> Result<Self::Output, DecodingError> {
        Ok(SecretBytes::new(bytes.to_vec()))
    }
}