/// Maps a `StateError` resulting from a failed induction to a `RejectCode`.
Maps a `StateError` resulting from a failed induction to a `RejectCode`.
Maps a ` StateError ` resulting from a failed induction to a ` RejectCode ` .
fn reject_code_for_state_error(err: &StateError) -> RejectCode {
    match err {
        StateError::QueueFull { .. } => RejectCode::SysTransient,
        StateError::CanisterOutOfCycles(_) => RejectCode::SysTransient,
        StateError::CanisterNotFound(_) => RejectCode::DestinationInvalid,
        StateError::CanisterStopped(_) => RejectCode::CanisterReject,
        StateError::CanisterStopping(_) => RejectCode::CanisterReject,
        StateError::UnknownSubnetMethod(_) => RejectCode::CanisterReject,
        StateError::InvalidSubnetPayload => RejectCode::CanisterReject,
        StateError::OutOfMemory { .. } => RejectCode::SysTransient,
    }
}
fn reject_code_for_state_error ( err : & StateError ) -> RejectCode { match err { StateError :: QueueFull { .. } => RejectCode :: SysTransient , StateError :: CanisterOutOfCycles ( _ ) => RejectCode :: SysTransient , StateError :: CanisterNotFound ( _ ) => RejectCode :: DestinationInvalid , StateError :: CanisterStopped ( _ ) => RejectCode :: CanisterReject , StateError :: CanisterStopping ( _ ) => RejectCode :: CanisterReject , StateError :: UnknownSubnetMethod ( _ ) => RejectCode :: CanisterReject , StateError :: InvalidSubnetPayload => RejectCode :: CanisterReject , StateError :: OutOfMemory { .. } => RejectCode :: SysTransient , } }
Maps a `StateError` resulting from a failed induction to a `RejectCode`.
Maps a ` StateError ` resulting from a failed induction to a ` RejectCode ` .
err
&StateError