Trait fidl::encoding::ResourceTypeMarker
source · 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).
Object Safety§
This trait is not object safe.