Enum jaded::Value[][src]

pub enum Value {
    Null,
    Object(ObjectData),
    JavaString(String),
    Enum(StringString),
    Primitive(PrimitiveType),
    Array(Vec<Value>),
    PrimitiveArray(Vec<PrimitiveType>),
    Class(String),
    Loop(i32),
}

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

impl Value[src]

pub fn primitive(&self) -> &PrimitiveType[src]

Get the primitive value this Value represents

Panics

If this value is not a primitive

pub fn array(&self) -> &[Value][src]

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

pub fn primitive_array(&self) -> &[PrimitiveType][src]

Get the array of primitive this Value represents

Panics

If this value is not an array of primitives

pub fn is_null(&self) -> bool[src]

Check if this value is a null reference

pub fn string(&self) -> &str[src]

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

pub fn object_data(&self) -> &ObjectData[src]

Get the object data of the object this value represents.

Panics

If this value is not an instance of an object

pub fn enum_data(&self) -> (&str, &str)[src]

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

Panics

If this value is not an enum

Trait Implementations

impl Debug for Value[src]

impl PartialEq<Value> for Value[src]

impl StructuralPartialEq for Value[src]

Auto Trait Implementations

impl RefUnwindSafe for Value

impl Send for Value

impl Sync for Value

impl Unpin for Value

impl UnwindSafe for Value

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.