def dv.id

bend-osdev-acpi@0.1.1.0 · aml_device.bend:63

import bend-osdev-acpi@0.1.1.0/aml_device.bend as AmlDevice
import Base
import bend-osdev-word64@0.1.1.0/word64.bend as W
import bend-osdev-bytes@0.1.1.0/bytes.bend as B
import bend-osdev-acpi@0.1.1.0/error.bend as E
import bend-osdev-acpi@0.1.1.0/aml_value.bend as V

63def dv.id(v: V.AmlValue) -> Result<&2, &2, E.AcpiError, String>:
64  match v:
65    case V.AmlInt{x}:
66      Done{AmlEisaId.text(W.W64.lo(x))}
67    case V.AmlStr{t}:
68      Done{B.Octets.to_string(t)}
69    case _:
70      Fail{E.AcpiAmlBadType{"_HID is not an integer or a string"}}

Uses (7)

Used by (1)