Trait libre_pvz_resources::cached::ContainerWithKey
source · pub trait ContainerWithKey {
type Handle;
type Key: ?Sized;
type Value: ?Sized;
// Required methods
fn get_by_handle(&self, handle: Self::Handle) -> &Self::Value;
fn get_by_key(&self, key: &Self::Key) -> Option<Self::Handle>;
}
Expand description
Container of key-value pairs, equipped with a handle type to speed up lookup.
Required Associated Types§
Required Methods§
sourcefn get_by_handle(&self, handle: Self::Handle) -> &Self::Value
fn get_by_handle(&self, handle: Self::Handle) -> &Self::Value
Access the values in the container by handle. Should be a cheap operation.