huskarl-core 0.7.1

Base library for huskarl (OAuth2 client) ecosystem.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use crate::{
    error::Error,
    secrets::{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, Error> {
        Ok(SecretBytes::new(bytes.to_vec()))
    }
}