Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit bc732e71 authored by Treehugger Robot's avatar Treehugger Robot Committed by Automerger Merge Worker
Browse files

Merge "libbinder_rs: Fix broken documentation links" into main am: 5b533d28...

Merge "libbinder_rs: Fix broken documentation links" into main am: 5b533d28 am: 9cda6a9f am: 8943bca6

Original change: https://android-review.googlesource.com/c/platform/frameworks/native/+/2583293



Change-Id: Ica1c1c8438c96f5a2b29c33a715cfe0bb5667d6f
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents 90868988 8943bca6
Loading
Loading
Loading
Loading
+5 −5
Original line number Diff line number Diff line
@@ -97,8 +97,8 @@ where

/// Interface stability promise
///
/// An interface can promise to be a stable vendor interface ([`Vintf`]), or
/// makes no stability guarantees ([`Local`]). [`Local`] is
/// An interface can promise to be a stable vendor interface ([`Stability::Vintf`]),
/// or makes no stability guarantees ([`Stability::Local`]). [`Stability::Local`] is
/// currently the default stability.
#[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Default)]
pub enum Stability {
@@ -139,8 +139,8 @@ impl TryFrom<i32> for Stability {
/// via `Binder::new(object)`.
///
/// This is a low-level interface that should normally be automatically
/// generated from AIDL via the [`declare_binder_interface!`] macro. When using
/// the AIDL backend, users need only implement the high-level AIDL-defined
/// generated from AIDL via the [`crate::declare_binder_interface!`] macro.
/// When using the AIDL backend, users need only implement the high-level AIDL-defined
/// interface. The AIDL compiler then generates a container struct that wraps
/// the user-defined service and implements `Remotable`.
pub trait Remotable: Send + Sync {
@@ -297,7 +297,7 @@ impl InterfaceClass {
    /// Note: the returned pointer will not be constant. Calling this method
    /// multiple times for the same type will result in distinct class
    /// pointers. A static getter for this value is implemented in
    /// [`declare_binder_interface!`].
    /// [`crate::declare_binder_interface!`].
    pub fn new<I: InterfaceClassMethods>() -> InterfaceClass {
        let descriptor = CString::new(I::get_descriptor()).unwrap();
        let ptr = unsafe {
+2 −2
Original line number Diff line number Diff line
@@ -461,7 +461,7 @@ impl<'a> BorrowedParcel<'a> {
    /// and call a closure with the sub-parcel as its parameter.
    /// The closure can keep reading data from the sub-parcel
    /// until it runs out of input data. The closure is responsible
    /// for calling [`ReadableSubParcel::has_more_data`] to check for
    /// for calling `ReadableSubParcel::has_more_data` to check for
    /// more data before every read, at least until Rust generators
    /// are stabilized.
    /// After the closure returns, skip to the end of the current
@@ -595,7 +595,7 @@ impl Parcel {
    /// and call a closure with the sub-parcel as its parameter.
    /// The closure can keep reading data from the sub-parcel
    /// until it runs out of input data. The closure is responsible
    /// for calling [`ReadableSubParcel::has_more_data`] to check for
    /// for calling `ReadableSubParcel::has_more_data` to check for
    /// more data before every read, at least until Rust generators
    /// are stabilized.
    /// After the closure returns, skip to the end of the current
+5 −6
Original line number Diff line number Diff line
@@ -50,14 +50,14 @@ pub trait Parcelable {
    fn read_from_parcel(&mut self, parcel: &BorrowedParcel<'_>) -> Result<()>;
}

/// A struct whose instances can be written to a [`Parcel`].
/// A struct whose instances can be written to a [`crate::parcel::Parcel`].
// Might be able to hook this up as a serde backend in the future?
pub trait Serialize {
    /// Serialize this instance into the given [`Parcel`].
    /// Serialize this instance into the given [`crate::parcel::Parcel`].
    fn serialize(&self, parcel: &mut BorrowedParcel<'_>) -> Result<()>;
}

/// A struct whose instances can be restored from a [`Parcel`].
/// A struct whose instances can be restored from a [`crate::parcel::Parcel`].
// Might be able to hook this up as a serde backend in the future?
pub trait Deserialize: Sized {
    /// Type for the uninitialized value of this type. Will be either `Self`
@@ -80,10 +80,10 @@ pub trait Deserialize: Sized {
    /// Convert an initialized value of type `Self` into `Self::UninitType`.
    fn from_init(value: Self) -> Self::UninitType;

    /// Deserialize an instance from the given [`Parcel`].
    /// Deserialize an instance from the given [`crate::parcel::Parcel`].
    fn deserialize(parcel: &BorrowedParcel<'_>) -> Result<Self>;

    /// Deserialize an instance from the given [`Parcel`] onto the
    /// Deserialize an instance from the given [`crate::parcel::Parcel`] onto the
    /// current object. This operation will overwrite the old value
    /// partially or completely, depending on how much data is available.
    fn deserialize_from(&mut self, parcel: &BorrowedParcel<'_>) -> Result<()> {
@@ -880,7 +880,6 @@ impl<T: DeserializeOption> Deserialize for Option<T> {
/// `Serialize`, `SerializeArray` and `SerializeOption` for
/// structured parcelables. The target type must implement the
/// `Parcelable` trait.
/// ```
#[macro_export]
macro_rules! impl_serialize_for_parcelable {
    ($parcelable:ident) => {
+4 −4
Original line number Diff line number Diff line
@@ -574,7 +574,7 @@ impl Drop for WpIBinder {

/// Rust wrapper around DeathRecipient objects.
///
/// The cookie in this struct represents an Arc<F> for the owned callback.
/// The cookie in this struct represents an `Arc<F>` for the owned callback.
/// This struct owns a ref-count of it, and so does every binder that we
/// have been linked with.
///
@@ -667,7 +667,7 @@ impl DeathRecipient {
    ///
    /// # Safety
    ///
    /// The `cookie` parameter must be the cookie for an Arc<F> and
    /// The `cookie` parameter must be the cookie for an `Arc<F>` and
    /// the caller must hold a ref-count to it.
    unsafe extern "C" fn binder_died<F>(cookie: *mut c_void)
    where
@@ -682,7 +682,7 @@ impl DeathRecipient {
    ///
    /// # Safety
    ///
    /// The `cookie` parameter must be the cookie for an Arc<F> and
    /// The `cookie` parameter must be the cookie for an `Arc<F>` and
    /// the owner must give up a ref-count to it.
    unsafe extern "C" fn cookie_decr_refcount<F>(cookie: *mut c_void)
    where
@@ -695,7 +695,7 @@ impl DeathRecipient {
    ///
    /// # Safety
    ///
    /// The `cookie` parameter must be the cookie for an Arc<F> and
    /// The `cookie` parameter must be the cookie for an `Arc<F>` and
    /// the owner must handle the created ref-count properly.
    unsafe extern "C" fn cookie_incr_refcount<F>(cookie: *mut c_void)
    where