Skip to main content

flash_lso/amf0/writer/
cache_key.rs

1/// An identifier for a cacheable element
2#[derive(Copy, Clone, Debug, PartialEq, Eq, PartialOrd, Ord, Hash)]
3pub struct CacheKey(usize);
4
5impl CacheKey {
6    /// Create a `CacheKey` from a pointer representing an element to be serialized
7    pub fn from_ptr<T>(p: *const T) -> Self {
8        Self(p as usize)
9    }
10}