Type Definition rscache::error::Result [−][src]
pub type Result<T> = Result<T, CacheError>;Expand description
A specialized result type for cache operations.
This type is broadly used across rscache for any operation which may produce a CacheError.
Examples
A convenience function that bubbles an rscache::Result to its caller:
use rscache::Cache;
use rscache::codec;
// Same result as Result<Vec<u8>, CacheError>
fn item_def_data(cache: &Cache) -> rscache::Result<Vec<u8>> {
let index_id = 2;
let archive_id = 10;
let buffer = cache.read(index_id, archive_id)?;
let buffer = codec::decode(&buffer)?;
Ok(buffer)
}