pub trait CloseValueRef: Sealed {
type Closed;
// Required method
fn close_ref(&self) -> Self::Closed;
}Expand description
Close a value without taking ownership
This trait is meant to be used for CloseValue impls for smart-pointer-like
types, as in
use metrique::{CloseValue, CloseValueRef};
struct Smaht<T>(T);
impl<T: CloseValueRef> CloseValue for &'_ Smaht<T> {
type Closed = T::Closed;
fn close(self) -> T::Closed { self.0.close_ref() }
}
impl<T: CloseValueRef> CloseValue for Smaht<T> {
type Closed = T::Closed;
fn close(self) -> T::Closed { self.0.close_ref() }
}This trait is not to be implemented or called directly. It mostly exists because it makes trait inference a bit smarter (it’s also not a full trait alias due to trait inference reasons).
Required Associated Types§
Required Methods§
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".