Enum aml::value::AmlValue[][src]

pub enum AmlValue {
Show 14 variants Boolean(bool), Integer(u64), String(String), OpRegion { region: RegionSpace, offset: u64, length: u64, parent_device: Option<AmlName>, }, Field { region: AmlHandle, flags: FieldFlags, offset: u64, length: u64, }, Device, Method { flags: MethodFlags, code: MethodCode, }, Buffer(Arc<Spinlock<Vec<u8>>>), BufferField { buffer_data: Arc<Spinlock<Vec<u8>>>, offset: u64, length: u64, }, Processor { id: u8, pblk_address: u32, pblk_len: u8, }, Mutex { sync_level: u8, }, Package(Vec<AmlValue>), PowerResource { system_level: u8, resource_order: u16, }, ThermalZone,
}

Variants

Boolean

Tuple Fields of Boolean

0: bool
Integer

Tuple Fields of Integer

0: u64
String

Tuple Fields of String

0: String
OpRegion

Describes an operation region. Some regions require other objects to be declared under their parent device (e.g. an _ADR object for a PciConfig region), in which case an absolute path to the object is stored in parent_device.

Fields of OpRegion

region: RegionSpaceoffset: u64length: u64parent_device: Option<AmlName>
Field

Describes a field unit within an operation region.

Fields of Field

region: AmlHandleflags: FieldFlagsoffset: u64length: u64
Device
Method

Fields of Method

flags: MethodFlagscode: MethodCode
Buffer

Tuple Fields of Buffer

0: Arc<Spinlock<Vec<u8>>>
BufferField

Fields of BufferField

buffer_data: Arc<Spinlock<Vec<u8>>>offset: u64

In bits.

length: u64

In bits.

Processor

Fields of Processor

id: u8pblk_address: u32pblk_len: u8
Mutex

Fields of Mutex

sync_level: u8
Package

Tuple Fields of Package

0: Vec<AmlValue>
PowerResource

Fields of PowerResource

system_level: u8resource_order: u16
ThermalZone

Implementations

Converts an AmlValue to the representation that should be used when concatenating it with other values, primarily by the DefConcat opcode. This will always produce a AmlValue::Integer, AmlValue::String, or AmlValue::Buffer, with other types being converted to strings containing the name of their type.

Turns an AmlValue returned from a _STA method into a StatusObject. Should only be called for values returned from _STA. If you need a StatusObject, but the device does not have a _STA method, use StatusObject::default().

Convert this value to a value of the same data, but with the given AML type, if possible, by converting the implicit conversions described in §19.3.5 of the spec.

The implicit conversions applied are: Buffer from: Integer, String, Debug BufferField from: Integer, Buffer, String, Debug DdbHandle from: Integer, Debug FieldUnit from: Integer,Buffer, String, Debug Integer from: Buffer, BufferField, DdbHandle, FieldUnit, String, Debug Package from: Debug String from: Integer, Buffer, Debug

Reads from a field of an opregion, returning either a AmlValue::Integer or an AmlValue::Buffer, depending on the size of the field.

Logically compare two AmlValues, according to the rules that govern opcodes like DefLEqual, DefLLess, etc. The type of self dictates the type that other will be converted to, and the method by which the values will be compared:

  • Integers are simply compared by numeric comparison
  • Strings and Buffers are compared lexicographically - other is compared byte-wise until a byte is discovered that is either less or greater than the corresponding byte of self. If the bytes are identical, the lengths are compared. Luckily, the Rust standard library implements lexicographic comparison of strings and [u8] for us already.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Converts self into T using Into<T>. Read more

Causes self to use its Binary implementation when Debug-formatted.

Causes self to use its Display implementation when Debug-formatted. Read more

Causes self to use its LowerExp implementation when Debug-formatted. Read more

Causes self to use its LowerHex implementation when Debug-formatted. Read more

Causes self to use its Octal implementation when Debug-formatted.

Causes self to use its Pointer implementation when Debug-formatted. Read more

Causes self to use its UpperExp implementation when Debug-formatted. Read more

Causes self to use its UpperHex implementation when Debug-formatted. Read more

Performs the conversion.

Performs the conversion.

Pipes by value. This is generally the method you want to use. Read more

Borrows self and passes that borrow into the pipe function. Read more

Mutably borrows self and passes that borrow into the pipe function. Read more

Borrows self, then passes self.borrow() into the pipe function. Read more

Mutably borrows self, then passes self.borrow_mut() into the pipe function. Read more

Borrows self, then passes self.as_ref() into the pipe function.

Mutably borrows self, then passes self.as_mut() into the pipe function. Read more

Borrows self, then passes self.deref() into the pipe function.

Mutably borrows self, then passes self.deref_mut() into the pipe function. Read more

Immutable access to a value. Read more

Mutable access to a value. Read more

Immutable access to the Borrow<B> of a value. Read more

Mutable access to the BorrowMut<B> of a value. Read more

Immutable access to the AsRef<R> view of a value. Read more

Mutable access to the AsMut<R> view of a value. Read more

Immutable access to the Deref::Target of a value. Read more

Mutable access to the Deref::Target of a value. Read more

Calls .tap() only in debug builds, and is erased in release builds.

Calls .tap_mut() only in debug builds, and is erased in release builds. Read more

Calls .tap_borrow() only in debug builds, and is erased in release builds. Read more

Calls .tap_borrow_mut() only in debug builds, and is erased in release builds. Read more

Calls .tap_ref() only in debug builds, and is erased in release builds. Read more

Calls .tap_ref_mut() only in debug builds, and is erased in release builds. Read more

Calls .tap_deref() only in debug builds, and is erased in release builds. Read more

Calls .tap_deref_mut() only in debug builds, and is erased in release builds. Read more

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

Attempts to convert self into T using TryInto<T>. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.