pub trait DataFilesAvailability {
type Result<'err, T>;
// Required methods
fn map<T, U>(
v: Self::Result<'_, T>,
f: impl FnOnce(T) -> U,
) -> Self::Result<'_, U>;
fn zip<'err, T1, T2>(
v1: Self::Result<'err, T1>,
v2: Self::Result<'err, T2>,
) -> Self::Result<'err, (T1, T2)>;
fn make_result<T>(
value: Self::Result<'_, T>,
) -> Result<T, &UnavailableProperty>;
}Expand description
Helper trait to work with PropertiesResult
It is implemented by:
GuaranteedDataFiles: the common case, where data files are guaranteed to exist once a graph is loaded, in which caseSelf::Result<'err, T>is the same type asTOptionalDataFiles: when they are not, in which caseSelf::Result<T>is the same type asResult<T, &'err UnavailableProperty>.
Required Associated Types§
Required Methods§
fn map<T, U>( v: Self::Result<'_, T>, f: impl FnOnce(T) -> U, ) -> Self::Result<'_, U>
fn zip<'err, T1, T2>( v1: Self::Result<'err, T1>, v2: Self::Result<'err, T2>, ) -> Self::Result<'err, (T1, T2)>
fn make_result<T>(value: Self::Result<'_, T>) -> Result<T, &UnavailableProperty>
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.