Struct aml::Namespace [−][src]
pub struct Namespace { /* fields omitted */ }
Implementations
impl Namespace
[src]
pub fn new() -> Namespace
[src]
pub fn add_level(
&mut self,
path: AmlName,
typ: LevelType
) -> Result<(), AmlError>
[src]
&mut self,
path: AmlName,
typ: LevelType
) -> Result<(), AmlError>
Add a new level to the namespace. A “level” is named by a single NameSeg
, and can contain values, and
also other further sub-levels. Once a level has been created, AML values can be added to it with
add_value
.
Note
At first glance, you might expect DefDevice
to add a value of type Device
. However, because all
Devices
do is hold other values, we model them as namespace levels, and so they must be created
accordingly.
pub fn remove_level(&mut self, path: AmlName) -> Result<(), AmlError>
[src]
pub fn add_value(
&mut self,
path: AmlName,
value: AmlValue
) -> Result<AmlHandle, AmlError>
[src]
&mut self,
path: AmlName,
value: AmlValue
) -> Result<AmlHandle, AmlError>
Add a value to the namespace at the given path, which must be a normalized, absolute AML
name. If you want to add at a path relative to a given scope, use add_at_resolved_path
instead.
pub fn add_value_at_resolved_path(
&mut self,
path: AmlName,
scope: &AmlName,
value: AmlValue
) -> Result<AmlHandle, AmlError>
[src]
&mut self,
path: AmlName,
scope: &AmlName,
value: AmlValue
) -> Result<AmlHandle, AmlError>
Helper method for adding a value to the namespace at a path that is relative to the given scope. This operation involves a lot of error handling in parts of the parser, so is encapsulated here.
pub fn get(&self, handle: AmlHandle) -> Result<&AmlValue, AmlError>
[src]
pub fn get_mut(&mut self, handle: AmlHandle) -> Result<&mut AmlValue, AmlError>
[src]
pub fn get_handle(&self, path: &AmlName) -> Result<AmlHandle, AmlError>
[src]
pub fn get_by_path(&self, path: &AmlName) -> Result<&AmlValue, AmlError>
[src]
pub fn get_by_path_mut(
&mut self,
path: &AmlName
) -> Result<&mut AmlValue, AmlError>
[src]
&mut self,
path: &AmlName
) -> Result<&mut AmlValue, AmlError>
pub fn search(
&self,
path: &AmlName,
starting_scope: &AmlName
) -> Result<(AmlName, AmlHandle), AmlError>
[src]
&self,
path: &AmlName,
starting_scope: &AmlName
) -> Result<(AmlName, AmlHandle), AmlError>
Search for an object at the given path of the namespace, applying the search rules described in §5.3 of the ACPI specification, if they are applicable. Returns the resolved name, and the handle of the first valid object, if found.
pub fn search_for_level(
&self,
level_name: &AmlName,
starting_scope: &AmlName
) -> Result<AmlName, AmlError>
[src]
&self,
level_name: &AmlName,
starting_scope: &AmlName
) -> Result<AmlName, AmlError>
pub fn traverse<F>(&mut self, f: F) -> Result<(), AmlError> where
F: FnMut(&AmlName, &NamespaceLevel) -> Result<bool, AmlError>,
[src]
F: FnMut(&AmlName, &NamespaceLevel) -> Result<bool, AmlError>,
Traverse the namespace, calling f
on each namespace level. f
returns a Result<bool, AmlError>
-
errors terminate the traversal and are propagated, and the bool
on the successful path marks whether the
children of the level should also be traversed.
Trait Implementations
impl Clone for Namespace
[src]
fn clone(&self) -> Namespace
[src]
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Debug for Namespace
[src]
Auto Trait Implementations
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,