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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
// MinIO Rust Library for Amazon S3 Compatible Cloud Storage
// Copyright 2022 MinIO, Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//! Core traits for S3 request and response handling.
use S3Request;
use crate;
use async_trait;
use Stream;
/// Trait for converting a request builder into a concrete S3 HTTP request.
///
/// This trait is implemented by all S3 request builders and serves as an
/// intermediate step in the request execution pipeline. It enables the
/// conversion from a strongly typed request builder into a generic
/// [`S3Request`] that can be executed over HTTP.
///
/// The [`S3Api::send`] method uses this trait to convert request builders
/// into executable HTTP requests before sending them to the S3-compatible
/// service.
///
/// # See Also
///
/// * [`S3Api`] - The trait that uses `ToS3Request` as part of its request execution pipeline
/// * [`FromS3Response`] - The counterpart trait for converting HTTP responses into typed responses
///
/// Trait for converting HTTP responses into strongly typed S3 response objects.
///
/// This trait is implemented by all S3 response types in the SDK and provides
/// a way to parse and validate raw HTTP responses from S3-compatible services.
/// It works as the final step in the request execution pipeline, transforming
/// the HTTP layer response into a domain-specific response object with proper
/// typing and field validation.
///
/// # See Also
///
/// * [`S3Api`] - The trait that uses `FromS3Response` as part of its request execution pipeline
/// * [`ToS3Request`] - The counterpart trait for converting request builders into HTTP requests
/// Trait that defines a common interface for all S3 API request builders.
///
/// This trait is implemented by all request builders in the SDK and provides
/// a consistent way to send requests and get typed responses. It works in
/// conjunction with [`ToS3Request`] to convert the builder into a concrete
/// HTTP request and with [`FromS3Response`] to convert the HTTP response back
/// into a strongly typed S3 response object.
///
/// # Type Parameters
///
/// * `S3Response` - The specific response type associated with this request builder.
/// Must implement the [`FromS3Response`] trait.
///
/// Trait for types that can be converted to a stream of items.