Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Sendable to more places that folks might want it. #1440

Merged
merged 1 commit into from
Aug 16, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Sources/SwiftProtobuf/BinaryDecodingOptions.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
// -----------------------------------------------------------------------------

/// Options for binary decoding.
public struct BinaryDecodingOptions {
public struct BinaryDecodingOptions: Sendable {
/// The maximum nesting of message with messages. The default is 100.
///
/// To prevent corrupt or malicious messages from causing stack overflows,
Expand Down
2 changes: 1 addition & 1 deletion Sources/SwiftProtobuf/ExtensionMap.swift
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
/// This is a protocol so that developers can build their own
/// extension handling if they need something more complex than the
/// standard `SimpleExtensionMap` implementation.
public protocol ExtensionMap {
public protocol ExtensionMap: Sendable {
/// Returns the extension object describing an extension or nil
subscript(messageType: Message.Type, fieldNumber: Int) -> AnyMessageExtension? { get }

Expand Down
2 changes: 1 addition & 1 deletion Sources/SwiftProtobuf/JSONDecodingOptions.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
// -----------------------------------------------------------------------------

/// Options for JSONDecoding.
public struct JSONDecodingOptions {
public struct JSONDecodingOptions: Sendable {
/// The maximum nesting of message with messages. The default is 100.
///
/// To prevent corrupt or malicious messages from causing stack overflows,
Expand Down
2 changes: 1 addition & 1 deletion Sources/SwiftProtobuf/JSONEncodingOptions.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
// -----------------------------------------------------------------------------

/// Options for JSONEncoding.
public struct JSONEncodingOptions {
public struct JSONEncodingOptions: Sendable {

/// Always prints int64s values as numbers.
/// By default, they are printed as strings as per proto3 JSON mapping rules.
Expand Down
6 changes: 2 additions & 4 deletions Sources/SwiftProtobuf/MessageExtension.swift
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,8 @@
///
// -----------------------------------------------------------------------------

// TODO: `AnyMessageExtension` should require `Sendable` but we cannot do so yet without possibly breaking compatibility.

/// Type-erased MessageExtension field implementation.
public protocol AnyMessageExtension {
public protocol AnyMessageExtension: Sendable {
var fieldNumber: Int { get }
var fieldName: String { get }
var messageType: Message.Type { get }
Expand All @@ -28,7 +26,7 @@ public protocol AnyMessageExtension {
/// A "Message Extension" relates a particular extension field to
/// a particular message. The generic constraints allow
/// compile-time compatibility checks.
public class MessageExtension<FieldType: ExtensionField, MessageType: Message>: AnyMessageExtension {
public final class MessageExtension<FieldType: ExtensionField, MessageType: Message>: AnyMessageExtension {
public let fieldNumber: Int
public let fieldName: String
public let messageType: Message.Type
Expand Down
2 changes: 1 addition & 1 deletion Sources/SwiftProtobuf/TextFormatDecodingOptions.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
// -----------------------------------------------------------------------------

/// Options for TextFormatDecoding.
public struct TextFormatDecodingOptions {
public struct TextFormatDecodingOptions: Sendable {
/// The maximum nesting of message with messages. The default is 100.
///
/// To prevent corrupt or malicious messages from causing stack overflows,
Expand Down
2 changes: 1 addition & 1 deletion Sources/SwiftProtobuf/TextFormatEncodingOptions.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
// -----------------------------------------------------------------------------

/// Options for TextFormatEncoding.
public struct TextFormatEncodingOptions {
public struct TextFormatEncodingOptions: Sendable {

/// Default: Do print unknown fields using numeric notation
public var printUnknownFields: Bool = true
Expand Down