Represent value using algebra, subject to change: e.g. Enum, Variable { name, type, value }, etc. Should have cases for &str, enum, etc.
| 23 | /// Represent value using algebra, subject to change: e.g. Enum, Variable { name, type, value }, etc. |
| 24 | /// Should have cases for &str, enum, etc. |
| 25 | pub trait Val<A> { |
| 26 | type E; |
| 27 | |
| 28 | /// Allocate a memory address. Return true if this address is the first time being allocated. |
| 29 | fn alloc_env(&mut self, r: Addr) -> bool; |
| 30 | /// Set the Value at this memory address. |
| 31 | fn set_env(&mut self, r: Addr, v: Self::E); |
| 32 | |
| 33 | fn prim_v(&self, ty: &str, val: &[u8]) -> Self::E; |
| 34 | fn bytes_v(&self, ty: &str, val: Bytes) -> Self::E; |
| 35 | fn arr_v<I: Iterator<Item = Self::E>>(&self, iter: I) -> Self::E; |
| 36 | |
| 37 | /// The Addr must have been allocated already. |
| 38 | fn ref_v(&self, ty: &str, r: Addr) -> Self::E; |
| 39 | fn struct_v<I: Iterator<Item = (String, Self::E)>>(&self, ty: &str, fields: I) -> Self::E; |
| 40 | /// C style enum, no field |
| 41 | fn enumerate_v(&self, ty: &str, variant: &str) -> Self::E; |
| 42 | fn unit_v(&self) -> Self::E; |
| 43 | /// what we couldn't inspect |
| 44 | fn opaque_v(&self) -> Self::E; |
| 45 | } |
| 46 | |
| 47 | /// Rust extension to `Val`. |
| 48 | pub trait RVal<A>: Val<A> { |
nothing calls this directly
no outgoing calls
no test coverage detected