# Default

class Default < T >(t: T ) : SafeWrapper < T > (source)

Default implementation of SafeWrapper that wraps a provided target.

#### Type Parameters

T

The type of the wrapped target

## Constructors

Default
Link copied to clipboard
constructor(t: T )

## Functions

safe
Link copied to clipboard
open fun < R > safe (block: T .() -> R): Result <R>

Executes a synchronous block on the target, catching any exceptions and returning a Result.

safeS
Link copied to clipboard
open suspend fun < R > safeS (block: suspend T .() -> R): Result <R>

Executes a suspending block on the target, catching any exceptions (except kotlinx.coroutines.CancellationException) and returning a Result.

unsafe
Link copied to clipboard
open fun < R > unsafe (block: T .() -> R): R

Executes a synchronous block on the target without exception handling.

unsafeS
Link copied to clipboard
open suspend fun < R > unsafeS (block: suspend T .() -> R): R

Executes a suspending block on the target without exception handling.

unsafeTarget
Link copied to clipboard
open override fun unsafeTarget (): T

Provides access to the underlying wrapped target object.