pub enum Value {
Null,
Object(ObjectData),
JavaString(String),
Enum(String, String),
Primitive(PrimitiveType),
Array(Vec<Value>),
PrimitiveArray(Vec<PrimitiveType>),
Class(String),
Loop(i32),
}
Expand description
The possible values written by Java’s serialization
Variants§
Null
A Java null reference
Object(ObjectData)
A ‘normal’ Java Object
JavaString(String)
A String. These are treated differently to normal objects.
Enum(String, String)
An instance of an Enum. Only the class name and variant name are available
Primitive(PrimitiveType)
A Java primitive - int, long, double etc
Array(Vec<Value>)
An array of Java Objects
PrimitiveArray(Vec<PrimitiveType>)
An array of Java Primitives
Class(String)
A class object eg java.lang.String. Only the name is recorded
Loop(i32)
A recursive reference to something containing this value The contained value is the number of steps out to read the target
Implementations§
source§impl Value
impl Value
sourcepub fn primitive(&self) -> &PrimitiveType
pub fn primitive(&self) -> &PrimitiveType
sourcepub fn array(&self) -> &[Value]
pub fn array(&self) -> &[Value]
Get the array of values this Value represents
Panics
If this value is not an array. Note, this method expects an array of objects and a primitive array will also panic. See primitive_array()
sourcepub fn primitive_array(&self) -> &[PrimitiveType]
pub fn primitive_array(&self) -> &[PrimitiveType]
sourcepub fn string(&self) -> &str
pub fn string(&self) -> &str
Get the string value the value represents. This is only used to get the string from a deserialised Java String and will not convert other types into strings.
Panics
If this value is not a JavaString
sourcepub fn object_data(&self) -> &ObjectData
pub fn object_data(&self) -> &ObjectData
Get the object data of the object this value represents.
Panics
If this value is not an instance of an object