cargolifter_core/models/
storage.rs1#[derive(Debug)]
2pub enum StorageError {
3 DetailMeLater,
4}
5
6impl std::error::Error for StorageError {}
7
8impl std::fmt::Display for StorageError {
9 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
10 write!(f, "Storage error occured")
11 }
12}
13
14impl std::convert::From<std::io::Error> for StorageError {
15 fn from(_: std::io::Error) -> Self {
16 StorageError::DetailMeLater
17 }
18}
19
20pub struct StorageGetRequest {
21 pub crate_name: String,
22 pub crate_version: String,
23 pub result_sender: tokio::sync::oneshot::Sender<Option<Vec<u8>>>,
24}
25
26pub struct StoragePutRequest {
27 pub crate_name: String,
28 pub crate_version: String,
29 pub data: Vec<u8>,
30 pub result_sender: tokio::sync::oneshot::Sender<bool>,
31}