binder::binder_impl

Trait IBinderInternal

Source
pub trait IBinderInternal: IBinder {
    // Required methods
    fn is_binder_alive(&self) -> bool;
    fn set_requesting_sid(&mut self, enable: bool);
    fn dump<F: AsRawFd>(
        &mut self,
        fp: &F,
        args: &[&str],
    ) -> Result<(), StatusCode>;
    fn get_extension(&mut self) -> Result<Option<SpIBinder>, StatusCode>;
    fn prepare_transact(&self) -> Result<Parcel, StatusCode>;
    fn submit_transact(
        &self,
        code: TransactionCode,
        data: Parcel,
        flags: TransactionFlags,
    ) -> Result<Parcel, StatusCode>;

    // Provided method
    fn transact<F: FnOnce(BorrowedParcel<'_>) -> Result<(), StatusCode>>(
        &self,
        code: TransactionCode,
        flags: TransactionFlags,
        input_callback: F,
    ) -> Result<Parcel, StatusCode> { ... }
}
Expand description

Internal interface of binder local or remote objects for making transactions.

This trait corresponds to the parts of the interface of the C++ IBinder class which are internal implementation details.

Required Methods§

Source

fn is_binder_alive(&self) -> bool

Is this object still alive?

Source

fn set_requesting_sid(&mut self, enable: bool)

Indicate that the service intends to receive caller security contexts.

Source

fn dump<F: AsRawFd>(&mut self, fp: &F, args: &[&str]) -> Result<(), StatusCode>

Dump this object to the given file handle

Source

fn get_extension(&mut self) -> Result<Option<SpIBinder>, StatusCode>

Get a new interface that exposes additional extension functionality, if available.

Source

fn prepare_transact(&self) -> Result<Parcel, StatusCode>

Create a Parcel that can be used with submit_transact.

Source

fn submit_transact( &self, code: TransactionCode, data: Parcel, flags: TransactionFlags, ) -> Result<Parcel, StatusCode>

Perform a generic operation with the object.

The provided Parcel must have been created by a call to prepare_transact on the same binder.

§Arguments
  • code - Transaction code for the operation.
  • data - Parcel with input data.
  • flags - Transaction flags, e.g. marking the transaction as asynchronous (FLAG_ONEWAY).

Provided Methods§

Source

fn transact<F: FnOnce(BorrowedParcel<'_>) -> Result<(), StatusCode>>( &self, code: TransactionCode, flags: TransactionFlags, input_callback: F, ) -> Result<Parcel, StatusCode>

Perform a generic operation with the object. This is a convenience method that internally calls prepare_transact followed by `submit_transact.

§Arguments
  • code - Transaction code for the operation
  • flags - Transaction flags, e.g. marking the transaction as asynchronous (FLAG_ONEWAY)
  • input_callback A callback for building the Parcel.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl<T: AsNative<AIBinder>> IBinderInternal for T