crypto_generic/
always_panic_impl.rs1#![allow(dead_code)]
9
10use std::io::Read;
11use std::io::Seek;
12use std::io::Write;
13
14use crate::CryptKey;
15
16pub struct CryptWriter<T: Write> {
18 _writer: T,
19}
20
21impl<T: Write> CryptWriter<T> {
22 pub fn new(_inner_writable: T, _chunk_size_bytes: usize) -> anyhow::Result<Box<Self>> {
24 panic!("no crypto support was compiled in this build");
25 }
26
27 pub fn new_from_key(
30 _inner_writable: T,
31 _chunk_size_bytes: usize,
32 _key: &CryptKey,
33 ) -> anyhow::Result<Box<Self>> {
34 panic!("no crypto support was compiled in this build");
35 }
36}
37
38impl<T: Write> Write for CryptWriter<T> {
39 fn write(&mut self, _buf: &[u8]) -> std::io::Result<usize> {
40 panic!("no crypto support was compiled in this build");
41 }
42
43 fn flush(&mut self) -> std::io::Result<()> {
44 panic!("no crypto support was compiled in this build");
45 }
46}
47
48pub struct CryptReader<T: Read + Seek> {
50 _reader: T,
51}
52
53impl<T> CryptReader<T>
54where
55 T: Read + Seek,
56{
57 pub fn extract_key(_inner_readable: T) -> anyhow::Result<CryptKey> {
60 panic!("no crypto support was compiled in this build");
61 }
62
63 pub fn from_file_and_key(_inner_readable: T, _key: &CryptKey) -> anyhow::Result<Box<Self>> {
65 panic!("no crypto support was compiled in this build");
66 }
67}
68
69impl<T> Read for CryptReader<T>
70where
71 T: Read + Seek,
72{
73 fn read(&mut self, _buf: &mut [u8]) -> std::io::Result<usize> {
74 panic!("no crypto support was compiled in this build");
75 }
76}
77
78pub fn generate_random_key() -> CryptKey {
80 panic!("no crypto support was compiled in this build");
81}