pub trait Contract {
type Error: From<&'static str>;
type WithPostInfo<T>;
type Result<T, E>;
// Required methods
fn map_post<I, O>(
v: Self::WithPostInfo<I>,
mapper: impl FnOnce(I) -> O,
) -> Self::WithPostInfo<O>;
fn with_default_post<T>(v: T) -> Self::WithPostInfo<T>;
}
Expand description
Contract configuration
Required Associated Types§
Sourcetype WithPostInfo<T>
type WithPostInfo<T>
Wrapper for Result Ok/Err value
Sourcetype Result<T, E>
type Result<T, E>
Return value of Callable
, expected to be of core::result::Result
type
Required Methods§
Sourcefn map_post<I, O>(
v: Self::WithPostInfo<I>,
mapper: impl FnOnce(I) -> O,
) -> Self::WithPostInfo<O>
fn map_post<I, O>( v: Self::WithPostInfo<I>, mapper: impl FnOnce(I) -> O, ) -> Self::WithPostInfo<O>
Map WithPostInfo
value
Sourcefn with_default_post<T>(v: T) -> Self::WithPostInfo<T>
fn with_default_post<T>(v: T) -> Self::WithPostInfo<T>
Wrap value with default post info
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.