#[repr(i32)]pub enum ProtocolAbiVersion {
Unspecified = 0,
V1 = 1,
V2 = 2,
}Expand description
A shared memory layout and the operations that send its data to the service. The versions are independent: v2 does not imply v1. The producer sends a bitmask of its versions in InitializeConnectionRequest. The service returns the bitmask of common versions. This exchange does not select a writer for an instance.
Each value is a single bit, so a uint32 mask holds a set of versions. A new version must take the next unused bit: 4, then 8.
Keep in sync with ProtocolAbiVersion in include/perfetto/ext/tracing/core/tracing_service.h, which describes each version in detail.
Variants§
Unspecified = 0
Reserved. Do not advertise this value.
V1 = 1
The original protocol: a shared memory buffer (SMB) of pages and chunks, with CommitData IPCs and patches. Docs: https://perfetto.dev/docs/design-docs/api-and-abi#shmem-abi.
V2 = 2
Tracing v2: a ring buffer that the producer allocates, shared with AttachV2RingBuffer and read on DrainV2RingBuffer. It is experimental and its ABI is not stable yet. Design: RFC-0014, https://github.com/google/perfetto/discussions/4508.
Implementations§
Source§impl ProtocolAbiVersion
impl ProtocolAbiVersion
Sourcepub const fn is_valid(value: i32) -> bool
pub const fn is_valid(value: i32) -> bool
Returns true if value is a variant of ProtocolAbiVersion.
Sourcepub fn from_i32(value: i32) -> Option<ProtocolAbiVersion>
👎Deprecated: Use the TryFrom<i32> implementation instead
pub fn from_i32(value: i32) -> Option<ProtocolAbiVersion>
Use the TryFrom<i32> implementation instead
Converts an i32 to a ProtocolAbiVersion, or None if value is not a valid variant.
Source§impl ProtocolAbiVersion
impl ProtocolAbiVersion
Sourcepub fn as_str_name(&self) -> &'static str
pub fn as_str_name(&self) -> &'static str
String value of the enum field names used in the ProtoBuf definition.
The values are not transformed in any way and thus are considered stable (if the ProtoBuf definition does not change) and safe for programmatic use.
Sourcepub fn from_str_name(value: &str) -> Option<Self>
pub fn from_str_name(value: &str) -> Option<Self>
Creates an enum from field names used in the ProtoBuf definition.