Skip to main content

NoController

Struct NoController 

Source
pub struct NoController;
Expand description

The default, host/test PowerController that performs no hardware action.

A PowerManager built with PowerManager::new holds a NoController. Its set_power_mode is an explicit, documented no-op that returns Ok(()) — the PowerManager still records the requested mode, so the manager behaves as a software bookkeeping layer, but no clock tree is reprogrammed and no peripheral is gated. Because it reports is_hardware == false, callers that require real transitions can detect its presence via PowerManager::has_hardware_controller or fail loudly with PowerManager::request_mode_strict.

Install a real BSP-provided PowerController with PowerManager::with_controller to get actual power transitions.

Trait Implementations§

Source§

impl Clone for NoController

Source§

fn clone(&self) -> NoController

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for NoController

Source§

impl Debug for NoController

Source§

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

Formats the value using the given formatter. Read more
Source§

impl Default for NoController

Source§

fn default() -> NoController

Returns the “default value” for a type. Read more
Source§

impl Eq for NoController

Source§

impl PartialEq for NoController

Source§

fn eq(&self, other: &NoController) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl PowerController for NoController

Source§

fn set_power_mode(&self, mode: PowerMode) -> Result<()>

No-op: records nothing at the hardware level and reports success so the owning PowerManager can act as a bookkeeping layer. See the type docs for the honesty contract.

Source§

fn is_hardware(&self) -> bool

Whether this controller drives real silicon. Read more
Source§

fn scale_cpu(&self, mode: PowerMode) -> Result<()>

Optional finer-grained hook: apply only the CPU-frequency scaling for mode (see PowerMode::cpu_freq_factor). Read more
Source§

fn gate_peripherals(&self, mode: PowerMode) -> Result<()>

Optional finer-grained hook: gate or ungate peripheral clocks/power for mode. Read more
Source§

impl StructuralPartialEq for NoController

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
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

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

Source§

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>,

Source§

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.