Properties

Trait Properties 

Source
pub trait Properties:
    Send
    + Sync
    + 'static
    + Clone
    + Default
    + Debug {
    // Required methods
    fn with_phantom(self, phantom: bool) -> Self;
    fn phantom(&self) -> Option<bool>;
    fn with_hint(self, hint: Hint) -> Self;
    fn hint(&self) -> Option<Hint>;
    fn with_location(self, location: Location) -> Self;
    fn location(&self) -> Option<Location>;
    fn with_age(self, age: Age) -> Self;
    fn age(&self) -> Option<Age>;
}
Expand description

Entry level properties trait.

The in-memory only cache and the hybrid cache may have different properties implementations to minimize the overhead of necessary properties in different scenarios.

Required Methods§

Source

fn with_phantom(self, phantom: bool) -> Self

Set entry as a phantom entry.

A phantom entry will not be actually inserted into the in-memory cache. It is only used to keep the APIs consistent.

NOTE: This API is for internal usage only. It MUST NOT be exported publicly.

Source

fn phantom(&self) -> Option<bool>

If the entry is a phantom entry.

Source

fn with_hint(self, hint: Hint) -> Self

Set entry hint.

Source

fn hint(&self) -> Option<Hint>

Entry hint.

Source

fn with_location(self, location: Location) -> Self

Set entry location.

Source

fn location(&self) -> Option<Location>

Entry location.

Source

fn with_age(self, age: Age) -> Self

Set entry age.

Source

fn age(&self) -> Option<Age>

Entry age.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§