get(_:as:)
Gets a decodable value from the cache. Returns nil
if not found.
func get<T>(_ key: String, as type: T.Type) async throws -> T? where T : Decodable, T : Sendable
Gets a decodable value from the cache. Returns nil
if not found.
func get<T>(_ key: String, as type: T.Type) async throws -> T? where T : Decodable, T : Sendable
s5Vapor5CachePAAE3get_2asqd__SgSS_qd__mtYaKSeRd__s8SendableRd__lF
What are these?9AO4S
import Vapor
Vapor is a framework for building server applications, APIs and websites in Swift. It provides a safe, performant and scalable foundation for building large complex backends.
protocol Cache
Codable key-value pair cache.
@frozen struct String
A Unicode string value that is a collection of characters.
protocol Decodable
A type that can decode itself from an external representation.
protocol Sendable
func get<T>(_ key: String, as type: T.Type) -> EventLoopFuture<T?> where T : Decodable
Gets a decodable value from the cache. Returns nil
if not found.
func delete(_ key: String) -> EventLoopFuture<Void>
func delete(_ key: String) async throws
func get<T>(_ key: String) -> EventLoopFuture<T?> where T : Decodable
Gets a decodable value from the cache. Returns nil
if not found.
func get<T>(_ key: String) async throws -> T? where T : Decodable, T : Sendable
Gets a decodable value from the cache. Returns nil
if not found.
func set<T>(_ key: String, to value: T?) async throws where T : Encodable, T : Sendable
Sets an encodable value into the cache. Existing values are replaced. If nil
, removes value.
func set<T>(_ key: String, to value: T?, expiresIn expirationTime: CacheExpirationTime?) -> EventLoopFuture<Void> where T : Encodable
Sets an encodable value into the cache with an expiry time. Existing values are replaced. If nil
, removes value.
func set<T>(_ key: String, to value: T?, expiresIn expirationTime: CacheExpirationTime?) async throws where T : Encodable, T : Sendable
Sets an encodable value into the cache with an expiry time. Existing values are replaced. If nil
, removes value.