Struct jaded::AnnotationIter

source ·
pub struct AnnotationIter<'a> { /* private fields */ }
Expand description

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§

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

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

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

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

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

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

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

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

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

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§

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.