pub struct SopsFile {
pub content: Map<String, Value>,
/* private fields */
}Fields§
§content: Map<String, Value>Implementations§
Source§impl SopsFile
impl SopsFile
Sourcepub async fn get_ciphers(&self) -> Vec<SopsAES> ⓘ
pub async fn get_ciphers(&self) -> Vec<SopsAES> ⓘ
Examples found in repository?
examples/dada.rs (line 10)
6async fn main() {
7 let dada: SopsFile =
8 serde_json::from_str(DADA_AKV).expect("deserializing a SOPS encoded file failed");
9
10 let ciphers = dada.get_ciphers().await;
11
12 let bsd: HashMap<String, String> = dada
13 .content
14 .keys()
15 .into_iter()
16 .map(|key| (key.clone(), dada.get_content(key).decrypt(&ciphers)))
17 .collect();
18
19 println!("{:#?}", bsd);
20}Sourcepub fn get_content(&self, key: &str) -> EncryptedContent
pub fn get_content(&self, key: &str) -> EncryptedContent
Examples found in repository?
examples/dada.rs (line 16)
6async fn main() {
7 let dada: SopsFile =
8 serde_json::from_str(DADA_AKV).expect("deserializing a SOPS encoded file failed");
9
10 let ciphers = dada.get_ciphers().await;
11
12 let bsd: HashMap<String, String> = dada
13 .content
14 .keys()
15 .into_iter()
16 .map(|key| (key.clone(), dada.get_content(key).decrypt(&ciphers)))
17 .collect();
18
19 println!("{:#?}", bsd);
20}Trait Implementations§
Source§impl<'de> Deserialize<'de> for SopsFile
impl<'de> Deserialize<'de> for SopsFile
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for SopsFile
impl RefUnwindSafe for SopsFile
impl Send for SopsFile
impl Sync for SopsFile
impl Unpin for SopsFile
impl UnwindSafe for SopsFile
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more