pub unsafe trait Wire:
'static
+ Sized
+ Constrained {
type Narrowed<'de>: Constrained<Constraint = Self::Constraint>;
// Required method
fn zero_padding(out: &mut MaybeUninit<Self>);
}Expand description
A FIDL wire type.
§Safety
§Lifetime erasure
Wire types allow for lifetime erasure and restoration. A type that
implements Wire may have an instance of its Narrowed
type erased by transmuting to an instance of itself.
It is only safe to expose values and mutable reference to the narrowed
versions of wire types. While type erased, it is only safe to expose shared
references to the implementing type (i.e. &'de Foo<'static>).
§Padding
zero_padding must write zeroes to (at least) the padding bytes of out.
Required Associated Types§
Sourcetype Narrowed<'de>: Constrained<Constraint = Self::Constraint>
type Narrowed<'de>: Constrained<Constraint = Self::Constraint>
The narrowed wire type, restricted to the 'de lifetime.
Required Methods§
Sourcefn zero_padding(out: &mut MaybeUninit<Self>)
fn zero_padding(out: &mut MaybeUninit<Self>)
Writes zeroes to the padding for this type, if any.
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.