// @generated by protoc-gen-roto — do not edit use crate::{ProtoAccessor, ProtoBuilder, Result, RotoError, read_varint, RepeatedFieldIterator}; use std::str; pub struct Tool<'a> { accessor: crate::ProtoAccessor<'a>, name_offset: Option, version_offset: Option, payload_offset: Option, is_active_offset: Option, exploit_count_offset: Option, } impl<'a> Tool<'a> { pub fn new(data: &'a [u8]) -> crate::Result { let accessor = crate::ProtoAccessor::new(data)?; let mut name_offset = None; let mut version_offset = None; let mut payload_offset = None; let mut is_active_offset = None; let mut exploit_count_offset = None; for item in accessor.fields() { let (offset, tag, _) = item?; if tag.field_number == 1 { name_offset = Some(offset); } if tag.field_number == 2 { version_offset = Some(offset); } if tag.field_number == 3 { payload_offset = Some(offset); } if tag.field_number == 4 { is_active_offset = Some(offset); } if tag.field_number == 5 { exploit_count_offset = Some(offset); } } Ok(Self { accessor, name_offset, version_offset, payload_offset, is_active_offset, exploit_count_offset, }) } pub fn name(&self) -> crate::Result<&'a str> { let offset = self.name_offset.ok_or(crate::RotoError::FieldNotFound)?; let (bytes, _) = self.accessor.get_value_at(offset)?; str::from_utf8(bytes).map_err(|_| crate::RotoError::WireFormatViolation) } pub fn version(&self) -> crate::Result<&'a str> { let offset = self.version_offset.ok_or(crate::RotoError::FieldNotFound)?; let (bytes, _) = self.accessor.get_value_at(offset)?; str::from_utf8(bytes).map_err(|_| crate::RotoError::WireFormatViolation) } pub fn payload(&self) -> crate::Result<&'a [u8]> { let offset = self.payload_offset.ok_or(crate::RotoError::FieldNotFound)?; let (bytes, _) = self.accessor.get_value_at(offset)?; Ok(bytes) } pub fn is_active(&self) -> crate::Result { let offset = self.is_active_offset.ok_or(crate::RotoError::FieldNotFound)?; let (bytes, _) = self.accessor.get_value_at(offset)?; crate::read_varint(bytes).map(|(v, _)| v != 0).map_err(|_| crate::RotoError::WireFormatViolation) } pub fn exploit_count(&self) -> crate::Result { let offset = self.exploit_count_offset.ok_or(crate::RotoError::FieldNotFound)?; let (bytes, _) = self.accessor.get_value_at(offset)?; crate::read_varint(bytes).map(|(v, _)| v as i32).map_err(|_| crate::RotoError::WireFormatViolation) } } pub struct ToolBuilder<'b> { builder: crate::ProtoBuilder<'b>, } impl<'b> ToolBuilder<'b> { pub fn builder(buf: &mut [u8]) -> ToolBuilder<'_> { ToolBuilder { builder: crate::ProtoBuilder::new(buf), } } pub fn name(mut self, value: &str) -> crate::Result { self.builder.write_string(1, value)?; Ok(self) } pub fn version(mut self, value: &str) -> crate::Result { self.builder.write_string(2, value)?; Ok(self) } pub fn payload(mut self, value: &[u8]) -> crate::Result { self.builder.write_bytes(3, value)?; Ok(self) } pub fn is_active(mut self, value: u64) -> crate::Result { self.builder.write_varint(4, value)?; Ok(self) } pub fn exploit_count(mut self, value: i32) -> crate::Result { self.builder.write_int32(5, value)?; Ok(self) } pub fn finish(self) -> crate::Result<&'b mut [u8]> { self.builder.finish() } } pub struct Connection<'a> { accessor: crate::ProtoAccessor<'a>, host_offset: Option, port_offset: Option, encrypted_offset: Option, bandwidth_bps_offset: Option, session_key_offset: Option, } impl<'a> Connection<'a> { pub fn new(data: &'a [u8]) -> crate::Result { let accessor = crate::ProtoAccessor::new(data)?; let mut host_offset = None; let mut port_offset = None; let mut encrypted_offset = None; let mut bandwidth_bps_offset = None; let mut session_key_offset = None; for item in accessor.fields() { let (offset, tag, _) = item?; if tag.field_number == 1 { host_offset = Some(offset); } if tag.field_number == 2 { port_offset = Some(offset); } if tag.field_number == 3 { encrypted_offset = Some(offset); } if tag.field_number == 4 { bandwidth_bps_offset = Some(offset); } if tag.field_number == 5 { session_key_offset = Some(offset); } } Ok(Self { accessor, host_offset, port_offset, encrypted_offset, bandwidth_bps_offset, session_key_offset, }) } pub fn host(&self) -> crate::Result<&'a str> { let offset = self.host_offset.ok_or(crate::RotoError::FieldNotFound)?; let (bytes, _) = self.accessor.get_value_at(offset)?; str::from_utf8(bytes).map_err(|_| crate::RotoError::WireFormatViolation) } pub fn port(&self) -> crate::Result { let offset = self.port_offset.ok_or(crate::RotoError::FieldNotFound)?; let (bytes, _) = self.accessor.get_value_at(offset)?; crate::read_varint(bytes).map(|(v, _)| v as i32).map_err(|_| crate::RotoError::WireFormatViolation) } pub fn encrypted(&self) -> crate::Result { let offset = self.encrypted_offset.ok_or(crate::RotoError::FieldNotFound)?; let (bytes, _) = self.accessor.get_value_at(offset)?; crate::read_varint(bytes).map(|(v, _)| v != 0).map_err(|_| crate::RotoError::WireFormatViolation) } pub fn bandwidth_bps(&self) -> crate::Result { let offset = self.bandwidth_bps_offset.ok_or(crate::RotoError::FieldNotFound)?; let (bytes, _) = self.accessor.get_value_at(offset)?; crate::read_varint(bytes).map(|(v, _)| v as i32).map_err(|_| crate::RotoError::WireFormatViolation) } pub fn session_key(&self) -> crate::Result<&'a [u8]> { let offset = self.session_key_offset.ok_or(crate::RotoError::FieldNotFound)?; let (bytes, _) = self.accessor.get_value_at(offset)?; Ok(bytes) } } pub struct ConnectionBuilder<'b> { builder: crate::ProtoBuilder<'b>, } impl<'b> ConnectionBuilder<'b> { pub fn builder(buf: &mut [u8]) -> ConnectionBuilder<'_> { ConnectionBuilder { builder: crate::ProtoBuilder::new(buf), } } pub fn host(mut self, value: &str) -> crate::Result { self.builder.write_string(1, value)?; Ok(self) } pub fn port(mut self, value: i32) -> crate::Result { self.builder.write_int32(2, value)?; Ok(self) } pub fn encrypted(mut self, value: u64) -> crate::Result { self.builder.write_varint(3, value)?; Ok(self) } pub fn bandwidth_bps(mut self, value: u64) -> crate::Result { self.builder.write_varint(4, value)?; Ok(self) } pub fn session_key(mut self, value: &[u8]) -> crate::Result { self.builder.write_bytes(5, value)?; Ok(self) } pub fn finish(self) -> crate::Result<&'b mut [u8]> { self.builder.finish() } } pub struct Hacker<'a> { accessor: crate::ProtoAccessor<'a>, handle_offset: Option, real_name_offset: Option, age_offset: Option, skill_level_offset: Option, is_elite_offset: Option, crew_id_offset: Option, exploits_start: Option, exploits_end: Option, tools_start: Option, tools_end: Option, active_connection_offset: Option, } impl<'a> Hacker<'a> { pub fn new(data: &'a [u8]) -> crate::Result { let accessor = crate::ProtoAccessor::new(data)?; let mut handle_offset = None; let mut real_name_offset = None; let mut age_offset = None; let mut skill_level_offset = None; let mut is_elite_offset = None; let mut crew_id_offset = None; let mut exploits_start = None; let mut exploits_end = None; let mut tools_start = None; let mut tools_end = None; let mut active_connection_offset = None; for item in accessor.fields() { let (offset, tag, _) = item?; if tag.field_number == 1 { handle_offset = Some(offset); } if tag.field_number == 2 { real_name_offset = Some(offset); } if tag.field_number == 3 { age_offset = Some(offset); } if tag.field_number == 4 { skill_level_offset = Some(offset); } if tag.field_number == 5 { is_elite_offset = Some(offset); } if tag.field_number == 6 { crew_id_offset = Some(offset); } if tag.field_number == 7 { if exploits_start.is_none() { exploits_start = Some(offset); } exploits_end = Some(offset); } if tag.field_number == 8 { if tools_start.is_none() { tools_start = Some(offset); } tools_end = Some(offset); } if tag.field_number == 9 { active_connection_offset = Some(offset); } } Ok(Self { accessor, handle_offset, real_name_offset, age_offset, skill_level_offset, is_elite_offset, crew_id_offset, exploits_start, exploits_end, tools_start, tools_end, active_connection_offset, }) } pub fn handle(&self) -> crate::Result<&'a str> { let offset = self.handle_offset.ok_or(crate::RotoError::FieldNotFound)?; let (bytes, _) = self.accessor.get_value_at(offset)?; str::from_utf8(bytes).map_err(|_| crate::RotoError::WireFormatViolation) } pub fn real_name(&self) -> crate::Result<&'a str> { let offset = self.real_name_offset.ok_or(crate::RotoError::FieldNotFound)?; let (bytes, _) = self.accessor.get_value_at(offset)?; str::from_utf8(bytes).map_err(|_| crate::RotoError::WireFormatViolation) } pub fn age(&self) -> crate::Result { let offset = self.age_offset.ok_or(crate::RotoError::FieldNotFound)?; let (bytes, _) = self.accessor.get_value_at(offset)?; crate::read_varint(bytes).map(|(v, _)| v as i32).map_err(|_| crate::RotoError::WireFormatViolation) } pub fn skill_level(&self) -> crate::Result { let offset = self.skill_level_offset.ok_or(crate::RotoError::FieldNotFound)?; let (bytes, _) = self.accessor.get_value_at(offset)?; Ok(f32::from_le_bytes(bytes.try_into().map_err(|_| crate::RotoError::WireFormatViolation)?)) } pub fn is_elite(&self) -> crate::Result { let offset = self.is_elite_offset.ok_or(crate::RotoError::FieldNotFound)?; let (bytes, _) = self.accessor.get_value_at(offset)?; crate::read_varint(bytes).map(|(v, _)| v != 0).map_err(|_| crate::RotoError::WireFormatViolation) } pub fn crew_id(&self) -> crate::Result { let offset = self.crew_id_offset.ok_or(crate::RotoError::FieldNotFound)?; let (bytes, _) = self.accessor.get_value_at(offset)?; crate::read_varint(bytes).map(|(v, _)| v as i32).map_err(|_| crate::RotoError::WireFormatViolation) } pub fn exploits(&self) -> crate::RepeatedFieldIterator<'a> { match (self.exploits_start, self.exploits_end) { (Some(start), Some(end)) => self.accessor.iter_repeated_range(7, start, end), _ => self.accessor.iter_repeated(7), } } pub fn tools(&self) -> crate::RepeatedFieldIterator<'a> { match (self.tools_start, self.tools_end) { (Some(start), Some(end)) => self.accessor.iter_repeated_range(8, start, end), _ => self.accessor.iter_repeated(8), } } pub fn active_connection(&self) -> crate::Result<&'a [u8]> { let offset = self.active_connection_offset.ok_or(crate::RotoError::FieldNotFound)?; let (bytes, _) = self.accessor.get_value_at(offset)?; Ok(bytes) } } pub struct HackerBuilder<'b> { builder: crate::ProtoBuilder<'b>, } impl<'b> HackerBuilder<'b> { pub fn builder(buf: &mut [u8]) -> HackerBuilder<'_> { HackerBuilder { builder: crate::ProtoBuilder::new(buf), } } pub fn handle(mut self, value: &str) -> crate::Result { self.builder.write_string(1, value)?; Ok(self) } pub fn real_name(mut self, value: &str) -> crate::Result { self.builder.write_string(2, value)?; Ok(self) } pub fn age(mut self, value: i32) -> crate::Result { self.builder.write_int32(3, value)?; Ok(self) } pub fn skill_level(mut self, value: &[u8]) -> crate::Result { self.builder.write_bytes(4, value)?; Ok(self) } pub fn is_elite(mut self, value: u64) -> crate::Result { self.builder.write_varint(5, value)?; Ok(self) } pub fn crew_id(mut self, value: u64) -> crate::Result { self.builder.write_varint(6, value)?; Ok(self) } pub fn exploits(mut self, value: &str) -> crate::Result { self.builder.write_string(7, value)?; Ok(self) } pub fn tools(mut self, value: &[u8]) -> crate::Result { self.builder.write_bytes(8, value)?; Ok(self) } pub fn active_connection(mut self, value: &[u8]) -> crate::Result { self.builder.write_bytes(9, value)?; Ok(self) } pub fn finish(self) -> crate::Result<&'b mut [u8]> { self.builder.finish() } } pub struct Worm<'a> { accessor: crate::ProtoAccessor<'a>, name_offset: Option, variant_offset: Option, size_bytes_offset: Option, payload_offset: Option, polymorphic_offset: Option, targets_start: Option, targets_end: Option, } impl<'a> Worm<'a> { pub fn new(data: &'a [u8]) -> crate::Result { let accessor = crate::ProtoAccessor::new(data)?; let mut name_offset = None; let mut variant_offset = None; let mut size_bytes_offset = None; let mut payload_offset = None; let mut polymorphic_offset = None; let mut targets_start = None; let mut targets_end = None; for item in accessor.fields() { let (offset, tag, _) = item?; if tag.field_number == 1 { name_offset = Some(offset); } if tag.field_number == 2 { variant_offset = Some(offset); } if tag.field_number == 3 { size_bytes_offset = Some(offset); } if tag.field_number == 4 { payload_offset = Some(offset); } if tag.field_number == 5 { polymorphic_offset = Some(offset); } if tag.field_number == 6 { if targets_start.is_none() { targets_start = Some(offset); } targets_end = Some(offset); } } Ok(Self { accessor, name_offset, variant_offset, size_bytes_offset, payload_offset, polymorphic_offset, targets_start, targets_end, }) } pub fn name(&self) -> crate::Result<&'a str> { let offset = self.name_offset.ok_or(crate::RotoError::FieldNotFound)?; let (bytes, _) = self.accessor.get_value_at(offset)?; str::from_utf8(bytes).map_err(|_| crate::RotoError::WireFormatViolation) } pub fn variant(&self) -> crate::Result { let offset = self.variant_offset.ok_or(crate::RotoError::FieldNotFound)?; let (bytes, _) = self.accessor.get_value_at(offset)?; crate::read_varint(bytes).map(|(v, _)| v as i32).map_err(|_| crate::RotoError::WireFormatViolation) } pub fn size_bytes(&self) -> crate::Result { let offset = self.size_bytes_offset.ok_or(crate::RotoError::FieldNotFound)?; let (bytes, _) = self.accessor.get_value_at(offset)?; crate::read_varint(bytes).map(|(v, _)| v as i32).map_err(|_| crate::RotoError::WireFormatViolation) } pub fn payload(&self) -> crate::Result<&'a [u8]> { let offset = self.payload_offset.ok_or(crate::RotoError::FieldNotFound)?; let (bytes, _) = self.accessor.get_value_at(offset)?; Ok(bytes) } pub fn polymorphic(&self) -> crate::Result { let offset = self.polymorphic_offset.ok_or(crate::RotoError::FieldNotFound)?; let (bytes, _) = self.accessor.get_value_at(offset)?; crate::read_varint(bytes).map(|(v, _)| v != 0).map_err(|_| crate::RotoError::WireFormatViolation) } pub fn targets(&self) -> crate::RepeatedFieldIterator<'a> { match (self.targets_start, self.targets_end) { (Some(start), Some(end)) => self.accessor.iter_repeated_range(6, start, end), _ => self.accessor.iter_repeated(6), } } } pub struct WormBuilder<'b> { builder: crate::ProtoBuilder<'b>, } impl<'b> WormBuilder<'b> { pub fn builder(buf: &mut [u8]) -> WormBuilder<'_> { WormBuilder { builder: crate::ProtoBuilder::new(buf), } } pub fn name(mut self, value: &str) -> crate::Result { self.builder.write_string(1, value)?; Ok(self) } pub fn variant(mut self, value: i32) -> crate::Result { self.builder.write_int32(2, value)?; Ok(self) } pub fn size_bytes(mut self, value: u64) -> crate::Result { self.builder.write_varint(3, value)?; Ok(self) } pub fn payload(mut self, value: &[u8]) -> crate::Result { self.builder.write_bytes(4, value)?; Ok(self) } pub fn polymorphic(mut self, value: u64) -> crate::Result { self.builder.write_varint(5, value)?; Ok(self) } pub fn targets(mut self, value: &str) -> crate::Result { self.builder.write_string(6, value)?; Ok(self) } pub fn finish(self) -> crate::Result<&'b mut [u8]> { self.builder.finish() } } pub struct Operation<'a> { accessor: crate::ProtoAccessor<'a>, codename_offset: Option, target_corp_offset: Option, timestamp_offset: Option, successful_offset: Option, stolen_data_offset: Option, crew_start: Option, crew_end: Option, worm_offset: Option, log_entries_start: Option, log_entries_end: Option, severity_offset: Option, } impl<'a> Operation<'a> { pub fn new(data: &'a [u8]) -> crate::Result { let accessor = crate::ProtoAccessor::new(data)?; let mut codename_offset = None; let mut target_corp_offset = None; let mut timestamp_offset = None; let mut successful_offset = None; let mut stolen_data_offset = None; let mut crew_start = None; let mut crew_end = None; let mut worm_offset = None; let mut log_entries_start = None; let mut log_entries_end = None; let mut severity_offset = None; for item in accessor.fields() { let (offset, tag, _) = item?; if tag.field_number == 1 { codename_offset = Some(offset); } if tag.field_number == 2 { target_corp_offset = Some(offset); } if tag.field_number == 3 { timestamp_offset = Some(offset); } if tag.field_number == 4 { successful_offset = Some(offset); } if tag.field_number == 5 { stolen_data_offset = Some(offset); } if tag.field_number == 6 { if crew_start.is_none() { crew_start = Some(offset); } crew_end = Some(offset); } if tag.field_number == 7 { worm_offset = Some(offset); } if tag.field_number == 8 { if log_entries_start.is_none() { log_entries_start = Some(offset); } log_entries_end = Some(offset); } if tag.field_number == 9 { severity_offset = Some(offset); } } Ok(Self { accessor, codename_offset, target_corp_offset, timestamp_offset, successful_offset, stolen_data_offset, crew_start, crew_end, worm_offset, log_entries_start, log_entries_end, severity_offset, }) } pub fn codename(&self) -> crate::Result<&'a str> { let offset = self.codename_offset.ok_or(crate::RotoError::FieldNotFound)?; let (bytes, _) = self.accessor.get_value_at(offset)?; str::from_utf8(bytes).map_err(|_| crate::RotoError::WireFormatViolation) } pub fn target_corp(&self) -> crate::Result<&'a str> { let offset = self.target_corp_offset.ok_or(crate::RotoError::FieldNotFound)?; let (bytes, _) = self.accessor.get_value_at(offset)?; str::from_utf8(bytes).map_err(|_| crate::RotoError::WireFormatViolation) } pub fn timestamp(&self) -> crate::Result { let offset = self.timestamp_offset.ok_or(crate::RotoError::FieldNotFound)?; let (bytes, _) = self.accessor.get_value_at(offset)?; crate::read_varint(bytes).map(|(v, _)| v as i32).map_err(|_| crate::RotoError::WireFormatViolation) } pub fn successful(&self) -> crate::Result { let offset = self.successful_offset.ok_or(crate::RotoError::FieldNotFound)?; let (bytes, _) = self.accessor.get_value_at(offset)?; crate::read_varint(bytes).map(|(v, _)| v != 0).map_err(|_| crate::RotoError::WireFormatViolation) } pub fn stolen_data(&self) -> crate::Result<&'a [u8]> { let offset = self.stolen_data_offset.ok_or(crate::RotoError::FieldNotFound)?; let (bytes, _) = self.accessor.get_value_at(offset)?; Ok(bytes) } pub fn crew(&self) -> crate::RepeatedFieldIterator<'a> { match (self.crew_start, self.crew_end) { (Some(start), Some(end)) => self.accessor.iter_repeated_range(6, start, end), _ => self.accessor.iter_repeated(6), } } pub fn worm(&self) -> crate::Result<&'a [u8]> { let offset = self.worm_offset.ok_or(crate::RotoError::FieldNotFound)?; let (bytes, _) = self.accessor.get_value_at(offset)?; Ok(bytes) } pub fn log_entries(&self) -> crate::RepeatedFieldIterator<'a> { match (self.log_entries_start, self.log_entries_end) { (Some(start), Some(end)) => self.accessor.iter_repeated_range(8, start, end), _ => self.accessor.iter_repeated(8), } } pub fn severity(&self) -> crate::Result { let offset = self.severity_offset.ok_or(crate::RotoError::FieldNotFound)?; let (bytes, _) = self.accessor.get_value_at(offset)?; crate::read_varint(bytes).map(|(v, _)| v as i32).map_err(|_| crate::RotoError::WireFormatViolation) } } pub struct OperationBuilder<'b> { builder: crate::ProtoBuilder<'b>, } impl<'b> OperationBuilder<'b> { pub fn builder(buf: &mut [u8]) -> OperationBuilder<'_> { OperationBuilder { builder: crate::ProtoBuilder::new(buf), } } pub fn codename(mut self, value: &str) -> crate::Result { self.builder.write_string(1, value)?; Ok(self) } pub fn target_corp(mut self, value: &str) -> crate::Result { self.builder.write_string(2, value)?; Ok(self) } pub fn timestamp(mut self, value: u64) -> crate::Result { self.builder.write_varint(3, value)?; Ok(self) } pub fn successful(mut self, value: u64) -> crate::Result { self.builder.write_varint(4, value)?; Ok(self) } pub fn stolen_data(mut self, value: &[u8]) -> crate::Result { self.builder.write_bytes(5, value)?; Ok(self) } pub fn crew(mut self, value: &[u8]) -> crate::Result { self.builder.write_bytes(6, value)?; Ok(self) } pub fn worm(mut self, value: &[u8]) -> crate::Result { self.builder.write_bytes(7, value)?; Ok(self) } pub fn log_entries(mut self, value: &str) -> crate::Result { self.builder.write_string(8, value)?; Ok(self) } pub fn severity(mut self, value: i32) -> crate::Result { self.builder.write_int32(9, value)?; Ok(self) } pub fn finish(self) -> crate::Result<&'b mut [u8]> { self.builder.finish() } } pub struct Campaign<'a> { accessor: crate::ProtoAccessor<'a>, name_offset: Option, operations_start: Option, operations_end: Option, total_bytes_stolen_offset: Option, } impl<'a> Campaign<'a> { pub fn new(data: &'a [u8]) -> crate::Result { let accessor = crate::ProtoAccessor::new(data)?; let mut name_offset = None; let mut operations_start = None; let mut operations_end = None; let mut total_bytes_stolen_offset = None; for item in accessor.fields() { let (offset, tag, _) = item?; if tag.field_number == 1 { name_offset = Some(offset); } if tag.field_number == 2 { if operations_start.is_none() { operations_start = Some(offset); } operations_end = Some(offset); } if tag.field_number == 3 { total_bytes_stolen_offset = Some(offset); } } Ok(Self { accessor, name_offset, operations_start, operations_end, total_bytes_stolen_offset, }) } pub fn name(&self) -> crate::Result<&'a str> { let offset = self.name_offset.ok_or(crate::RotoError::FieldNotFound)?; let (bytes, _) = self.accessor.get_value_at(offset)?; str::from_utf8(bytes).map_err(|_| crate::RotoError::WireFormatViolation) } pub fn operations(&self) -> crate::RepeatedFieldIterator<'a> { match (self.operations_start, self.operations_end) { (Some(start), Some(end)) => self.accessor.iter_repeated_range(2, start, end), _ => self.accessor.iter_repeated(2), } } pub fn total_bytes_stolen(&self) -> crate::Result { let offset = self.total_bytes_stolen_offset.ok_or(crate::RotoError::FieldNotFound)?; let (bytes, _) = self.accessor.get_value_at(offset)?; crate::read_varint(bytes).map(|(v, _)| v as i32).map_err(|_| crate::RotoError::WireFormatViolation) } } pub struct CampaignBuilder<'b> { builder: crate::ProtoBuilder<'b>, } impl<'b> CampaignBuilder<'b> { pub fn builder(buf: &mut [u8]) -> CampaignBuilder<'_> { CampaignBuilder { builder: crate::ProtoBuilder::new(buf), } } pub fn name(mut self, value: &str) -> crate::Result { self.builder.write_string(1, value)?; Ok(self) } pub fn operations(mut self, value: &[u8]) -> crate::Result { self.builder.write_bytes(2, value)?; Ok(self) } pub fn total_bytes_stolen(mut self, value: u64) -> crate::Result { self.builder.write_varint(3, value)?; Ok(self) } pub fn finish(self) -> crate::Result<&'b mut [u8]> { self.builder.finish() } }