feat(API): Close API connections after error

This commit is contained in:
Karolin Varner
2024-08-18 19:33:56 +02:00
parent 93cd266c68
commit 53e560191f
4 changed files with 75 additions and 13 deletions

View File

@@ -136,3 +136,17 @@ impl<T: Default> SwapWithDefaultExt for T {
self.swap_with(Self::default())
}
}
pub trait MoveExt {
/// Deliberately move the value
///
/// Usually employed to enforce an object being
/// dropped after use.
fn move_here(self) -> Self;
}
impl<T: Sized> MoveExt for T {
fn move_here(self) -> Self {
self
}
}