LoadError
Errors raised from parsing mappings
enum LoadError
Errors raised from parsing mappings
enum LoadError
s26SwiftProtobufPluginLibrary25ProtoFileToModuleMappingsV9LoadErrorO
What are these?5BXHV
import SwiftProtobufPluginLibrary
A reusable framework for building protoc
plugins in Swift.
struct ProtoFileToModuleMappings
Handles the mapping of proto files to the modules they will be compiled into.
case failToOpen(path: String)
Raised if the path wasn’t found.
case entryMissingModuleName(mappingIndex: Int)
Raised if an mapping entry in the protobuf doesn’t have a module name. mappingIndex is the index (0-N) of the mapping.
case entryHasNoProtoPaths(mappingIndex: Int)
Raised if an mapping entry in the protobuf doesn’t have any proto files listed. mappingIndex is the index (0-N) of the mapping.
case duplicateProtoPathMapping(path: String, firstModule: String, secondModule: String)
The given proto path was listed for both modules.
init()
init(moduleMappingsProto mappings: SwiftProtobuf_GenSwift_ModuleMappings) throws
Parses the given module mapping. Raises LoadError.
init(moduleMappingsProto mappings: SwiftProtobuf_GenSwift_ModuleMappings, swiftProtobufModuleName: String?) throws
Parses the given module mapping. Raises LoadError.
init(path: String) throws
Loads and parses the given module mapping from disk. Raises LoadError or TextFormatDecodingError.
init(path: String, swiftProtobufModuleName: String?) throws
Loads and parses the given module mapping from disk. Raises LoadError or TextFormatDecodingError.
init(swiftProtobufModuleName: String?)
let hasMappings: Bool
A Boolean value that indicates that there were developer provided mappings.
let swiftProtobufModuleName: String
The name of the runtime module for SwiftProtobuf (usually “SwiftProtobuf”). We expect to find the WKTs in the module named here.
func moduleName(forFile file: FileDescriptor) -> String?
Looks up the module a given file is in.
func neededModules(forFile file: FileDescriptor) -> [String]?
Returns the list of modules that need to be imported for a given file based on the dependencies it has.
protocol Equatable
A type that can be compared for value equality.
protocol Error : Sendable
A type representing an error value that can be thrown.
protocol Sendable
var localizedDescription: String { get }
Retrieve the localized description for this error.
static func != (lhs: Self, rhs: Self) -> Bool
Returns a Boolean value indicating whether two values are not equal.