pub trait ResourceTypeMarker: TypeMarker {
type Borrowed<'a>;
// Required method
fn take_or_borrow(value: &mut Self::Owned) -> Self::Borrowed<'_>;
}
Expand description
A FIDL resource type marker.
Resource types are allowed to contain handles. As a result, they must be encoded by mutable reference so that handles can be zeroed out.
Required Associated Types§
Required Methods§
Sourcefn take_or_borrow(value: &mut Self::Owned) -> Self::Borrowed<'_>
fn take_or_borrow(value: &mut Self::Owned) -> Self::Borrowed<'_>
Cheaply converts from &mut Self::Owned
to Self::Borrowed
. For
HandleBased
types this is “take” (it returns an owned handle and
replaces value
with Handle::invalid
), and for all other types it is
“borrow” (just converts from one reference to another).
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.