#[non_exhaustive]pub enum IdlValue {
Null,
Number {
kind: IdlType,
dims: Vec<usize>,
real: Vec<f64>,
imag: Option<Vec<f64>>,
},
Str {
dims: Vec<usize>,
data: Vec<String>,
},
Struct {
name: String,
dims: Vec<usize>,
fields: Vec<String>,
elements: Vec<Vec<IdlValue>>,
},
Objects {
dims: Vec<usize>,
items: Vec<IdlValue>,
},
Pointer(i32),
}Expand description
A value read from a save file. Arrays have NumPy’s shape, which is IDL’s dimensions reversed:
IDL’s a[i, j] is element [j][i]. Data are in the file’s order, which is row-major in that
shape. A scalar has empty dims.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Null
A null pointer, or a pointer whose target is not in the file.
Number
Numbers, converted to f64 (64-bit integers beyond 2⁵³ lose precision); complex values
have an imaginary part.
Str
Strings, in Latin-1.
Struct
A structure array: the structure’s name, the field names, and for each element one value per field.
Objects
An array of pointers or object references, each replaced by its target.
Pointer(i32)
A pointer, before it is replaced by its target. Never returned by idl_decode.
Trait Implementations§
impl StructuralPartialEq for IdlValue
Auto Trait Implementations§
impl Freeze for IdlValue
impl RefUnwindSafe for IdlValue
impl Send for IdlValue
impl Sync for IdlValue
impl Unpin for IdlValue
impl UnsafeUnpin for IdlValue
impl UnwindSafe for IdlValue
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more