Struct warmy::Key
[−]
[src]
pub struct Key<T> { /* fields omitted */ }Key used to get resource.
This is the entry point of the Store. A key is a simple path with phantom typing, giving type
hints on the target resource.
Note: because of being a key, you must not provide an absolute nor canonicalized path: instead, you pass local paths without any leading characters (drop any
./for instance).
let the_key = Key::new("maps/deck_16/room_3.bsp");
Methods
impl<T> Key<T>[src]
fn new<P>(path: P) -> Self where
P: AsRef<Path>, [src]
P: AsRef<Path>,
Create a new key from a local path, without leading special characters.
fn as_path(&self) -> &Path[src]
Get the underlying path.
This path is relative to the root path of the store the key is used in.
Trait Implementations
impl<T> Clone for Key<T>[src]
fn clone(&self) -> Self[src]
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)1.0.0[src]
Performs copy-assignment from source. Read more
impl<T> Debug for Key<T>[src]
fn fmt(&self, f: &mut Formatter) -> Result<(), Error>[src]
Formats the value using the given formatter.
impl<T> Eq for Key<T>[src]
impl<T> Hash for Key<T>[src]
fn hash<H>(&self, state: &mut H) where
H: Hasher, [src]
H: Hasher,
Feeds this value into the given [Hasher]. Read more
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher, 1.3.0[src]
H: Hasher,
Feeds a slice of this type into the given [Hasher]. Read more
impl<T> PartialEq for Key<T>[src]
fn eq(&self, rhs: &Self) -> bool[src]
This method tests for self and other values to be equal, and is used by ==. Read more
fn ne(&self, other: &Rhs) -> bool1.0.0[src]
This method tests for !=.
impl<T> CacheKey for Key<T> where
T: 'static, [src]
T: 'static,