Struct warmy::Key [] [src]

pub struct Key<T> where
    T: Load
{ /* fields omitted */ }

Key used to get resource.

This is the single type used to query into Store. A key is a DepKey with phantom typing, giving type hints on the target resource.

You can use the Key::path and Key::logical functions to create new keys.

let the_key = Key::path("maps/deck_16/room_3.bsp");

Methods

impl<T> Key<T> where
    T: Load<Key = PathKey>, 
[src]

[src]

Create a new key from a path.

Because the path needs to be canonicalized, this function might fail if the canonicalization cannot happen.

[src]

Get the underlying, canonicalized path.

impl<T> Key<T> where
    T: Load<Key = LogicalKey>, 
[src]

[src]

Create a new logical key.

[src]

Get the underlying name.

Trait Implementations

impl<T> Clone for Key<T> where
    T: Load,
    T::Key: Clone
[src]

[src]

Returns a copy of the value. Read more

1.0.0
[src]

Performs copy-assignment from source. Read more

impl<T> Debug for Key<T> where
    T: Load,
    T::Key: Debug
[src]

[src]

Formats the value using the given formatter.

impl<T> Eq for Key<T> where
    T: Load,
    T::Key: Eq
[src]

impl<T> Hash for Key<T> where
    T: Load,
    T::Key: Hash
[src]

[src]

Feeds this value into the given [Hasher]. Read more

1.3.0
[src]

Feeds a slice of this type into the given [Hasher]. Read more

impl<T> PartialEq for Key<T> where
    T: Load,
    T::Key: PartialEq
[src]

[src]

This method tests for self and other values to be equal, and is used by ==. Read more

1.0.0
[src]

This method tests for !=.

impl<T> CacheKey for Key<T> where
    T: 'static + Load,
    T::Key: Hash
[src]