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 extensionmap
that 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 extensionmap
that 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 extensionwhen
that fallback to anorElse
callback. -
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 extensionwhen
that fallback to returningnull