// Code generated by protoc-gen-zig ///! package OSMPBF const std = @import("std"); const protobuf = @import("protobuf"); const fd = protobuf.fd; pub const Blob = struct { raw_size: ?i32 = null, data: ?data_union = null, pub const _data_case = enum { raw, zlib_data, lzma_data, OBSOLETE_bzip2_data, lz4_data, zstd_data, }; pub const data_union = union(_data_case) { raw: []const u8, zlib_data: []const u8, lzma_data: []const u8, OBSOLETE_bzip2_data: []const u8, lz4_data: []const u8, zstd_data: []const u8, pub const _desc_table = .{ .raw = fd(1, .{ .scalar = .bytes }), .zlib_data = fd(3, .{ .scalar = .bytes }), .lzma_data = fd(4, .{ .scalar = .bytes }), .OBSOLETE_bzip2_data = fd(5, .{ .scalar = .bytes }), .lz4_data = fd(6, .{ .scalar = .bytes }), .zstd_data = fd(7, .{ .scalar = .bytes }), }; }; pub const _desc_table = .{ .raw_size = fd(2, .{ .scalar = .int32 }), .data = fd(null, .{ .oneof = data_union }), }; /// Encodes the message to the writer /// The allocator is used to generate submessages internally. /// Hence, an ArenaAllocator is a preferred choice if allocations are a bottleneck. pub fn encode( self: @This(), writer: *std.Io.Writer, allocator: std.mem.Allocator, ) (std.Io.Writer.Error || std.mem.Allocator.Error)!void { return protobuf.encode(writer, allocator, self); } /// Decodes the message from the bytes read from the reader. pub fn decode( reader: *std.Io.Reader, allocator: std.mem.Allocator, ) (protobuf.DecodingError || std.Io.Reader.Error || std.mem.Allocator.Error)!@This() { return protobuf.decode(@This(), reader, allocator); } /// Deinitializes and frees the memory associated with the message. pub fn deinit(self: *@This(), allocator: std.mem.Allocator) void { return protobuf.deinit(allocator, self); } /// Duplicates the message. pub fn dupe(self: @This(), allocator: std.mem.Allocator) std.mem.Allocator.Error!@This() { return protobuf.dupe(@This(), self, allocator); } /// Decodes the message from the JSON string. pub fn jsonDecode( input: []const u8, options: std.json.ParseOptions, allocator: std.mem.Allocator, ) !std.json.Parsed(@This()) { return protobuf.json.decode(@This(), input, options, allocator); } /// Encodes the message to a JSON string. pub fn jsonEncode( self: @This(), options: std.json.Stringify.Options, pb_options: protobuf.json.Options, allocator: std.mem.Allocator, ) ![]const u8 { return protobuf.json.encode(self, options, pb_options, allocator); } /// This method is used by std.json /// internally for deserialization. DO NOT RENAME! pub fn jsonParse( allocator: std.mem.Allocator, source: anytype, options: std.json.ParseOptions, ) !@This() { return protobuf.json.parse(@This(), allocator, source, options); } }; pub const BlobHeader = struct { type: []const u8, indexdata: ?[]const u8 = null, datasize: i32, pub const _desc_table = .{ .type = fd(1, .{ .scalar = .string }), .indexdata = fd(2, .{ .scalar = .bytes }), .datasize = fd(3, .{ .scalar = .int32 }), }; /// Encodes the message to the writer /// The allocator is used to generate submessages internally. /// Hence, an ArenaAllocator is a preferred choice if allocations are a bottleneck. pub fn encode( self: @This(), writer: *std.Io.Writer, allocator: std.mem.Allocator, ) (std.Io.Writer.Error || std.mem.Allocator.Error)!void { return protobuf.encode(writer, allocator, self); } /// Decodes the message from the bytes read from the reader. pub fn decode( reader: *std.Io.Reader, allocator: std.mem.Allocator, ) (protobuf.DecodingError || std.Io.Reader.Error || std.mem.Allocator.Error)!@This() { return protobuf.decode(@This(), reader, allocator); } /// Deinitializes and frees the memory associated with the message. pub fn deinit(self: *@This(), allocator: std.mem.Allocator) void { return protobuf.deinit(allocator, self); } /// Duplicates the message. pub fn dupe(self: @This(), allocator: std.mem.Allocator) std.mem.Allocator.Error!@This() { return protobuf.dupe(@This(), self, allocator); } /// Decodes the message from the JSON string. pub fn jsonDecode( input: []const u8, options: std.json.ParseOptions, allocator: std.mem.Allocator, ) !std.json.Parsed(@This()) { return protobuf.json.decode(@This(), input, options, allocator); } /// Encodes the message to a JSON string. pub fn jsonEncode( self: @This(), options: std.json.Stringify.Options, pb_options: protobuf.json.Options, allocator: std.mem.Allocator, ) ![]const u8 { return protobuf.json.encode(self, options, pb_options, allocator); } /// This method is used by std.json /// internally for deserialization. DO NOT RENAME! pub fn jsonParse( allocator: std.mem.Allocator, source: anytype, options: std.json.ParseOptions, ) !@This() { return protobuf.json.parse(@This(), allocator, source, options); } }; pub const HeaderBlock = struct { bbox: ?HeaderBBox = null, required_features: std.ArrayList([]const u8) = .empty, optional_features: std.ArrayList([]const u8) = .empty, writingprogram: ?[]const u8 = null, source: ?[]const u8 = null, osmosis_replication_timestamp: ?i64 = null, osmosis_replication_sequence_number: ?i64 = null, osmosis_replication_base_url: ?[]const u8 = null, pub const _desc_table = .{ .bbox = fd(1, .submessage), .required_features = fd(4, .{ .repeated = .{ .scalar = .string } }), .optional_features = fd(5, .{ .repeated = .{ .scalar = .string } }), .writingprogram = fd(16, .{ .scalar = .string }), .source = fd(17, .{ .scalar = .string }), .osmosis_replication_timestamp = fd(32, .{ .scalar = .int64 }), .osmosis_replication_sequence_number = fd(33, .{ .scalar = .int64 }), .osmosis_replication_base_url = fd(34, .{ .scalar = .string }), }; /// Encodes the message to the writer /// The allocator is used to generate submessages internally. /// Hence, an ArenaAllocator is a preferred choice if allocations are a bottleneck. pub fn encode( self: @This(), writer: *std.Io.Writer, allocator: std.mem.Allocator, ) (std.Io.Writer.Error || std.mem.Allocator.Error)!void { return protobuf.encode(writer, allocator, self); } /// Decodes the message from the bytes read from the reader. pub fn decode( reader: *std.Io.Reader, allocator: std.mem.Allocator, ) (protobuf.DecodingError || std.Io.Reader.Error || std.mem.Allocator.Error)!@This() { return protobuf.decode(@This(), reader, allocator); } /// Deinitializes and frees the memory associated with the message. pub fn deinit(self: *@This(), allocator: std.mem.Allocator) void { return protobuf.deinit(allocator, self); } /// Duplicates the message. pub fn dupe(self: @This(), allocator: std.mem.Allocator) std.mem.Allocator.Error!@This() { return protobuf.dupe(@This(), self, allocator); } /// Decodes the message from the JSON string. pub fn jsonDecode( input: []const u8, options: std.json.ParseOptions, allocator: std.mem.Allocator, ) !std.json.Parsed(@This()) { return protobuf.json.decode(@This(), input, options, allocator); } /// Encodes the message to a JSON string. pub fn jsonEncode( self: @This(), options: std.json.Stringify.Options, pb_options: protobuf.json.Options, allocator: std.mem.Allocator, ) ![]const u8 { return protobuf.json.encode(self, options, pb_options, allocator); } /// This method is used by std.json /// internally for deserialization. DO NOT RENAME! pub fn jsonParse( allocator: std.mem.Allocator, source: anytype, options: std.json.ParseOptions, ) !@This() { return protobuf.json.parse(@This(), allocator, source, options); } }; pub const HeaderBBox = struct { left: i64, right: i64, top: i64, bottom: i64, pub const _desc_table = .{ .left = fd(1, .{ .scalar = .sint64 }), .right = fd(2, .{ .scalar = .sint64 }), .top = fd(3, .{ .scalar = .sint64 }), .bottom = fd(4, .{ .scalar = .sint64 }), }; /// Encodes the message to the writer /// The allocator is used to generate submessages internally. /// Hence, an ArenaAllocator is a preferred choice if allocations are a bottleneck. pub fn encode( self: @This(), writer: *std.Io.Writer, allocator: std.mem.Allocator, ) (std.Io.Writer.Error || std.mem.Allocator.Error)!void { return protobuf.encode(writer, allocator, self); } /// Decodes the message from the bytes read from the reader. pub fn decode( reader: *std.Io.Reader, allocator: std.mem.Allocator, ) (protobuf.DecodingError || std.Io.Reader.Error || std.mem.Allocator.Error)!@This() { return protobuf.decode(@This(), reader, allocator); } /// Deinitializes and frees the memory associated with the message. pub fn deinit(self: *@This(), allocator: std.mem.Allocator) void { return protobuf.deinit(allocator, self); } /// Duplicates the message. pub fn dupe(self: @This(), allocator: std.mem.Allocator) std.mem.Allocator.Error!@This() { return protobuf.dupe(@This(), self, allocator); } /// Decodes the message from the JSON string. pub fn jsonDecode( input: []const u8, options: std.json.ParseOptions, allocator: std.mem.Allocator, ) !std.json.Parsed(@This()) { return protobuf.json.decode(@This(), input, options, allocator); } /// Encodes the message to a JSON string. pub fn jsonEncode( self: @This(), options: std.json.Stringify.Options, pb_options: protobuf.json.Options, allocator: std.mem.Allocator, ) ![]const u8 { return protobuf.json.encode(self, options, pb_options, allocator); } /// This method is used by std.json /// internally for deserialization. DO NOT RENAME! pub fn jsonParse( allocator: std.mem.Allocator, source: anytype, options: std.json.ParseOptions, ) !@This() { return protobuf.json.parse(@This(), allocator, source, options); } }; pub const PrimitiveBlock = struct { stringtable: ?StringTable = null, primitivegroup: std.ArrayList(PrimitiveGroup) = .empty, granularity: ?i32 = 100, lat_offset: ?i64 = 0, lon_offset: ?i64 = 0, date_granularity: ?i32 = 1000, pub const _desc_table = .{ .stringtable = fd(1, .submessage), .primitivegroup = fd(2, .{ .repeated = .submessage }), .granularity = fd(17, .{ .scalar = .int32 }), .lat_offset = fd(19, .{ .scalar = .int64 }), .lon_offset = fd(20, .{ .scalar = .int64 }), .date_granularity = fd(18, .{ .scalar = .int32 }), }; /// Encodes the message to the writer /// The allocator is used to generate submessages internally. /// Hence, an ArenaAllocator is a preferred choice if allocations are a bottleneck. pub fn encode( self: @This(), writer: *std.Io.Writer, allocator: std.mem.Allocator, ) (std.Io.Writer.Error || std.mem.Allocator.Error)!void { return protobuf.encode(writer, allocator, self); } /// Decodes the message from the bytes read from the reader. pub fn decode( reader: *std.Io.Reader, allocator: std.mem.Allocator, ) (protobuf.DecodingError || std.Io.Reader.Error || std.mem.Allocator.Error)!@This() { return protobuf.decode(@This(), reader, allocator); } /// Deinitializes and frees the memory associated with the message. pub fn deinit(self: *@This(), allocator: std.mem.Allocator) void { return protobuf.deinit(allocator, self); } /// Duplicates the message. pub fn dupe(self: @This(), allocator: std.mem.Allocator) std.mem.Allocator.Error!@This() { return protobuf.dupe(@This(), self, allocator); } /// Decodes the message from the JSON string. pub fn jsonDecode( input: []const u8, options: std.json.ParseOptions, allocator: std.mem.Allocator, ) !std.json.Parsed(@This()) { return protobuf.json.decode(@This(), input, options, allocator); } /// Encodes the message to a JSON string. pub fn jsonEncode( self: @This(), options: std.json.Stringify.Options, pb_options: protobuf.json.Options, allocator: std.mem.Allocator, ) ![]const u8 { return protobuf.json.encode(self, options, pb_options, allocator); } /// This method is used by std.json /// internally for deserialization. DO NOT RENAME! pub fn jsonParse( allocator: std.mem.Allocator, source: anytype, options: std.json.ParseOptions, ) !@This() { return protobuf.json.parse(@This(), allocator, source, options); } }; /// Group of OSMPrimitives. All primitives in a group must be the same type. pub const PrimitiveGroup = struct { nodes: std.ArrayList(Node) = .empty, dense: ?DenseNodes = null, ways: std.ArrayList(Way) = .empty, relations: std.ArrayList(Relation) = .empty, changesets: std.ArrayList(ChangeSet) = .empty, pub const _desc_table = .{ .nodes = fd(1, .{ .repeated = .submessage }), .dense = fd(2, .submessage), .ways = fd(3, .{ .repeated = .submessage }), .relations = fd(4, .{ .repeated = .submessage }), .changesets = fd(5, .{ .repeated = .submessage }), }; /// Encodes the message to the writer /// The allocator is used to generate submessages internally. /// Hence, an ArenaAllocator is a preferred choice if allocations are a bottleneck. pub fn encode( self: @This(), writer: *std.Io.Writer, allocator: std.mem.Allocator, ) (std.Io.Writer.Error || std.mem.Allocator.Error)!void { return protobuf.encode(writer, allocator, self); } /// Decodes the message from the bytes read from the reader. pub fn decode( reader: *std.Io.Reader, allocator: std.mem.Allocator, ) (protobuf.DecodingError || std.Io.Reader.Error || std.mem.Allocator.Error)!@This() { return protobuf.decode(@This(), reader, allocator); } /// Deinitializes and frees the memory associated with the message. pub fn deinit(self: *@This(), allocator: std.mem.Allocator) void { return protobuf.deinit(allocator, self); } /// Duplicates the message. pub fn dupe(self: @This(), allocator: std.mem.Allocator) std.mem.Allocator.Error!@This() { return protobuf.dupe(@This(), self, allocator); } /// Decodes the message from the JSON string. pub fn jsonDecode( input: []const u8, options: std.json.ParseOptions, allocator: std.mem.Allocator, ) !std.json.Parsed(@This()) { return protobuf.json.decode(@This(), input, options, allocator); } /// Encodes the message to a JSON string. pub fn jsonEncode( self: @This(), options: std.json.Stringify.Options, pb_options: protobuf.json.Options, allocator: std.mem.Allocator, ) ![]const u8 { return protobuf.json.encode(self, options, pb_options, allocator); } /// This method is used by std.json /// internally for deserialization. DO NOT RENAME! pub fn jsonParse( allocator: std.mem.Allocator, source: anytype, options: std.json.ParseOptions, ) !@This() { return protobuf.json.parse(@This(), allocator, source, options); } }; /// * String table, contains the common strings in each block. /// /// Note that we reserve index '0' as a delimiter, so the entry at that /// index in the table is ALWAYS blank and unused. pub const StringTable = struct { s: std.ArrayList([]const u8) = .empty, pub const _desc_table = .{ .s = fd(1, .{ .repeated = .{ .scalar = .bytes } }), }; /// Encodes the message to the writer /// The allocator is used to generate submessages internally. /// Hence, an ArenaAllocator is a preferred choice if allocations are a bottleneck. pub fn encode( self: @This(), writer: *std.Io.Writer, allocator: std.mem.Allocator, ) (std.Io.Writer.Error || std.mem.Allocator.Error)!void { return protobuf.encode(writer, allocator, self); } /// Decodes the message from the bytes read from the reader. pub fn decode( reader: *std.Io.Reader, allocator: std.mem.Allocator, ) (protobuf.DecodingError || std.Io.Reader.Error || std.mem.Allocator.Error)!@This() { return protobuf.decode(@This(), reader, allocator); } /// Deinitializes and frees the memory associated with the message. pub fn deinit(self: *@This(), allocator: std.mem.Allocator) void { return protobuf.deinit(allocator, self); } /// Duplicates the message. pub fn dupe(self: @This(), allocator: std.mem.Allocator) std.mem.Allocator.Error!@This() { return protobuf.dupe(@This(), self, allocator); } /// Decodes the message from the JSON string. pub fn jsonDecode( input: []const u8, options: std.json.ParseOptions, allocator: std.mem.Allocator, ) !std.json.Parsed(@This()) { return protobuf.json.decode(@This(), input, options, allocator); } /// Encodes the message to a JSON string. pub fn jsonEncode( self: @This(), options: std.json.Stringify.Options, pb_options: protobuf.json.Options, allocator: std.mem.Allocator, ) ![]const u8 { return protobuf.json.encode(self, options, pb_options, allocator); } /// This method is used by std.json /// internally for deserialization. DO NOT RENAME! pub fn jsonParse( allocator: std.mem.Allocator, source: anytype, options: std.json.ParseOptions, ) !@This() { return protobuf.json.parse(@This(), allocator, source, options); } }; /// Optional metadata that may be included into each primitive. pub const Info = struct { version: ?i32 = -1, timestamp: ?i64 = null, changeset: ?i64 = null, uid: ?i32 = null, user_sid: ?u32 = null, visible: ?bool = null, pub const _desc_table = .{ .version = fd(1, .{ .scalar = .int32 }), .timestamp = fd(2, .{ .scalar = .int64 }), .changeset = fd(3, .{ .scalar = .int64 }), .uid = fd(4, .{ .scalar = .int32 }), .user_sid = fd(5, .{ .scalar = .uint32 }), .visible = fd(6, .{ .scalar = .bool }), }; /// Encodes the message to the writer /// The allocator is used to generate submessages internally. /// Hence, an ArenaAllocator is a preferred choice if allocations are a bottleneck. pub fn encode( self: @This(), writer: *std.Io.Writer, allocator: std.mem.Allocator, ) (std.Io.Writer.Error || std.mem.Allocator.Error)!void { return protobuf.encode(writer, allocator, self); } /// Decodes the message from the bytes read from the reader. pub fn decode( reader: *std.Io.Reader, allocator: std.mem.Allocator, ) (protobuf.DecodingError || std.Io.Reader.Error || std.mem.Allocator.Error)!@This() { return protobuf.decode(@This(), reader, allocator); } /// Deinitializes and frees the memory associated with the message. pub fn deinit(self: *@This(), allocator: std.mem.Allocator) void { return protobuf.deinit(allocator, self); } /// Duplicates the message. pub fn dupe(self: @This(), allocator: std.mem.Allocator) std.mem.Allocator.Error!@This() { return protobuf.dupe(@This(), self, allocator); } /// Decodes the message from the JSON string. pub fn jsonDecode( input: []const u8, options: std.json.ParseOptions, allocator: std.mem.Allocator, ) !std.json.Parsed(@This()) { return protobuf.json.decode(@This(), input, options, allocator); } /// Encodes the message to a JSON string. pub fn jsonEncode( self: @This(), options: std.json.Stringify.Options, pb_options: protobuf.json.Options, allocator: std.mem.Allocator, ) ![]const u8 { return protobuf.json.encode(self, options, pb_options, allocator); } /// This method is used by std.json /// internally for deserialization. DO NOT RENAME! pub fn jsonParse( allocator: std.mem.Allocator, source: anytype, options: std.json.ParseOptions, ) !@This() { return protobuf.json.parse(@This(), allocator, source, options); } }; /// * Optional metadata that may be included into each primitive. Special dense format used in DenseNodes. pub const DenseInfo = struct { version: std.ArrayList(i32) = .empty, timestamp: std.ArrayList(i64) = .empty, changeset: std.ArrayList(i64) = .empty, uid: std.ArrayList(i32) = .empty, user_sid: std.ArrayList(i32) = .empty, visible: std.ArrayList(bool) = .empty, pub const _desc_table = .{ .version = fd(1, .{ .packed_repeated = .{ .scalar = .int32 } }), .timestamp = fd(2, .{ .packed_repeated = .{ .scalar = .sint64 } }), .changeset = fd(3, .{ .packed_repeated = .{ .scalar = .sint64 } }), .uid = fd(4, .{ .packed_repeated = .{ .scalar = .sint32 } }), .user_sid = fd(5, .{ .packed_repeated = .{ .scalar = .sint32 } }), .visible = fd(6, .{ .packed_repeated = .{ .scalar = .bool } }), }; /// Encodes the message to the writer /// The allocator is used to generate submessages internally. /// Hence, an ArenaAllocator is a preferred choice if allocations are a bottleneck. pub fn encode( self: @This(), writer: *std.Io.Writer, allocator: std.mem.Allocator, ) (std.Io.Writer.Error || std.mem.Allocator.Error)!void { return protobuf.encode(writer, allocator, self); } /// Decodes the message from the bytes read from the reader. pub fn decode( reader: *std.Io.Reader, allocator: std.mem.Allocator, ) (protobuf.DecodingError || std.Io.Reader.Error || std.mem.Allocator.Error)!@This() { return protobuf.decode(@This(), reader, allocator); } /// Deinitializes and frees the memory associated with the message. pub fn deinit(self: *@This(), allocator: std.mem.Allocator) void { return protobuf.deinit(allocator, self); } /// Duplicates the message. pub fn dupe(self: @This(), allocator: std.mem.Allocator) std.mem.Allocator.Error!@This() { return protobuf.dupe(@This(), self, allocator); } /// Decodes the message from the JSON string. pub fn jsonDecode( input: []const u8, options: std.json.ParseOptions, allocator: std.mem.Allocator, ) !std.json.Parsed(@This()) { return protobuf.json.decode(@This(), input, options, allocator); } /// Encodes the message to a JSON string. pub fn jsonEncode( self: @This(), options: std.json.Stringify.Options, pb_options: protobuf.json.Options, allocator: std.mem.Allocator, ) ![]const u8 { return protobuf.json.encode(self, options, pb_options, allocator); } /// This method is used by std.json /// internally for deserialization. DO NOT RENAME! pub fn jsonParse( allocator: std.mem.Allocator, source: anytype, options: std.json.ParseOptions, ) !@This() { return protobuf.json.parse(@This(), allocator, source, options); } }; /// This is kept for backwards compatibility but not used anywhere. pub const ChangeSet = struct { id: i64, pub const _desc_table = .{ .id = fd(1, .{ .scalar = .int64 }), }; /// Encodes the message to the writer /// The allocator is used to generate submessages internally. /// Hence, an ArenaAllocator is a preferred choice if allocations are a bottleneck. pub fn encode( self: @This(), writer: *std.Io.Writer, allocator: std.mem.Allocator, ) (std.Io.Writer.Error || std.mem.Allocator.Error)!void { return protobuf.encode(writer, allocator, self); } /// Decodes the message from the bytes read from the reader. pub fn decode( reader: *std.Io.Reader, allocator: std.mem.Allocator, ) (protobuf.DecodingError || std.Io.Reader.Error || std.mem.Allocator.Error)!@This() { return protobuf.decode(@This(), reader, allocator); } /// Deinitializes and frees the memory associated with the message. pub fn deinit(self: *@This(), allocator: std.mem.Allocator) void { return protobuf.deinit(allocator, self); } /// Duplicates the message. pub fn dupe(self: @This(), allocator: std.mem.Allocator) std.mem.Allocator.Error!@This() { return protobuf.dupe(@This(), self, allocator); } /// Decodes the message from the JSON string. pub fn jsonDecode( input: []const u8, options: std.json.ParseOptions, allocator: std.mem.Allocator, ) !std.json.Parsed(@This()) { return protobuf.json.decode(@This(), input, options, allocator); } /// Encodes the message to a JSON string. pub fn jsonEncode( self: @This(), options: std.json.Stringify.Options, pb_options: protobuf.json.Options, allocator: std.mem.Allocator, ) ![]const u8 { return protobuf.json.encode(self, options, pb_options, allocator); } /// This method is used by std.json /// internally for deserialization. DO NOT RENAME! pub fn jsonParse( allocator: std.mem.Allocator, source: anytype, options: std.json.ParseOptions, ) !@This() { return protobuf.json.parse(@This(), allocator, source, options); } }; pub const Node = struct { id: i64, keys: std.ArrayList(u32) = .empty, vals: std.ArrayList(u32) = .empty, info: ?Info = null, lat: i64, lon: i64, pub const _desc_table = .{ .id = fd(1, .{ .scalar = .sint64 }), .keys = fd(2, .{ .packed_repeated = .{ .scalar = .uint32 } }), .vals = fd(3, .{ .packed_repeated = .{ .scalar = .uint32 } }), .info = fd(4, .submessage), .lat = fd(8, .{ .scalar = .sint64 }), .lon = fd(9, .{ .scalar = .sint64 }), }; /// Encodes the message to the writer /// The allocator is used to generate submessages internally. /// Hence, an ArenaAllocator is a preferred choice if allocations are a bottleneck. pub fn encode( self: @This(), writer: *std.Io.Writer, allocator: std.mem.Allocator, ) (std.Io.Writer.Error || std.mem.Allocator.Error)!void { return protobuf.encode(writer, allocator, self); } /// Decodes the message from the bytes read from the reader. pub fn decode( reader: *std.Io.Reader, allocator: std.mem.Allocator, ) (protobuf.DecodingError || std.Io.Reader.Error || std.mem.Allocator.Error)!@This() { return protobuf.decode(@This(), reader, allocator); } /// Deinitializes and frees the memory associated with the message. pub fn deinit(self: *@This(), allocator: std.mem.Allocator) void { return protobuf.deinit(allocator, self); } /// Duplicates the message. pub fn dupe(self: @This(), allocator: std.mem.Allocator) std.mem.Allocator.Error!@This() { return protobuf.dupe(@This(), self, allocator); } /// Decodes the message from the JSON string. pub fn jsonDecode( input: []const u8, options: std.json.ParseOptions, allocator: std.mem.Allocator, ) !std.json.Parsed(@This()) { return protobuf.json.decode(@This(), input, options, allocator); } /// Encodes the message to a JSON string. pub fn jsonEncode( self: @This(), options: std.json.Stringify.Options, pb_options: protobuf.json.Options, allocator: std.mem.Allocator, ) ![]const u8 { return protobuf.json.encode(self, options, pb_options, allocator); } /// This method is used by std.json /// internally for deserialization. DO NOT RENAME! pub fn jsonParse( allocator: std.mem.Allocator, source: anytype, options: std.json.ParseOptions, ) !@This() { return protobuf.json.parse(@This(), allocator, source, options); } }; pub const DenseNodes = struct { id: std.ArrayList(i64) = .empty, denseinfo: ?DenseInfo = null, lat: std.ArrayList(i64) = .empty, lon: std.ArrayList(i64) = .empty, keys_vals: std.ArrayList(i32) = .empty, pub const _desc_table = .{ .id = fd(1, .{ .packed_repeated = .{ .scalar = .sint64 } }), .denseinfo = fd(5, .submessage), .lat = fd(8, .{ .packed_repeated = .{ .scalar = .sint64 } }), .lon = fd(9, .{ .packed_repeated = .{ .scalar = .sint64 } }), .keys_vals = fd(10, .{ .packed_repeated = .{ .scalar = .int32 } }), }; /// Encodes the message to the writer /// The allocator is used to generate submessages internally. /// Hence, an ArenaAllocator is a preferred choice if allocations are a bottleneck. pub fn encode( self: @This(), writer: *std.Io.Writer, allocator: std.mem.Allocator, ) (std.Io.Writer.Error || std.mem.Allocator.Error)!void { return protobuf.encode(writer, allocator, self); } /// Decodes the message from the bytes read from the reader. pub fn decode( reader: *std.Io.Reader, allocator: std.mem.Allocator, ) (protobuf.DecodingError || std.Io.Reader.Error || std.mem.Allocator.Error)!@This() { return protobuf.decode(@This(), reader, allocator); } /// Deinitializes and frees the memory associated with the message. pub fn deinit(self: *@This(), allocator: std.mem.Allocator) void { return protobuf.deinit(allocator, self); } /// Duplicates the message. pub fn dupe(self: @This(), allocator: std.mem.Allocator) std.mem.Allocator.Error!@This() { return protobuf.dupe(@This(), self, allocator); } /// Decodes the message from the JSON string. pub fn jsonDecode( input: []const u8, options: std.json.ParseOptions, allocator: std.mem.Allocator, ) !std.json.Parsed(@This()) { return protobuf.json.decode(@This(), input, options, allocator); } /// Encodes the message to a JSON string. pub fn jsonEncode( self: @This(), options: std.json.Stringify.Options, pb_options: protobuf.json.Options, allocator: std.mem.Allocator, ) ![]const u8 { return protobuf.json.encode(self, options, pb_options, allocator); } /// This method is used by std.json /// internally for deserialization. DO NOT RENAME! pub fn jsonParse( allocator: std.mem.Allocator, source: anytype, options: std.json.ParseOptions, ) !@This() { return protobuf.json.parse(@This(), allocator, source, options); } }; pub const Way = struct { id: i64, keys: std.ArrayList(u32) = .empty, vals: std.ArrayList(u32) = .empty, info: ?Info = null, refs: std.ArrayList(i64) = .empty, lat: std.ArrayList(i64) = .empty, lon: std.ArrayList(i64) = .empty, pub const _desc_table = .{ .id = fd(1, .{ .scalar = .int64 }), .keys = fd(2, .{ .packed_repeated = .{ .scalar = .uint32 } }), .vals = fd(3, .{ .packed_repeated = .{ .scalar = .uint32 } }), .info = fd(4, .submessage), .refs = fd(8, .{ .packed_repeated = .{ .scalar = .sint64 } }), .lat = fd(9, .{ .packed_repeated = .{ .scalar = .sint64 } }), .lon = fd(10, .{ .packed_repeated = .{ .scalar = .sint64 } }), }; /// Encodes the message to the writer /// The allocator is used to generate submessages internally. /// Hence, an ArenaAllocator is a preferred choice if allocations are a bottleneck. pub fn encode( self: @This(), writer: *std.Io.Writer, allocator: std.mem.Allocator, ) (std.Io.Writer.Error || std.mem.Allocator.Error)!void { return protobuf.encode(writer, allocator, self); } /// Decodes the message from the bytes read from the reader. pub fn decode( reader: *std.Io.Reader, allocator: std.mem.Allocator, ) (protobuf.DecodingError || std.Io.Reader.Error || std.mem.Allocator.Error)!@This() { return protobuf.decode(@This(), reader, allocator); } /// Deinitializes and frees the memory associated with the message. pub fn deinit(self: *@This(), allocator: std.mem.Allocator) void { return protobuf.deinit(allocator, self); } /// Duplicates the message. pub fn dupe(self: @This(), allocator: std.mem.Allocator) std.mem.Allocator.Error!@This() { return protobuf.dupe(@This(), self, allocator); } /// Decodes the message from the JSON string. pub fn jsonDecode( input: []const u8, options: std.json.ParseOptions, allocator: std.mem.Allocator, ) !std.json.Parsed(@This()) { return protobuf.json.decode(@This(), input, options, allocator); } /// Encodes the message to a JSON string. pub fn jsonEncode( self: @This(), options: std.json.Stringify.Options, pb_options: protobuf.json.Options, allocator: std.mem.Allocator, ) ![]const u8 { return protobuf.json.encode(self, options, pb_options, allocator); } /// This method is used by std.json /// internally for deserialization. DO NOT RENAME! pub fn jsonParse( allocator: std.mem.Allocator, source: anytype, options: std.json.ParseOptions, ) !@This() { return protobuf.json.parse(@This(), allocator, source, options); } }; pub const Relation = struct { id: i64, keys: std.ArrayList(u32) = .empty, vals: std.ArrayList(u32) = .empty, info: ?Info = null, roles_sid: std.ArrayList(i32) = .empty, memids: std.ArrayList(i64) = .empty, types: std.ArrayList(Relation.MemberType) = .empty, pub const _desc_table = .{ .id = fd(1, .{ .scalar = .int64 }), .keys = fd(2, .{ .packed_repeated = .{ .scalar = .uint32 } }), .vals = fd(3, .{ .packed_repeated = .{ .scalar = .uint32 } }), .info = fd(4, .submessage), .roles_sid = fd(8, .{ .packed_repeated = .{ .scalar = .int32 } }), .memids = fd(9, .{ .packed_repeated = .{ .scalar = .sint64 } }), .types = fd(10, .{ .packed_repeated = .@"enum" }), }; pub const MemberType = enum(i32) { NODE = 0, WAY = 1, RELATION = 2, _, }; /// Encodes the message to the writer /// The allocator is used to generate submessages internally. /// Hence, an ArenaAllocator is a preferred choice if allocations are a bottleneck. pub fn encode( self: @This(), writer: *std.Io.Writer, allocator: std.mem.Allocator, ) (std.Io.Writer.Error || std.mem.Allocator.Error)!void { return protobuf.encode(writer, allocator, self); } /// Decodes the message from the bytes read from the reader. pub fn decode( reader: *std.Io.Reader, allocator: std.mem.Allocator, ) (protobuf.DecodingError || std.Io.Reader.Error || std.mem.Allocator.Error)!@This() { return protobuf.decode(@This(), reader, allocator); } /// Deinitializes and frees the memory associated with the message. pub fn deinit(self: *@This(), allocator: std.mem.Allocator) void { return protobuf.deinit(allocator, self); } /// Duplicates the message. pub fn dupe(self: @This(), allocator: std.mem.Allocator) std.mem.Allocator.Error!@This() { return protobuf.dupe(@This(), self, allocator); } /// Decodes the message from the JSON string. pub fn jsonDecode( input: []const u8, options: std.json.ParseOptions, allocator: std.mem.Allocator, ) !std.json.Parsed(@This()) { return protobuf.json.decode(@This(), input, options, allocator); } /// Encodes the message to a JSON string. pub fn jsonEncode( self: @This(), options: std.json.Stringify.Options, pb_options: protobuf.json.Options, allocator: std.mem.Allocator, ) ![]const u8 { return protobuf.json.encode(self, options, pb_options, allocator); } /// This method is used by std.json /// internally for deserialization. DO NOT RENAME! pub fn jsonParse( allocator: std.mem.Allocator, source: anytype, options: std.json.ParseOptions, ) !@This() { return protobuf.json.parse(@This(), allocator, source, options); } };