@@ -26,7 +26,7 @@ public extension StorageReference {
26
26
/// the task will be cancelled and an error will be thrown.
27
27
/// - Throws: An error if the operation failed, for example if the data exceeded `maxSize`.
28
28
/// - Returns: Data object.
29
- func data( maxSize: Int64 ) async throws -> Data {
29
+ func data( maxSize: Int64 ) async throws -> sending Data {
30
30
return try await withCheckedThrowingContinuation { continuation in
31
31
_ = self . getData ( maxSize: maxSize) { result in
32
32
continuation. resume ( with: result)
@@ -48,7 +48,8 @@ public extension StorageReference {
48
48
/// - Returns: StorageMetadata with additional information about the object being uploaded.
49
49
func putDataAsync( _ uploadData: Data ,
50
50
metadata: StorageMetadata ? = nil ,
51
- onProgress: ( ( Progress ? ) -> Void ) ? = nil ) async throws -> StorageMetadata {
51
+ onProgress: ( ( Progress ? ) -> Void ) ? = nil ) async throws
52
+ -> sending StorageMetadata {
52
53
guard let onProgress = onProgress else {
53
54
return try await withCheckedThrowingContinuation { continuation in
54
55
self . putData ( uploadData, metadata: metadata) { result in
@@ -86,7 +87,8 @@ public extension StorageReference {
86
87
/// - Returns: `StorageMetadata` with additional information about the object being uploaded.
87
88
func putFileAsync( from url: URL ,
88
89
metadata: StorageMetadata ? = nil ,
89
- onProgress: ( ( Progress ? ) -> Void ) ? = nil ) async throws -> StorageMetadata {
90
+ onProgress: ( ( Progress ? ) -> Void ) ? = nil ) async throws
91
+ -> sending StorageMetadata {
90
92
guard let onProgress = onProgress else {
91
93
return try await withCheckedThrowingContinuation { continuation in
92
94
self . putFile ( from: url, metadata: metadata) { result in
@@ -121,7 +123,7 @@ public extension StorageReference {
121
123
/// or `fileURL` did not reference a valid path on disk.
122
124
/// - Returns: A `URL` pointing to the file path of the downloaded file.
123
125
func writeAsync( toFile fileURL: URL ,
124
- onProgress: ( ( Progress ? ) -> Void ) ? = nil ) async throws -> URL {
126
+ onProgress: ( ( Progress ? ) -> Void ) ? = nil ) async throws -> sending URL {
125
127
guard let onProgress = onProgress else {
126
128
return try await withCheckedThrowingContinuation { continuation in
127
129
_ = self . write ( toFile: fileURL) { result in
@@ -160,7 +162,7 @@ public extension StorageReference {
160
162
/// - Throws: An error if the operation failed, for example if Storage was unreachable
161
163
/// or the storage reference referenced an invalid path.
162
164
/// - Returns: A `StorageListResult` containing the contents of the storage reference.
163
- func list( maxResults: Int64 ) async throws -> StorageListResult {
165
+ func list( maxResults: Int64 ) async throws -> sending StorageListResult {
164
166
typealias ListContinuation = CheckedContinuation < StorageListResult , Error >
165
167
return try await withCheckedThrowingContinuation { ( continuation: ListContinuation ) in
166
168
self . list ( maxResults: maxResults) { result in
@@ -186,7 +188,7 @@ public extension StorageReference {
186
188
/// or the storage reference referenced an invalid path.
187
189
/// - Returns:
188
190
/// - completion A `Result` enum with either the list or an `Error`.
189
- func list( maxResults: Int64 , pageToken: String ) async throws -> StorageListResult {
191
+ func list( maxResults: Int64 , pageToken: String ) async throws -> sending StorageListResult {
190
192
typealias ListContinuation = CheckedContinuation < StorageListResult , Error >
191
193
return try await withCheckedThrowingContinuation { ( continuation: ListContinuation ) in
192
194
self . list ( maxResults: maxResults, pageToken: pageToken) { result in
0 commit comments