Struct InitializeConnectionRequest

Source
pub struct InitializeConnectionRequest {
    pub shared_memory_page_size_hint_bytes: Option<u32>,
    pub shared_memory_size_hint_bytes: Option<u32>,
    pub producer_name: Option<String>,
    pub smb_scraping_mode: Option<i32>,
    pub producer_provided_shmem: Option<bool>,
    pub sdk_version: Option<String>,
    pub shm_key_windows: Option<String>,
}
Expand description

Arguments for rpc InitializeConnection().

Fields§

§shared_memory_page_size_hint_bytes: Option<u32>

Optional. Provides a hint to the tracing service about the suggested size of the shared memory buffer pages. The service is not required to respect this if it has already another value in the configuration or if the hint is unreasonably large. Must be an integer multiple of 4096. See tradeoff considerations in shared_memory_abi.h.

§shared_memory_size_hint_bytes: Option<u32>

Optional. Provides a hint to the tracing service about the suggested size of the shared memory buffer. The service is not required to respect this and might return a smaller buffer.

§producer_name: Option<String>

Required to match the producer config set by the service to the correct producer.

§smb_scraping_mode: Option<i32>

If provided, overrides the service’s SMB scraping setting for the producer.

§producer_provided_shmem: Option<bool>

Since Android R, this request can also transport an FD for the producer’s shared memory buffer, if allocated by the producer (e.g. for startup tracing). In this case, |shared_memory_page_size_hint_bytes| is a required field, and describes the SMB’s page size. Note that the service may not accept this SMB (e.g. because it is too old or its size / page size are invalid) and instead allocate a new SMB which is provided in the SetupTracing response. See TracingService::ConnectProducer() and |using_shmem_provided_by_producer| in InitializeConnectionResponse.

§sdk_version: Option<String>

The version of the client library used by the producer. This is a human readable string with and its format varies depending on the build system that is used to build the code and the repo (standalone vs AOSP). This is intended for human debugging only.

§shm_key_windows: Option<String>

On Windows, when producer_provided_shmem = true, the client creates a named SHM region and passes the name (an unguessable token) back to the service. Introduced in v13.

Implementations§

Source§

impl InitializeConnectionRequest

Source

pub fn shared_memory_page_size_hint_bytes(&self) -> u32

Returns the value of shared_memory_page_size_hint_bytes, or the default value if shared_memory_page_size_hint_bytes is unset.

Source

pub fn shared_memory_size_hint_bytes(&self) -> u32

Returns the value of shared_memory_size_hint_bytes, or the default value if shared_memory_size_hint_bytes is unset.

Source

pub fn producer_name(&self) -> &str

Returns the value of producer_name, or the default value if producer_name is unset.

Source

pub fn smb_scraping_mode(&self) -> ProducerSmbScrapingMode

Returns the enum value of smb_scraping_mode, or the default if the field is unset or set to an invalid enum value.

Source

pub fn set_smb_scraping_mode(&mut self, value: ProducerSmbScrapingMode)

Sets smb_scraping_mode to the provided enum value.

Source

pub fn producer_provided_shmem(&self) -> bool

Returns the value of producer_provided_shmem, or the default value if producer_provided_shmem is unset.

Source

pub fn shm_key_windows(&self) -> &str

Returns the value of shm_key_windows, or the default value if shm_key_windows is unset.

Source

pub fn sdk_version(&self) -> &str

Returns the value of sdk_version, or the default value if sdk_version is unset.

Trait Implementations§

Source§

impl Clone for InitializeConnectionRequest

Source§

fn clone(&self) -> InitializeConnectionRequest

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for InitializeConnectionRequest

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for InitializeConnectionRequest

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl Message for InitializeConnectionRequest

Source§

fn encoded_len(&self) -> usize

Returns the encoded length of the message without a length delimiter.
Source§

fn clear(&mut self)

Clears the message, resetting all fields to their default.
Source§

fn encode<B>(&self, buf: &mut B) -> Result<(), EncodeError>
where B: BufMut, Self: Sized,

Encodes the message to a buffer. Read more
Source§

fn encode_to_vec(&self) -> Vec<u8>
where Self: Sized,

Encodes the message to a newly allocated buffer.
Source§

fn encode_length_delimited<B>(&self, buf: &mut B) -> Result<(), EncodeError>
where B: BufMut, Self: Sized,

Encodes the message with a length-delimiter to a buffer. Read more
Source§

fn encode_length_delimited_to_vec(&self) -> Vec<u8>
where Self: Sized,

Encodes the message with a length-delimiter to a newly allocated buffer.
Source§

fn decode<B>(buf: B) -> Result<Self, DecodeError>
where B: Buf, Self: Default,

Decodes an instance of the message from a buffer. Read more
Source§

fn decode_length_delimited<B>(buf: B) -> Result<Self, DecodeError>
where B: Buf, Self: Default,

Decodes a length-delimited instance of the message from the buffer.
Source§

fn merge<B>(&mut self, buf: B) -> Result<(), DecodeError>
where B: Buf, Self: Sized,

Decodes an instance of the message from a buffer, and merges it into self. Read more
Source§

fn merge_length_delimited<B>(&mut self, buf: B) -> Result<(), DecodeError>
where B: Buf, Self: Sized,

Decodes a length-delimited instance of the message from buffer, and merges it into self.
Source§

impl PartialEq for InitializeConnectionRequest

Source§

fn eq(&self, other: &InitializeConnectionRequest) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl StructuralPartialEq for InitializeConnectionRequest

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.