Created Request.storage() method

This commit is contained in:
Caleb Kleveter 2018-05-09 16:17:53 -05:00
parent 59ae30064b
commit e98ff7378e
No known key found for this signature in database
GPG Key ID: 30A5A6F3A0ED7EDA
1 changed files with 8 additions and 0 deletions

View File

@ -39,4 +39,12 @@ extension Request {
let storage = try self.privateContainer.make(Storage.self)
storage.cache[key] = value
}
/// Gets the `Storage` instance from the
/// request's private container.
///
/// - Returns: The request's private `Storage` instance.
public func storage()throws -> Storage {
return try self.privateContainer.make(Storage.self)
}
}