Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
OTel.API.Context.Core.Internal
Contents
Synopsis
- newtype Context = Context {}
- emptyContext :: Context
- lookupContext :: ContextKey a -> Context -> Maybe a
- insertContext :: ContextKey a -> a -> Context -> Context
- data ContextKey a = ContextKey {}
- contextKeyName :: ContextKey a -> Text
- unsafeNewContextKey :: forall m a. MonadIO m => Text -> m (ContextKey a)
- attachContextValueUsing :: forall m a b. (MonadIO m, MonadMask m) => ContextBackend a -> a -> m b -> m b
- getAttachedContextValueUsing :: forall m a. (MonadIO m, MonadThrow m) => ContextBackend a -> m (Maybe a)
- getAttachedContextUsing :: forall m a. (MonadIO m, MonadThrow m) => ContextBackend a -> m Context
- data ContextBackend a = ContextBackend {}
- unsafeNewContextBackend :: forall m a. (MonadIO m, Typeable a) => m (ContextBackend a)
- data SomeContextBackend where
- newtype ContextBackendRegistry = ContextBackendRegistry {}
- emptyContextBackendRegistry :: IO ContextBackendRegistry
- registerContextBackend :: Unique -> ContextBackend a -> ContextBackendRegistry -> IO ()
- defaultContextBackendRegistry :: ContextBackendRegistry
Disclaimer
In general, changes to this module will not be reflected in the library's version updates. Direct use of this module should be done with utmost care, otherwise invariants will easily be violated.
lookupContext :: ContextKey a -> Context -> Maybe a Source #
insertContext :: ContextKey a -> a -> Context -> Context Source #
data ContextKey a Source #
Constructors
ContextKey | |
Fields
|
contextKeyName :: ContextKey a -> Text Source #
unsafeNewContextKey :: forall m a. MonadIO m => Text -> m (ContextKey a) Source #
attachContextValueUsing :: forall m a b. (MonadIO m, MonadMask m) => ContextBackend a -> a -> m b -> m b Source #
getAttachedContextValueUsing :: forall m a. (MonadIO m, MonadThrow m) => ContextBackend a -> m (Maybe a) Source #
getAttachedContextUsing :: forall m a. (MonadIO m, MonadThrow m) => ContextBackend a -> m Context Source #
data ContextBackend a Source #
Constructors
ContextBackend | |
unsafeNewContextBackend :: forall m a. (MonadIO m, Typeable a) => m (ContextBackend a) Source #
data SomeContextBackend where Source #
Constructors
SomeContextBackend :: ContextBackend a -> SomeContextBackend |
newtype ContextBackendRegistry Source #
Constructors
ContextBackendRegistry | |
Fields |
registerContextBackend :: Unique -> ContextBackend a -> ContextBackendRegistry -> IO () Source #