Maps and filters the get
value of the ZFiberRef
with the specified
partial function, returning a ZFiberRef
with a get
value that succeeds
with the result of the partial function if it is defined or else fails with
None
.
Maps and filters the get
value of the ZFiberRef
with the specified
partial function, returning a ZFiberRef
with a get
value that succeeds
with the result of the partial function if it is defined or else fails with
None
.
Transforms the set
value of the ZFiberRef
with the specified function.
Transforms the set
value of the ZFiberRef
with the specified function.
Transforms the set
value of the ZFiberRef
with the specified fallible
function.
Transforms the set
value of the ZFiberRef
with the specified fallible
function.
Transforms both the set
and get
values of the ZFiberRef
with the
specified functions.
Transforms both the set
and get
values of the ZFiberRef
with the
specified functions.
Transforms both the set
and get
values of the ZFiberRef
with the
specified fallible functions.
Transforms both the set
and get
values of the ZFiberRef
with the
specified fallible functions.
Transforms both the set
and get
errors of the ZFiberRef
with the
specified functions.
Transforms both the set
and get
errors of the ZFiberRef
with the
specified functions.
Filters the set
value of the ZFiberRef
with the specified predicate,
returning a ZFiberRef
with a set
value that succeeds if the predicate
is satisfied or else fails with None
.
Filters the set
value of the ZFiberRef
with the specified predicate,
returning a ZFiberRef
with a set
value that succeeds if the predicate
is satisfied or else fails with None
.
Filters the get
value of the ZFiberRef
with the specified predicate,
returning a ZFiberRef
with a get
value that succeeds if the predicate
is satisfied or else fails with None
.
Filters the get
value of the ZFiberRef
with the specified predicate,
returning a ZFiberRef
with a get
value that succeeds if the predicate
is satisfied or else fails with None
.
Folds over the error and value types of the ZFiberRef
.
Folds over the error and value types of the ZFiberRef
. This is a highly
polymorphic method that is capable of arbitrarily transforming the error
and value types of the ZFiberRef
. For most use cases one of the more
specific combinators implemented in terms of fold
will be more ergonomic
but this method is extremely useful for implementing new combinators.
Folds over the error and value types of the ZFiberRef
, allowing access to
the state in transforming the set
value.
Reads the value associated with the current fiber.
Gets the value associated with the current fiber and uses it to run the specified effect.
Returns the initial value or error.
Returns an IO
that runs with value
bound to the current fiber.
Returns a scoped effect that sets the value associated with the curent fiber to the specified value and restores it to its original value when the scope is closed.
Transforms the get
value of the ZFiberRef
with the specified function.
Transforms the get
value of the ZFiberRef
with the specified function.
Transforms the get
value of the ZFiberRef
with the specified fallible
function.
Transforms the get
value of the ZFiberRef
with the specified fallible
function.
Returns a read only view of the ZFiberRef
.
Returns a read only view of the ZFiberRef
.
Sets the value associated with the current fiber.
Returns a ThreadLocal
that can be used to interact with this FiberRef
from side effecting code.
Returns a ThreadLocal
that can be used to interact with this FiberRef
from side effecting code.
This feature is meant to be used for integration with side effecting
code, that needs to access fiber specific data, like MDC contexts and the
like. The returned ThreadLocal
will be backed by this FiberRef
on all
threads that are currently managed by ZIO, and behave like an ordinary
ThreadLocal
on all other threads.
Returns a write only view of the ZFiberRef
.
Returns a write only view of the ZFiberRef
.