Skip to content

Commit 556f9cc

Browse files
committed
Changed the code to enable -require-explicit-sendable compiler flag.
1 parent d6ba1ea commit 556f9cc

File tree

1 file changed

+12
-9
lines changed

1 file changed

+12
-9
lines changed

Sources/GRPCCodeGen/CodeGenerationRequest.swift

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,9 @@ public struct CodeGenerationRequest {
8282
}
8383
}
8484

85+
@available(*, unavailable)
86+
extension CodeGenerationRequest: Sendable {}
87+
8588
@available(gRPCSwift 2.0, *)
8689
extension CodeGenerationRequest {
8790
@available(*, deprecated, renamed: "makeSerializerSnippet")
@@ -123,7 +126,7 @@ extension CodeGenerationRequest {
123126

124127
/// Represents an import: a module or a specific item from a module.
125128
@available(gRPCSwift 2.0, *)
126-
public struct Dependency: Equatable {
129+
public struct Dependency: Equatable, Sendable {
127130
/// If the dependency is an item, the property's value is the item representation.
128131
/// If the dependency is a module, this property is nil.
129132
public var item: Item?
@@ -158,7 +161,7 @@ public struct Dependency: Equatable {
158161
}
159162

160163
/// Represents an item imported from a module.
161-
public struct Item: Equatable {
164+
public struct Item: Equatable, Sendable {
162165
/// The keyword that specifies the item's kind (e.g. `func`, `struct`).
163166
public var kind: Kind
164167

@@ -171,7 +174,7 @@ public struct Dependency: Equatable {
171174
}
172175

173176
/// Represents the imported item's kind.
174-
public struct Kind: Equatable {
177+
public struct Kind: Equatable, Sendable {
175178
/// Describes the keyword associated with the imported item.
176179
internal enum Value: String {
177180
case `typealias`
@@ -233,7 +236,7 @@ public struct Dependency: Equatable {
233236
}
234237

235238
/// Describes any requirement for the `@preconcurrency` attribute.
236-
public struct PreconcurrencyRequirement: Equatable {
239+
public struct PreconcurrencyRequirement: Equatable, Sendable {
237240
internal enum Value: Equatable {
238241
case required
239242
case notRequired
@@ -265,7 +268,7 @@ public struct Dependency: Equatable {
265268

266269
/// Represents a service described in an IDL file.
267270
@available(gRPCSwift 2.0, *)
268-
public struct ServiceDescriptor: Hashable {
271+
public struct ServiceDescriptor: Hashable, Sendable {
269272
/// Documentation from comments above the IDL service description.
270273
/// It is already formatted, meaning it contains "///" and new lines.
271274
public var documentation: String
@@ -323,7 +326,7 @@ extension ServiceDescriptor {
323326

324327
/// Represents a method described in an IDL file.
325328
@available(gRPCSwift 2.0, *)
326-
public struct MethodDescriptor: Hashable {
329+
public struct MethodDescriptor: Hashable, Sendable {
327330
/// Documentation from comments above the IDL method description.
328331
/// It is already formatted, meaning it contains "///" and new lines.
329332
public var documentation: String
@@ -388,7 +391,7 @@ extension MethodDescriptor {
388391
}
389392

390393
@available(gRPCSwift 2.0, *)
391-
public struct ServiceName: Hashable {
394+
public struct ServiceName: Hashable, Sendable {
392395
/// The identifying name as used in the service/method descriptors including any namespace.
393396
///
394397
/// This value is also used to identify the service to the remote peer, usually as part of the
@@ -423,7 +426,7 @@ public struct ServiceName: Hashable {
423426
}
424427

425428
@available(gRPCSwift 2.0, *)
426-
public struct MethodName: Hashable {
429+
public struct MethodName: Hashable, Sendable {
427430
/// The identifying name as used in the service/method descriptors.
428431
///
429432
/// This value is also used to identify the method to the remote peer, usually as part of the
@@ -455,7 +458,7 @@ public struct MethodName: Hashable {
455458
/// Represents the name associated with a namespace, service or a method, in three different formats.
456459
@available(*, deprecated, message: "Use ServiceName/MethodName instead.")
457460
@available(gRPCSwift 2.0, *)
458-
public struct Name: Hashable {
461+
public struct Name: Hashable, Sendable {
459462
/// The base name is the name used for the namespace/service/method in the IDL file, so it should follow
460463
/// the specific casing of the IDL.
461464
///

0 commit comments

Comments
 (0)