Start drafting out flags datatype generation (#11)
* Adds support for flags datatype This commit adds support for `FlagsDatatype`. In WASI, flags are represented as bitfields/bitflags, therefore, it is important for the type to have bitwise operations implemented, and some way of checking whether the current set of flags contains some other set (i.e., they intersect). Thus, this commit automatically derives `BitAnd`, etc. for the derived flags datatype. It also automatically provides an `ALL_FLAGS` value which corresponds to a bitwise-or of all flag values present and is provided for convenience. * Simplify read_from_guest
This commit is contained in:
@@ -3,6 +3,8 @@ use thiserror::Error;
|
||||
|
||||
#[derive(Debug, Error, PartialEq, Eq)]
|
||||
pub enum GuestError {
|
||||
#[error("Invalid flag value {0}")]
|
||||
InvalidFlagValue(&'static str),
|
||||
#[error("Invalid enum value {0}")]
|
||||
InvalidEnumValue(&'static str),
|
||||
#[error("Pointer out of bounds: {0:?}")]
|
||||
|
||||
Reference in New Issue
Block a user