JsonRpcResponsePatterns<T> extension
Adds pattern-matching-related methods to JsonRpcResponse.
- on
Methods
-
map<
TResult extends Object?> (TResult $default(_JsonRpcResponse< T> value)) → TResult -
Available on JsonRpcResponse<
AT> , provided by the JsonRpcResponsePatterns extensionswitch-like method, using callbacks. -
mapOrNull<
TResult extends Object?> (TResult? $default(_JsonRpcResponse< T> value)?) → TResult? -
Available on JsonRpcResponse<
A variant ofT> , provided by the JsonRpcResponsePatterns extensionmapthat fallback to returningnull. -
maybeMap<
TResult extends Object?> (TResult $default(_JsonRpcResponse< T> value)?, {required TResult orElse()}) → TResult -
Available on JsonRpcResponse<
A variant ofT> , provided by the JsonRpcResponsePatterns extensionmapthat fallback to returningorElse. -
maybeWhen<
TResult extends Object?> (TResult $default(int id, String jsonrpc, JsonRpcError? error, T? result)?, {required TResult orElse()}) → TResult -
Available on JsonRpcResponse<
A variant ofT> , provided by the JsonRpcResponsePatterns extensionwhenthat fallback to anorElsecallback. -
when<
TResult extends Object?> (TResult $default(int id, String jsonrpc, JsonRpcError? error, T? result)) → TResult -
Available on JsonRpcResponse<
AT> , provided by the JsonRpcResponsePatterns extensionswitch-like method, using callbacks. -
whenOrNull<
TResult extends Object?> (TResult? $default(int id, String jsonrpc, JsonRpcError? error, T? result)?) → TResult? -
Available on JsonRpcResponse<
A variant ofT> , provided by the JsonRpcResponsePatterns extensionwhenthat fallback to returningnull