Safe Haskell | None |
---|---|
Language | Haskell2010 |
Support for invoking MethodHandler
s
Synopsis
- invokePurePromise :: InvokePureCtx m p r => MethodHandler m p r -> p -> m (Promise r)
- (?) :: InvokePureCtx m p r => MethodHandler m p r -> p -> m (Promise r)
- invokePure :: InvokePureCtx m p r => MethodHandler m p r -> p -> Fulfiller r -> m ()
- type InvokePureCtx m p r = (MonadThrow m, MonadSTM m, PrimMonad m, Decerialize r, ToStruct 'Const (Cerial 'Const p), ToStruct ('Mut (PrimState m)) (Cerial ('Mut (PrimState m)) p), Cerialize (PrimState m) p, FromPtr 'Const (Cerial 'Const r))
- invokeRaw :: (MonadThrow m, MonadSTM m, PrimMonad m, Decerialize r, Decerialize p, ToStruct 'Const (Cerial 'Const p), FromPtr 'Const (Cerial 'Const r)) => MethodHandler m p r -> Cerial 'Const p -> Fulfiller (Cerial 'Const r) -> m ()
Using high-level representations
invokePurePromise :: InvokePureCtx m p r => MethodHandler m p r -> p -> m (Promise r) Source #
Like invokePure
, but returns a promise instead of accepting a fulfiller.
(?) :: InvokePureCtx m p r => MethodHandler m p r -> p -> m (Promise r) Source #
Alias for invokePurePromise
invokePure :: InvokePureCtx m p r => MethodHandler m p r -> p -> Fulfiller r -> m () Source #
Like invokeRaw
, but uses the high-level representations of the data
types.
type InvokePureCtx m p r = (MonadThrow m, MonadSTM m, PrimMonad m, Decerialize r, ToStruct 'Const (Cerial 'Const p), ToStruct ('Mut (PrimState m)) (Cerial ('Mut (PrimState m)) p), Cerialize (PrimState m) p, FromPtr 'Const (Cerial 'Const r)) Source #
Shorthand for class contstraints needed to invoke a method using the high-level API.
Using low level representations
invokeRaw :: (MonadThrow m, MonadSTM m, PrimMonad m, Decerialize r, Decerialize p, ToStruct 'Const (Cerial 'Const p), FromPtr 'Const (Cerial 'Const r)) => MethodHandler m p r -> Cerial 'Const p -> Fulfiller (Cerial 'Const r) -> m () Source #
Invoke a method by passing it the low-level representation of its parameter,
and a Fulfiller
that can be used to supply (the low-level representation of)
its return value.