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§
Sourcefn is_binder_alive(&self) -> bool
fn is_binder_alive(&self) -> bool
Is this object still alive?
Sourcefn set_requesting_sid(&mut self, enable: bool)
fn set_requesting_sid(&mut self, enable: bool)
Indicate that the service intends to receive caller security contexts.
Sourcefn dump<F: AsRawFd>(&mut self, fp: &F, args: &[&str]) -> Result<(), StatusCode>
fn dump<F: AsRawFd>(&mut self, fp: &F, args: &[&str]) -> Result<(), StatusCode>
Dump this object to the given file handle
Sourcefn get_extension(&mut self) -> Result<Option<SpIBinder>, StatusCode>
fn get_extension(&mut self) -> Result<Option<SpIBinder>, StatusCode>
Get a new interface that exposes additional extension functionality, if available.
Sourcefn prepare_transact(&self) -> Result<Parcel, StatusCode>
fn prepare_transact(&self) -> Result<Parcel, StatusCode>
Create a Parcel that can be used with submit_transact
.
Sourcefn submit_transact(
&self,
code: TransactionCode,
data: Parcel,
flags: TransactionFlags,
) -> Result<Parcel, StatusCode>
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§
Sourcefn transact<F: FnOnce(BorrowedParcel<'_>) -> Result<(), StatusCode>>(
&self,
code: TransactionCode,
flags: TransactionFlags,
input_callback: F,
) -> Result<Parcel, StatusCode>
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 operationflags
- Transaction flags, e.g. marking the transaction as asynchronous (FLAG_ONEWAY
)input_callback
A callback for building theParcel
.
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.