Type Definition ext_php_rs::bindings::HashTable[][src]

pub type HashTable = _zend_array;

Implementations

Returns the current number of elements in the array.

Returns whether the hash table is empty.

Clears the hash table, removing all values.

Attempts to retrieve a value from the hash table with a string key.

Parameters

  • key - The key to search for in the hash table.

Returns

  • Some(&Zval) - A reference to the zval at the position in the hash table.
  • None - No value at the given position was found.

Attempts to retrieve a value from the hash table with an index.

Parameters

  • key - The key to search for in the hash table.

Returns

  • Some(&Zval) - A reference to the zval at the position in the hash table.
  • None - No value at the given position was found.

Attempts to remove a value from the hash table with a string key.

Parameters

  • key - The key to remove from the hash table.

Returns

  • Some(()) - Key was successfully removed.
  • None - No key was removed, did not exist.

Attempts to remove a value from the hash table with a string key.

Parameters

  • key - The key to remove from the hash table.

Returns

  • Ok(()) - Key was successfully removed.
  • None - No key was removed, did not exist.

Attempts to insert an item into the hash table, or update if the key already exists. Returns nothing in a result if successful.

Parameters

  • key - The key to insert the value at in the hash table.
  • value - The value to insert into the hash table.

Inserts an item into the hash table at a specified index, or updates if the key already exists. Returns nothing in a result if successful.

Parameters

  • key - The index at which the value should be inserted.
  • val - The value to insert into the hash table.

Pushes an item onto the end of the hash table. Returns a result containing nothing if the element was sucessfully inserted.

Parameters

  • val - The value to insert into the hash table.

Returns an iterator over the key(s) and value contained inside the hashtable.

Returns an iterator over the values contained inside the hashtable, as if it was a set or list.

Clones the hash table, returning an OwnedHashTable.

Trait Implementations

Formats the value using the given formatter. Read more

The corresponding type of the implemented value in PHP.

Attempts to retrieve an instance of Self from a reference to a Zval. Read more