pub trait Encodable {
type Encoded: ZeroPadding;
const COPY_OPTIMIZATION: CopyOptimization<Self> = _;
}
Expand description
A type which can be encoded as FIDL.
Provided Associated Constants§
Sourceconst COPY_OPTIMIZATION: CopyOptimization<Self> = _
const COPY_OPTIMIZATION: CopyOptimization<Self> = _
An optimization flag that allows the bytes of this type to be copied directly during
encoding instead of calling encode
.
This optimization is disabled by default. To enable this optimization, you must unsafely
attest that Self
is trivially copyable using CopyOptimization::enable
or
CopyOptimization::enable_if
.
Required Associated Types§
Sourcetype Encoded: ZeroPadding
type Encoded: ZeroPadding
The wire type for the value.
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.