pub struct SupportedAttrs(/* private fields */);
Expand description
SetVariable
validation is incredibly tricky, since there are a lot of
subtle logic branches that are predicated on the presence (or lack thereof)
of various attribute bits.
In order to make the implementation a bit easier to understand and maintain,
we switch from using the full-featured EfiVariableAttributes
bitflags type
to a restricted subset of these flags described by SupportedAttrs
part-way
through SetVariable.
Implementations§
Source§impl SupportedAttrs
impl SupportedAttrs
Sourcepub const fn non_volatile(&self) -> bool
pub const fn non_volatile(&self) -> bool
Bits: 0..1
Sourcepub const fn with_non_volatile_checked(self, value: bool) -> Result<Self, ()>
pub const fn with_non_volatile_checked(self, value: bool) -> Result<Self, ()>
Bits: 0..1
Sourcepub const fn with_non_volatile(self, value: bool) -> Self
pub const fn with_non_volatile(self, value: bool) -> Self
Bits: 0..1
Sourcepub const fn set_non_volatile(&mut self, value: bool)
pub const fn set_non_volatile(&mut self, value: bool)
Bits: 0..1
Sourcepub const fn bootservice_access(&self) -> bool
pub const fn bootservice_access(&self) -> bool
Bits: 1..2
Sourcepub const fn with_bootservice_access_checked(
self,
value: bool,
) -> Result<Self, ()>
pub const fn with_bootservice_access_checked( self, value: bool, ) -> Result<Self, ()>
Bits: 1..2
Sourcepub const fn with_bootservice_access(self, value: bool) -> Self
pub const fn with_bootservice_access(self, value: bool) -> Self
Bits: 1..2
Sourcepub const fn set_bootservice_access(&mut self, value: bool)
pub const fn set_bootservice_access(&mut self, value: bool)
Bits: 1..2
Sourcepub const fn set_bootservice_access_checked(
&mut self,
value: bool,
) -> Result<(), ()>
pub const fn set_bootservice_access_checked( &mut self, value: bool, ) -> Result<(), ()>
Bits: 1..2
Sourcepub const fn runtime_access(&self) -> bool
pub const fn runtime_access(&self) -> bool
Bits: 2..3
Sourcepub const fn with_runtime_access_checked(self, value: bool) -> Result<Self, ()>
pub const fn with_runtime_access_checked(self, value: bool) -> Result<Self, ()>
Bits: 2..3
Sourcepub const fn with_runtime_access(self, value: bool) -> Self
pub const fn with_runtime_access(self, value: bool) -> Self
Bits: 2..3
Sourcepub const fn set_runtime_access(&mut self, value: bool)
pub const fn set_runtime_access(&mut self, value: bool)
Bits: 2..3
Sourcepub const fn set_runtime_access_checked(
&mut self,
value: bool,
) -> Result<(), ()>
pub const fn set_runtime_access_checked( &mut self, value: bool, ) -> Result<(), ()>
Bits: 2..3
Sourcepub const fn hardware_error_record(&self) -> bool
pub const fn hardware_error_record(&self) -> bool
Bits: 3..4
Sourcepub const fn with_hardware_error_record_checked(
self,
value: bool,
) -> Result<Self, ()>
pub const fn with_hardware_error_record_checked( self, value: bool, ) -> Result<Self, ()>
Bits: 3..4
Sourcepub const fn with_hardware_error_record(self, value: bool) -> Self
pub const fn with_hardware_error_record(self, value: bool) -> Self
Bits: 3..4
Sourcepub const fn set_hardware_error_record(&mut self, value: bool)
pub const fn set_hardware_error_record(&mut self, value: bool)
Bits: 3..4
Sourcepub const fn set_hardware_error_record_checked(
&mut self,
value: bool,
) -> Result<(), ()>
pub const fn set_hardware_error_record_checked( &mut self, value: bool, ) -> Result<(), ()>
Bits: 3..4
Sourcepub const fn time_based_authenticated_write_access(&self) -> bool
pub const fn time_based_authenticated_write_access(&self) -> bool
Bits: 5..6
Sourcepub const fn with_time_based_authenticated_write_access_checked(
self,
value: bool,
) -> Result<Self, ()>
pub const fn with_time_based_authenticated_write_access_checked( self, value: bool, ) -> Result<Self, ()>
Bits: 5..6
Sourcepub const fn with_time_based_authenticated_write_access(
self,
value: bool,
) -> Self
pub const fn with_time_based_authenticated_write_access( self, value: bool, ) -> Self
Bits: 5..6
Sourcepub const fn set_time_based_authenticated_write_access(&mut self, value: bool)
pub const fn set_time_based_authenticated_write_access(&mut self, value: bool)
Bits: 5..6
Source§impl SupportedAttrs
impl SupportedAttrs
pub fn contains_unsupported_bits(&self) -> bool
Trait Implementations§
Source§impl Clone for SupportedAttrs
impl Clone for SupportedAttrs
Source§fn clone(&self) -> SupportedAttrs
fn clone(&self) -> SupportedAttrs
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for SupportedAttrs
impl Debug for SupportedAttrs
Source§impl Default for SupportedAttrs
impl Default for SupportedAttrs
Source§impl From<SupportedAttrs> for u32
impl From<SupportedAttrs> for u32
Source§fn from(v: SupportedAttrs) -> u32
fn from(v: SupportedAttrs) -> u32
Converts to this type from the input type.
Source§impl From<u32> for SupportedAttrs
impl From<u32> for SupportedAttrs
Source§impl PartialEq for SupportedAttrs
impl PartialEq for SupportedAttrs
impl Copy for SupportedAttrs
impl StructuralPartialEq for SupportedAttrs
Auto Trait Implementations§
impl Freeze for SupportedAttrs
impl RefUnwindSafe for SupportedAttrs
impl Send for SupportedAttrs
impl Sync for SupportedAttrs
impl Unpin for SupportedAttrs
impl UnwindSafe for SupportedAttrs
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more