cts-common 0.34.1-alpha.1

Common types and traits used across the CipherStash ecosystem
Documentation
#[cfg(feature = "test_utils")]
use fake::Fake;
use serde::{Deserialize, Serialize};

#[derive(Clone, Debug, Serialize, Deserialize, PartialEq)]
pub struct Org {
    pub id: String,
}

impl Org {
    pub fn id(&self) -> &str {
        &self.id
    }
}

#[cfg(feature = "test_utils")]
impl<T> fake::Dummy<T> for Org {
    fn dummy_with_rng<R: rand::Rng + ?Sized>(_: &T, _rng: &mut R) -> Self {
        Self {
            id: fake::Faker.fake(),
        }
    }
}