Struct uefi::table::runtime::RuntimeServices

source ·
#[repr(C)]
pub struct RuntimeServices(/* private fields */);
Expand description

Contains pointers to all of the runtime services.

This table, and the function pointers it contains are valid even after the UEFI OS loader and OS have taken control of the platform.

§Accessing RuntimeServices

A reference to RuntimeServices can only be accessed by calling SystemTable::runtime_services.

Implementations§

source§

impl RuntimeServices

source

pub fn get_time(&self) -> Result<Time>

Query the current time and date information

source

pub fn get_time_and_caps(&self) -> Result<(Time, TimeCapabilities)>

Query the current time and date information and the RTC capabilities

source

pub unsafe fn set_time(&mut self, time: &Time) -> Result

Sets the current local time and date information

During runtime, if a PC-AT CMOS device is present in the platform, the caller must synchronize access to the device before calling set_time.

§Safety

Undefined behavior could happen if multiple tasks try to use this function at the same time without synchronisation.

source

pub fn get_variable_size( &self, name: &CStr16, vendor: &VariableVendor ) -> Result<usize>

Get the size (in bytes) of a variable. This can be used to find out how big of a buffer should be passed in to get_variable.

source

pub fn get_variable<'a>( &self, name: &CStr16, vendor: &VariableVendor, buf: &'a mut [u8] ) -> Result<(&'a [u8], VariableAttributes)>

Get the contents and attributes of a variable. The size of buf must be at least as big as the variable’s size, although it can be larger. If it is too small, BUFFER_TOO_SMALL is returned.

On success, a tuple containing the variable’s value (a slice of buf) and the variable’s attributes is returned.

source

pub fn get_variable_boxed( &self, name: &CStr16, vendor: &VariableVendor ) -> Result<(Box<[u8]>, VariableAttributes)>

Available on crate feature alloc only.

Get the contents and attributes of a variable.

source

pub fn variable_keys(&self) -> Result<Vec<VariableKey>>

Available on crate feature alloc only.

Get the names and vendor GUIDs of all currently-set variables.

source

pub fn set_variable( &self, name: &CStr16, vendor: &VariableVendor, attributes: VariableAttributes, data: &[u8] ) -> Result

Set the value of a variable. This can be used to create a new variable, update an existing variable, or (when the size of data is zero) delete a variable.

§Warnings

The Status::WARN_RESET_REQUIRED warning will be returned when using this function to transition the Secure Boot mode to setup mode or audit mode if the firmware requires a reboot for that operation.

source

pub fn delete_variable(&self, name: &CStr16, vendor: &VariableVendor) -> Result

Deletes a UEFI variable.

source

pub fn query_variable_info( &self, attributes: VariableAttributes ) -> Result<VariableStorageInfo>

Get information about UEFI variable storage space for the type of variable specified in attributes.

This operation is only supported starting with UEFI 2.0; earlier versions will fail with Status::UNSUPPORTED.

See VariableStorageInfo for details of the information returned.

source

pub fn reset(&self, rt: ResetType, status: Status, data: Option<&[u8]>) -> !

Resets the computer.

Trait Implementations§

source§

impl Debug for RuntimeServices

source§

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

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

impl Table for RuntimeServices

source§

const SIGNATURE: u64 = 6_220_110_259_551_098_194u64

A unique number assigned by the UEFI specification to the standard tables.

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> 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> Pointee for T

§

type Metadata = ()

The type for metadata in pointers and references to Self.
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.