diff options
| author | mo khan <mo@mokhan.ca> | 2025-07-02 18:36:06 -0600 |
|---|---|---|
| committer | mo khan <mo@mokhan.ca> | 2025-07-02 18:36:06 -0600 |
| commit | 8cdfa445d6629ffef4cb84967ff7017654045bc2 (patch) | |
| tree | 22f0b0907c024c78d26a731e2e1f5219407d8102 /vendor/tower/src/ready_cache/error.rs | |
| parent | 4351c74c7c5f97156bc94d3a8549b9940ac80e3f (diff) | |
chore: add vendor directory
Diffstat (limited to 'vendor/tower/src/ready_cache/error.rs')
| -rw-r--r-- | vendor/tower/src/ready_cache/error.rs | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/vendor/tower/src/ready_cache/error.rs b/vendor/tower/src/ready_cache/error.rs new file mode 100644 index 00000000..08115f49 --- /dev/null +++ b/vendor/tower/src/ready_cache/error.rs @@ -0,0 +1,28 @@ +//! Errors + +/// An error indicating that the service with a `K`-typed key failed with an +/// error. +pub struct Failed<K>(pub K, pub crate::BoxError); + +// === Failed === + +impl<K: std::fmt::Debug> std::fmt::Debug for Failed<K> { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.debug_tuple("Failed") + .field(&self.0) + .field(&self.1) + .finish() + } +} + +impl<K> std::fmt::Display for Failed<K> { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + self.1.fmt(f) + } +} + +impl<K: std::fmt::Debug> std::error::Error for Failed<K> { + fn source(&self) -> Option<&(dyn std::error::Error + 'static)> { + Some(&*self.1) + } +} |
