sqlx_core/common/
mod.rs

1mod statement_cache;
2
3pub use statement_cache::StatementCache;
4use std::fmt::{Debug, Formatter};
5use std::ops::{Deref, DerefMut};
6
7/// A wrapper for `Fn`s that provides a debug impl that just says "Function"
8pub struct DebugFn<F: ?Sized>(pub F);
9
10impl<F: ?Sized> Deref for DebugFn<F> {
11    type Target = F;
12
13    fn deref(&self) -> &Self::Target {
14        &self.0
15    }
16}
17
18impl<F: ?Sized> DerefMut for DebugFn<F> {
19    fn deref_mut(&mut self) -> &mut Self::Target {
20        &mut self.0
21    }
22}
23
24impl<F: ?Sized> Debug for DebugFn<F> {
25    fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
26        f.debug_tuple("Function").finish()
27    }
28}