Consider implementing a custom Result that contains 3 variants:
CacheHit - file was found in the cache.
CacheMiss - File was not found in cache, but was found in the filesystem.
Err - File was not found in either the cache or the fs.
An ok() method could resolve this back to the existing Option, or this Err case could be rolled into the existing CachedFile implementation and would redirect to the 404 handler when responding, meaning that get() would return just a plain CachedFile.
Consider implementing a custom Result that contains 3 variants:
An, or this Err case could be rolled into the existing
ok()
method could resolve this back to the existing OptionCachedFile
implementation and would redirect to the 404 handler when responding, meaning thatget()
would return just a plainCachedFile
.