Cacheable<T extends Snowflake, S extends SnowflakeEntity> class
Null safety
Wraps SnowflakeEntity that can be taken from cache or optionally downloaded from API.
Always provides id of entity. download()
method tries to get entity from API and returns it upon success or
throws Error if something happens in the process.
- Implementers
Constructors
Properties
Methods
-
download(
) → Future< S> - Downloads entity from cache and caches result
-
getFromCache(
) → S? - Returns entity from cache or null if not present
-
getOrDownload(
) → FutureOr< S> - Returns entity from cache or tries to download from API if not found. If downloading is successful it caches results
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a non-existent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
override