pub struct JMap<'a: 'b, 'b> { /* private fields */ }
Expand description

Wrapper for JObjects that implement java/util/Map. Provides methods to get and set entries and a way to iterate over key/value pairs.

Looks up the class and method ids on creation rather than for every method call.

Implementations

Create a map from the environment and an object. This looks up the necessary class and method ids to call all of the methods on it so that exra work doesn’t need to be done on every method call.

Look up the value for a key. Returns Some if it’s found and None if a null pointer would be returned.

Look up the value for a key. Returns Some with the old value if the key already existed and None if it’s a new key.

Remove a value from the map. Returns Some with the removed value and None if there was no value for the key.

Get key/value iterator for the map. This is done by getting the EntrySet from java and iterating over it.

Trait Implementations

The resulting type after dereferencing.
Dereferences the value.
Converts to this type from the input type.

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.