Enum jaded::Value

source ·
pub enum Value {
    Null,
    Object(ObjectData),
    JavaString(String),
    Enum(StringString),
    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(StringString)

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§

Get the primitive value this Value represents

Panics

If this value is not a primitive

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()

Get the array of primitive this Value represents

Panics

If this value is not an array of primitives

Check if this value is a null reference

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

Get the object data of the object this value represents.

Panics

If this value is not an instance of an object

Get the class name and variant name of the enum this value represents

Panics

If this value is not an enum

Trait Implementations§

Formats the value using the given formatter. Read more
This method tests for self and other values to be equal, and is used by ==.
This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.