Struct jaded::AnnotationIter[][src]

pub struct AnnotationIter<'a> { /* fields omitted */ }

Utility for reading things from annotations

This is intended to offer a similar interface to the ObjectInputStream used by Java classes that implement custom readObject methods.

Implementations

impl<'a> AnnotationIter<'a>[src]

pub fn read_u8(&mut self) -> ConversionResult<u8>[src]

Read byte from annotation

Errors

ConversionError::InvalidType

  • if there is not enough data
  • if the next item in the annotation is an object instead of binary data.

See

ObjectInputStream#readByte()

pub fn read_boolean(&mut self) -> ConversionResult<bool>[src]

Read boolean from annotation

Errors

ConversionError::InvalidType

  • if there is not enough data
  • if the next item in the annotation is an object instead of binary data.

See

ObjectInputStream#readBoolean()

pub fn read_i16(&mut self) -> ConversionResult<i16>[src]

Read short (i16) from annotation

Errors

ConversionError::InvalidType

  • if there is not enough data
  • if the next item in the annotation is an object instead of binary data.

See

ObjectInputStream#readShort()

pub fn read_i32(&mut self) -> ConversionResult<i32>[src]

Read int (i32) from annotation

Errors

ConversionError::InvalidType

  • if there is not enough data
  • if the next item in the annotation is an object instead of binary data.

See

ObjectInputStream#readInt()

pub fn read_i64(&mut self) -> ConversionResult<i64>[src]

Read long (i64) from annotation

Errors

ConversionError::InvalidType

  • if there is not enough data
  • if the next item in the annotation is an object instead of binary data.

See

ObjectInputStream#readLong()

pub fn read_f32(&mut self) -> ConversionResult<f32>[src]

Read float (f32) from annotation

Errors

ConversionError::InvalidType

  • if there is not enough data
  • if the next item in the annotation is an object instead of binary data.

See

ObjectInputStream#readFloat()

pub fn read_f64(&mut self) -> ConversionResult<f64>[src]

Read double (f64) from annotation

Errors

ConversionError::InvalidType

  • if there is not enough data
  • if the next item in the annotation is an object instead of binary data.

See

ObjectInputStream#readDouble()

pub fn read_char(&mut self) -> ConversionResult<char>[src]

Read char from annotation

Errors

ConversionError::InvalidType

  • if there is not enough data
  • if the next item in the annotation is an object instead of binary data.
  • if the bytes are not a valid UTF-8 character

See

ObjectInputStream#readChar()

pub fn read_object(&mut self) -> ConversionResult<&'a Value>[src]

Read an object from annotation

Errors

ConversionError::UnexpectedBlockData if the next item in annotation is binary data. ConversionError::MissingAnnotations if there are no more objects in this annotation

See

ObjectInputStream#readObject()

pub fn read_object_as<T: FromJava>(&mut self) -> ConversionResult<T>[src]

Read an object and convert it to a rust type

Errors

This method is the equivalent of T::from_value(read_object()?) so any errors raised by either method will be returned.

Auto Trait Implementations

impl<'a> RefUnwindSafe for AnnotationIter<'a>

impl<'a> Send for AnnotationIter<'a>

impl<'a> Sync for AnnotationIter<'a>

impl<'a> Unpin for AnnotationIter<'a>

impl<'a> UnwindSafe for AnnotationIter<'a>

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.