Initializerswift-protobuf 1.28.1SwiftProtobuf
init(textFormatString:options:extensions:)
Creates a new Google_Protobuf_Any
by decoding the given string containing a serialized message in Protocol Buffer text format.
init(textFormatString: String, options: TextFormatDecodingOptions = TextFormatDecodingOptions(), extensions: (any ExtensionMap)? = nil) throws
Parameters
- textFormatString
The text format string to decode.
- options
The
TextFormatDecodingOptions
to use.- extensions
An
ExtensionMap
used to look up and decode any extensions in this message or messages nested within this message’s fields.
Throws
TextFormatDecodingError
on failure.
Other members in extension
Type members
init(
) init(message: any Message, partial: Bool, typePrefix: String
) throws Initialize an Any object from the provided message.
init(textFormatString: String, extensions: (any ExtensionMap)?
) throws Creates a new
Google_Protobuf_Any
by decoding the given string containing a serialized message in Protocol Buffer text format.static let protoMessageName: String
static func messageType(forMessageName: String
) -> (any Message.Type)? Returns the Message.Type expected for the given proto message name.
static func messageType(forTypeURL: String
) -> (any Message.Type)? Returns the Message.Type expected for the given type URL.
static func register(messageType: any Message.Type
) -> Bool Register a message type so that Any objects can use them for decoding contents.
static func == (lhs: Google_Protobuf_Any, rhs: Google_Protobuf_Any
) -> Bool
Show implementation details (1)
Hide implementation details
Instance members
var typeURL: String
A URL/resource name that uniquely identifies the type of the serialized protocol buffer message. This string must contain at least one “/” character. The last segment of the URL’s path must represent the fully qualified name of the type (as in
path/google.protobuf.Duration
). The name should be in a canonical form (e.g., leading “.” is not accepted).var unknownFields: UnknownStorage
var value: Data
Must be a valid serialized protocol buffer of the above specified type.
func decodeMessage<D>(decoder: inout D
) throws func hash(into: inout Hasher
) func isA<M>(M.Type
) -> Bool Returns true if this
Google_Protobuf_Any
message contains the given message type.func traverse<V>(visitor: inout V
) throws