pub enum AdminRequest {
    PowerFullyOn {
        responder: AdminPowerFullyOnResponder,
    },
    Reboot {
        reason: RebootReason,
        responder: AdminRebootResponder,
    },
    RebootToBootloader {
        responder: AdminRebootToBootloaderResponder,
    },
    RebootToRecovery {
        responder: AdminRebootToRecoveryResponder,
    },
    Poweroff {
        responder: AdminPoweroffResponder,
    },
    Mexec {
        kernel_zbi: Vmo,
        data_zbi: Vmo,
        responder: AdminMexecResponder,
    },
    SuspendToRam {
        responder: AdminSuspendToRamResponder,
    },
}
Expand description

Provides methods to request that the system be transitioned into a supported power state.

Note (see https://fxbug.dev/42136295): These methods do not return until after the state transition has been completed. In most cases (e.g. Reboot), a successful transition means that the caller does not actually observe the completion because the system will be rebooted before the call is completed. The implication is that using a synchronous FIDL client with these methods will result in a blocked thread for the duration of the call, or even for the remainder of the component’s life (in the case of Reboot). Therefore, if a synchronous FIDL client is to be used with this protocol then care should be taken to avoid handling any shutdown-induced callbacks on the same thread that was used to initiate the transition. Example callbacks include [fuchsia.process.lifecycle/Lifecycle.Stop] and [fuchsia.hardware.power.statecontrol/RebootMethodsWatcher.OnReboot]. Alternatively, the caller could choose to use an asynchronous FIDL client with this protocol to avoid blocking their calling thread.

Variants§

§

PowerFullyOn

Asks the device to enter a fully on state.

§

Reboot

Asks the device to reboot.

Fields

§

RebootToBootloader

Asks the device to reboot into the bootloader.

§

RebootToRecovery

Asks the device to reboot into the recovery partition.

§

Poweroff

Asks all devices to enter a powered off state.

Fields

§

Mexec

Performs a kernel mexec.

It is expected that the ZBI items specified by zx_system_mexec_payload_get() have not yet been appended to the provided data ZBI.

Fields

§kernel_zbi: Vmo
§data_zbi: Vmo
§

SuspendToRam

Asks the device to enter the suspend to RAM (S3) power state. Currently only supported on x64. If a system state transition is already in progress then ZX_ERR_ALREADY_EXISTS is returned. If the device fails to reach the suspend power state then ZX_ERR_INTERNAL is returned. If the device successfully suspends, ZX_OK is returned when the device resumes.

Implementations§

Trait Implementations§

source§

impl Debug for AdminRequest

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T, D> Encode<Ambiguous1, D> for T
where D: ResourceDialect,

§

unsafe fn encode( self, _encoder: &mut Encoder<'_, D>, _offset: usize, _depth: Depth, ) -> Result<(), Error>

Encodes the object into the encoder’s buffers. Any handles stored in the object are swapped for Handle::INVALID. Read more
§

impl<T, D> Encode<Ambiguous2, D> for T
where D: ResourceDialect,

§

unsafe fn encode( self, _encoder: &mut Encoder<'_, D>, _offset: usize, _depth: Depth, ) -> Result<(), Error>

Encodes the object into the encoder’s buffers. Any handles stored in the object are swapped for Handle::INVALID. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more