1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
|
use crate::BucketTransferProtocol;
/// A placeholder implementation of the bucket transfer protocol.
///
/// This struct serves as a temporary or stub implementation of
/// [`BucketTransferProtocol`], intended for use in contexts where
/// actual data transfer is not required (e.g., testing, scaffolding,
/// or as a default before a real implementation is provided).
///
/// Calling any of the transfer methods on this implementation will
/// result in a panic with `unreachable!()`, signaling that the
/// placeholder should be replaced before use.
pub struct NoProtocol;
impl BucketTransferProtocol for NoProtocol {
type ExtraInfo = ();
fn upload_to_bucket(
&self,
_req: &super::UploadToBucketRequest<Self::ExtraInfo>,
) -> Result<(), super::BucketTransferProtocolError> {
unreachable!()
}
fn download_from_bucket(
&self,
_req: &super::DownloadFromBucketRequest<Self::ExtraInfo>,
) -> Result<(), super::BucketTransferProtocolError> {
unreachable!()
}
fn transfer_to_client(
&self,
_req: &super::TransferToClientRequest<Self::ExtraInfo>,
) -> Result<(), super::BucketTransferProtocolError> {
unreachable!()
}
fn receive_from_client(
&self,
_req: &super::ReceiveFromClientRequest<Self::ExtraInfo>,
) -> Result<(), super::BucketTransferProtocolError> {
unreachable!()
}
}
|