#[repr(u8)]pub enum Unit {
Unit = 0,
}Expand description
The empty FIDL “unit” struct.
FIDL wire type layouts follow the same rules as C/C++ type layout rules. Because every object must have a unique address, the empty “unit” type must be be a single byte that is set to zero.
Variants§
Unit = 0
Empty structs are represented as a single 0u8.
Trait Implementations§
Source§impl Constrained for Unit
impl Constrained for Unit
Source§type Constraint = ()
type Constraint = ()
Type of constraint information for this type.
Source§fn validate(
_: Slot<'_, Unit>,
_: <Unit as Constrained>::Constraint,
) -> Result<(), ValidationError>
fn validate( _: Slot<'_, Unit>, _: <Unit as Constrained>::Constraint, ) -> Result<(), ValidationError>
Validate a slot of this type against a constraint. Can be called when
pointers/envelopes are just presence markers.
Source§impl<D> Decode<D> for Unitwhere
D: ?Sized,
impl<D> Decode<D> for Unitwhere
D: ?Sized,
Source§fn decode(
slot: Slot<'_, Unit>,
_: &mut D,
_: <Unit as Constrained>::Constraint,
) -> Result<(), DecodeError>
fn decode( slot: Slot<'_, Unit>, _: &mut D, _: <Unit as Constrained>::Constraint, ) -> Result<(), DecodeError>
Decodes a value into a slot using a decoder. Read more
Source§impl<E> Encode<Unit, E> for &()where
E: ?Sized,
impl<E> Encode<Unit, E> for &()where
E: ?Sized,
Source§fn encode(
self,
encoder: &mut E,
out: &mut MaybeUninit<Unit>,
constraint: (),
) -> Result<(), EncodeError>
fn encode( self, encoder: &mut E, out: &mut MaybeUninit<Unit>, constraint: (), ) -> Result<(), EncodeError>
Encodes this value into an encoder and output.
Source§const COPY_OPTIMIZATION: CopyOptimization<Self, W> = _
const COPY_OPTIMIZATION: CopyOptimization<Self, W> = _
Source§impl<E> Encode<Unit, E> for ()where
E: ?Sized,
impl<E> Encode<Unit, E> for ()where
E: ?Sized,
Source§fn encode(
self,
_: &mut E,
out: &mut MaybeUninit<Unit>,
_: (),
) -> Result<(), EncodeError>
fn encode( self, _: &mut E, out: &mut MaybeUninit<Unit>, _: (), ) -> Result<(), EncodeError>
Encodes this value into an encoder and output.
Source§const COPY_OPTIMIZATION: CopyOptimization<Self, W> = _
const COPY_OPTIMIZATION: CopyOptimization<Self, W> = _
Source§impl FromWire<Unit> for ()
impl FromWire<Unit> for ()
Source§const COPY_OPTIMIZATION: CopyOptimization<W, Self> = _
const COPY_OPTIMIZATION: CopyOptimization<W, Self> = _
Source§impl FromWireRef<Unit> for ()
impl FromWireRef<Unit> for ()
Source§fn from_wire_ref(_: &Unit)
fn from_wire_ref(_: &Unit)
Converts the given reference to this type.
Source§impl IntoNatural for Unit
impl IntoNatural for Unit
Source§impl Ord for Unit
impl Ord for Unit
Source§impl PartialOrd for Unit
impl PartialOrd for Unit
Source§impl Wire for Unit
impl Wire for Unit
Source§fn zero_padding(_: &mut MaybeUninit<Unit>)
fn zero_padding(_: &mut MaybeUninit<Unit>)
Writes zeroes to the padding for this type, if any.
impl Copy for Unit
impl Eq for Unit
impl StructuralPartialEq for Unit
Auto Trait Implementations§
impl Freeze for Unit
impl RefUnwindSafe for Unit
impl Send for Unit
impl Sync for Unit
impl Unpin for Unit
impl UnsafeUnpin for Unit
impl UnwindSafe for Unit
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> InstanceFromServiceTransport<T> for T
impl<T> InstanceFromServiceTransport<T> for T
Source§fn from_service_transport(handle: T) -> T
fn from_service_transport(handle: T) -> T
Converts the given service transport handle of type
T to Self