Coverage Report

Created: 2025-10-29 07:05

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/rust/registry/src/index.crates.io-1949cf8c6b5b557f/protobuf-3.7.2/src/rt/mod.rs
Line
Count
Source
1
//! # Functions and types used by generated protobuf code
2
//!
3
//! These are not considered to be public API of rust-protobuf,
4
//! so they can be changed any time (provided compatibility with
5
//! previously generated code is preserved).
6
7
pub(crate) mod map;
8
mod message;
9
pub(crate) mod packed;
10
pub(crate) mod repeated;
11
pub(crate) mod singular;
12
pub(crate) mod unknown_or_group;
13
14
pub use message::read_singular_message_into_field;
15
pub use message::write_message_field_with_cached_size;
16
pub use packed::vec_packed_bool_size;
17
pub use packed::vec_packed_double_size;
18
pub use packed::vec_packed_enum_or_unknown_size;
19
pub use packed::vec_packed_fixed32_size;
20
pub use packed::vec_packed_fixed64_size;
21
pub use packed::vec_packed_float_size;
22
pub use packed::vec_packed_int32_size;
23
pub use packed::vec_packed_int64_size;
24
pub use packed::vec_packed_sfixed32_size;
25
pub use packed::vec_packed_sfixed64_size;
26
pub use packed::vec_packed_sint32_size;
27
pub use packed::vec_packed_sint64_size;
28
pub use packed::vec_packed_uint32_size;
29
pub use packed::vec_packed_uint64_size;
30
pub use repeated::read_repeated_packed_enum_or_unknown_into;
31
pub use singular::bytes_size;
32
pub use singular::int32_size;
33
pub use singular::int64_size;
34
pub use singular::sint32_size;
35
pub use singular::sint64_size;
36
pub use singular::string_size;
37
pub use singular::uint32_size;
38
pub use singular::uint64_size;
39
pub use unknown_or_group::read_unknown_or_skip_group;
40
pub use unknown_or_group::skip_field_for_tag;
41
pub use unknown_or_group::unknown_fields_size;
42
43
pub use crate::cached_size::CachedSize;
44
pub use crate::lazy::Lazy;
45
use crate::varint::encode::encoded_varint64_len;
46
pub use crate::wire_format::WireType;
47
48
/// Given `u64` value compute varint encoded length.
49
0
pub fn compute_raw_varint64_size(value: u64) -> u64 {
50
0
    encoded_varint64_len(value) as u64
51
0
}
52
53
/// Given `u32` value compute varint encoded length.
54
0
pub(crate) fn compute_raw_varint32_size(value: u32) -> u64 {
55
0
    compute_raw_varint64_size(value as u64)
56
0
}
57
58
/// Compute tag size. Size of tag does not depend on wire type.
59
#[inline]
60
0
pub fn tag_size(field_number: u32) -> u64 {
61
0
    encoded_varint64_len((field_number as u64) << 3) as u64
62
0
}
Unexecuted instantiation: protobuf::rt::tag_size
Unexecuted instantiation: protobuf::rt::tag_size