pub struct Map<'a, K = u32, V = u32>(/* private fields */);
Expand description
Map objects are integer-to-integer hash-maps.
The map can be specialized to work over other integer-like types, like char
s.
Implementations§
Source§impl<K, V> Map<'static, K, V>
impl<K, V> Map<'static, K, V>
Sourcepub fn new() -> Result<Self, AllocationError>
pub fn new() -> Result<Self, AllocationError>
Creates a new, initially empty map.
Source§impl<'a, K, V> Map<'a, K, V>
impl<'a, K, V> Map<'a, K, V>
Sourcepub fn clone_static(&self) -> Map<'static, K, V>
pub fn clone_static(&self) -> Map<'static, K, V>
Constructs a copy of the map with 'static
lifetime.
Sourcepub fn keys(&self) -> Result<Set<'static, K>, AllocationError>
pub fn keys(&self) -> Result<Set<'static, K>, AllocationError>
Gets the set of keys that have been defined.
Sourcepub fn values(&self) -> Result<Set<'static, V>, AllocationError>
pub fn values(&self) -> Result<Set<'static, V>, AllocationError>
Gets the set of values that are associated with a key.
Source§impl<'a, K, V> Map<'a, K, V>
impl<'a, K, V> Map<'a, K, V>
Sourcepub fn into_raw(self) -> *mut hb_map_t
pub fn into_raw(self) -> *mut hb_map_t
Converts the map into raw sys::hb_map_t
pointer.
This method transfers the ownership of the map to the caller. It is up to the caller to call
sys::hb_map_destroy
to free the object, or call Self::from_raw
to convert it back into Map
.
Sourcepub fn as_raw(&self) -> *mut hb_map_t
pub fn as_raw(&self) -> *mut hb_map_t
Exposes the raw inner pointer without transferring the ownership.
Unlike Self::into_raw
, this method does not transfer the ownership of the pointer to the caller.
Sourcepub unsafe fn from_raw(map: *mut hb_map_t) -> Self
pub unsafe fn from_raw(map: *mut hb_map_t) -> Self
Constructs a map from raw sys::hb_map_t
object.
§Safety
The given map
pointer must either be constructed by some Harfbuzz function, or be returned from
Self::into_raw
.