Initializerswift-protobuf 1.28.1SwiftProtobuf
init(fieldNumbers:of:)
Initiates a field mask from some particular field numbers of a message
Google_Protobuf_FieldMask+Extensions.swift:204init<M>(fieldNumbers: [Int], of messageType: M.Type) throws where M : Message, M : _ProtoNameProviding
Parameters
- messageType
Message type to get all paths from.
- fieldNumbers
Field numbers of paths to be included.
Returns
Field mask that include paths of corresponding field numbers.
Throws
FieldMaskError.invalidFieldNumber
if the field number is not on the message
Other members in extension
Types
struct MergeOptions
Defines available options for merging two messages.
Type members
init(
) init<M>(allFieldsOf: M.Type
) Initiates a field mask with all fields of the message type.
init?(jsonPaths: String...
) Creates a new
Google_Protobuf_FieldMask
from the given paths.init(protoPaths: String...
) Creates a new
Google_Protobuf_FieldMask
from the given paths.init(protoPaths: [String]
) Creates a new
Google_Protobuf_FieldMask
from the given array of paths.static let protoMessageName: String
static func == (lhs: Google_Protobuf_FieldMask, rhs: Google_Protobuf_FieldMask
) -> Bool
Show implementation details (1)
Hide implementation details
Instance members
var canonical: Google_Protobuf_FieldMask
Converts a FieldMask to the canonical form. It will:
var paths: [String]
The set of field mask paths.
var unknownFields: UnknownStorage
func addPath<M>(String, of: M.Type
) throws Adds a path to FieldMask after checking whether the given path is valid. This method check-fails if the path is not a valid path for Message type.
func contains(String
) -> Bool Returns true if path is covered by the given FieldMask. Note that path “foo.bar” covers all paths like “foo.bar.baz”, “foo.bar.quz.x”, etc. Also note that parent paths are not covered by explicit child path, i.e. “foo.bar” does NOT cover “foo”, even if “bar” is the only child.
func decodeMessage<D>(decoder: inout D
) throws func intersect(Google_Protobuf_FieldMask
) -> Google_Protobuf_FieldMask Creates an intersection of two FieldMasks.
func isValid<M>(for: M.Type
) -> Bool Checks whether the given FieldMask is valid for type M.
func subtract(Google_Protobuf_FieldMask
) -> Google_Protobuf_FieldMask Creates a FieldMasks with paths of the original FieldMask that does not included in mask.
func traverse<V>(visitor: inout V
) throws func union(Google_Protobuf_FieldMask
) -> Google_Protobuf_FieldMask Creates an union of two FieldMasks.