[][src]Struct aml::Namespace

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]

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]

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]

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]

pub fn search(
    &self,
    path: &AmlName,
    starting_scope: &AmlName
) -> Result<(AmlName, AmlHandle), AmlError>
[src]

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]

pub fn traverse<F>(&mut self, f: F) -> Result<(), AmlError> where
    F: FnMut(&AmlName, &NamespaceLevel) -> Result<bool, AmlError>, 
[src]

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]

impl Debug for Namespace[src]

Auto Trait Implementations

impl Send for Namespace

impl Sync for Namespace

impl Unpin for Namespace

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.