pub trait VarReader {
// Required method
fn read(&self, var: &Variable) -> Result<(Vec<u8>, VariableFlags)>;
// Provided method
fn exists(&self, var: &Variable) -> Result<bool> { ... }
}
Expand description
Represents the capability of reading EFI variables
Required Methods§
sourcefn read(&self, var: &Variable) -> Result<(Vec<u8>, VariableFlags)>
fn read(&self, var: &Variable) -> Result<(Vec<u8>, VariableFlags)>
Read the EFI variable name
and return its attributes and raw value
The caller is responsible for allocating a large enough buffer to hold the value for the target variable. This interface is used since some backends (Windows) don’t have an API for reporting the value size before reading it.
Arguments
var
: variable to readvalue
: target buffer for returning the variable value
Return value
On success, number of bytes read and associated EFI variable flags.