#[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.
Implementations
sourceimpl RuntimeServices
impl RuntimeServices
sourcepub fn get_time_and_caps(&self) -> Result<(Time, TimeCapabilities)>
pub fn get_time_and_caps(&self) -> Result<(Time, TimeCapabilities)>
Query the current time and date information and the RTC capabilities
sourcepub unsafe fn set_time(&mut self, time: &Time) -> Result
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.
sourcepub fn get_variable_size(
&self,
name: &CStr16,
vendor: &VariableVendor
) -> Result<usize>
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
.
sourcepub fn get_variable<'a>(
&self,
name: &CStr16,
vendor: &VariableVendor,
buf: &'a mut [u8]
) -> Result<(&'a [u8], VariableAttributes)>
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.
sourcepub fn variable_keys(&self) -> Result<Vec<VariableKey>>
pub fn variable_keys(&self) -> Result<Vec<VariableKey>>
Get the names and vendor GUIDs of all currently-set variables.
sourcepub fn set_variable(
&self,
name: &CStr16,
vendor: &VariableVendor,
attributes: VariableAttributes,
data: &[u8]
) -> Result
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.
Trait Implementations
sourceimpl Debug for RuntimeServices
impl Debug for RuntimeServices
Auto Trait Implementations
impl RefUnwindSafe for RuntimeServices
impl Send for RuntimeServices
impl Sync for RuntimeServices
impl Unpin for RuntimeServices
impl UnwindSafe for RuntimeServices
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more