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