cached_proc_macro_types-0.1.1/.cargo_vcs_info.json0000644000000001650000000000100156740ustar { "git": { "sha1": "f6f1710629314bcd3e8a56c49b110ecf9129427c" }, "path_in_vcs": "cached_proc_macro_types" }cached_proc_macro_types-0.1.1/Cargo.toml0000644000000016200000000000100136670ustar # THIS FILE IS AUTOMATICALLY GENERATED BY CARGO # # When uploading crates to the registry Cargo will automatically # "normalize" Cargo.toml files for maximal compatibility # with all versions of Cargo and also rewrite `path` dependencies # to registry (e.g., crates.io) dependencies. # # If you are reading this file be aware that the original Cargo.toml # will likely look very different (and much more reasonable). # See Cargo.toml.orig for the original contents. [package] edition = "2018" name = "cached_proc_macro_types" version = "0.1.1" authors = ["James Kominick "] description = "Generic cache implementations and simplified function memoization" documentation = "https://docs.rs/cached" readme = "README.md" keywords = [ "caching", "cache", "memoize", "lru", ] categories = ["caching"] license = "MIT" repository = "https://github.com/jaemk/cached" [dependencies] cached_proc_macro_types-0.1.1/Cargo.toml.orig000064400000000000000000000006521046102023000173540ustar 00000000000000[package] name = "cached_proc_macro_types" version = "0.1.1" authors = ["James Kominick "] description = "Generic cache implementations and simplified function memoization" repository = "https://github.com/jaemk/cached" documentation = "https://docs.rs/cached" readme = "README.md" categories = ["caching"] keywords = ["caching", "cache", "memoize", "lru"] license = "MIT" edition = "2018" [dependencies] cached_proc_macro_types-0.1.1/LICENSE000064400000000000000000000020571046102023000154730ustar 00000000000000MIT License Copyright (c) 2017 James Kominick Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. cached_proc_macro_types-0.1.1/README.md000064400000000000000000000000441046102023000157370ustar 00000000000000See https://crates.io/crates/cached cached_proc_macro_types-0.1.1/src/lib.rs000064400000000000000000000010671046102023000163710ustar 00000000000000/// Used to wrap a function result so callers can see whether the result was cached. #[derive(Clone)] pub struct Return { pub was_cached: bool, pub value: T, } impl Return { pub fn new(value: T) -> Self { Self { was_cached: false, value, } } } impl std::ops::Deref for Return { type Target = T; fn deref(&self) -> &Self::Target { &self.value } } impl std::ops::DerefMut for Return { fn deref_mut(&mut self) -> &mut Self::Target { &mut self.value } }