binder

Trait FromIBinder

Source
pub trait FromIBinder: Interface {
    // Required method
    fn try_from(ibinder: SpIBinder) -> Result<Strong<Self>, StatusCode>;
}
Expand description

Interface for transforming a generic SpIBinder into a specific remote interface trait.

§Example

For Binder interface IFoo, the following implementation should be made:

impl FromIBinder for dyn IFoo {
    fn try_from(ibinder: SpIBinder) -> Result<Box<Self>> {
        // ...
    }
}

Required Methods§

Source

fn try_from(ibinder: SpIBinder) -> Result<Strong<Self>, StatusCode>

Try to interpret a generic Binder object as this interface.

Returns a trait object for the Self interface if this object implements that interface.

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§