{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE OverloadedStrings #-}
{-# OPTIONS_GHC -Wno-unused-imports #-}
{-# OPTIONS_GHC -Wno-dodgy-exports #-}
{-# OPTIONS_GHC -Wno-unused-matches #-}
{-# OPTIONS_GHC -Wno-orphans #-}
{-# OPTIONS_GHC -Wno-unticked-promoted-constructors #-}
{-# OPTIONS_GHC -Wno-name-shadowing #-}
module Capnp.Gen.Capnp.Rpc where
import qualified Capnp.Message as Message
import qualified Capnp.Untyped as Untyped
import qualified Capnp.Basics as Basics
import qualified Capnp.GenHelpers as GenHelpers
import qualified Capnp.Classes as Classes
import qualified GHC.Generics as Generics
import qualified Capnp.Bits as Std_
import qualified Data.Maybe as Std_
import qualified Capnp.GenHelpers.ReExports.Data.ByteString as BS
import qualified Prelude as Std_
import qualified Data.Word as Std_
import qualified Data.Int as Std_
import Prelude ((<$>), (<*>), (>>=))
newtype Message msg
    = Message'newtype_ (Untyped.Struct msg)
instance (Classes.FromStruct msg (Message msg)) where
    fromStruct :: Struct msg -> m (Message msg)
fromStruct Struct msg
struct = (Message msg -> m (Message msg)
forall (f :: * -> *) a. Applicative f => a -> f a
Std_.pure (Struct msg -> Message msg
forall (msg :: Mutability). Struct msg -> Message msg
Message'newtype_ Struct msg
struct))
instance (Classes.ToStruct msg (Message msg)) where
    toStruct :: Message msg -> Struct msg
toStruct (Message'newtype_ Struct msg
struct) = Struct msg
struct
instance (Untyped.HasMessage (Message mut) mut) where
    message :: Message mut -> Message mut
message (Message'newtype_ Struct mut
struct) = (Struct mut -> Message mut
forall a (mut :: Mutability). HasMessage a mut => a -> Message mut
Untyped.message Struct mut
struct)
instance (Untyped.MessageDefault (Message mut) mut) where
    messageDefault :: Message mut -> m (Message mut)
messageDefault Message mut
msg = (Struct mut -> Message mut
forall (msg :: Mutability). Struct msg -> Message msg
Message'newtype_ (Struct mut -> Message mut) -> m (Struct mut) -> m (Message mut)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (Message mut -> m (Struct mut)
forall a (mut :: Mutability) (m :: * -> *).
(MessageDefault a mut, ReadCtx m mut) =>
Message mut -> m a
Untyped.messageDefault Message mut
msg))
instance (Classes.FromPtr msg (Message msg)) where
    fromPtr :: Message msg -> Maybe (Ptr msg) -> m (Message msg)
fromPtr Message msg
msg Maybe (Ptr msg)
ptr = (Struct msg -> Message msg
forall (msg :: Mutability). Struct msg -> Message msg
Message'newtype_ (Struct msg -> Message msg) -> m (Struct msg) -> m (Message msg)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (Message msg -> Maybe (Ptr msg) -> m (Struct msg)
forall (mut :: Mutability) a (m :: * -> *).
(FromPtr mut a, ReadCtx m mut) =>
Message mut -> Maybe (Ptr mut) -> m a
Classes.fromPtr Message msg
msg Maybe (Ptr msg)
ptr))
instance (Classes.ToPtr s (Message (Message.Mut s))) where
    toPtr :: Message ('Mut s) -> Message ('Mut s) -> m (Maybe (Ptr ('Mut s)))
toPtr Message ('Mut s)
msg (Message'newtype_ Struct ('Mut s)
struct) = (Message ('Mut s) -> Struct ('Mut s) -> m (Maybe (Ptr ('Mut s)))
forall s a (m :: * -> *).
(ToPtr s a, WriteCtx m s) =>
Message ('Mut s) -> a -> m (Maybe (Ptr ('Mut s)))
Classes.toPtr Message ('Mut s)
msg Struct ('Mut s)
struct)
instance (Classes.Allocate s (Message (Message.Mut s))) where
    new :: Message ('Mut s) -> m (Message ('Mut s))
new Message ('Mut s)
msg = (Struct ('Mut s) -> Message ('Mut s)
forall (msg :: Mutability). Struct msg -> Message msg
Message'newtype_ (Struct ('Mut s) -> Message ('Mut s))
-> m (Struct ('Mut s)) -> m (Message ('Mut s))
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (Message ('Mut s) -> Word16 -> Word16 -> m (Struct ('Mut s))
forall (m :: * -> *) s.
WriteCtx m s =>
Message ('Mut s) -> Word16 -> Word16 -> m (Struct ('Mut s))
Untyped.allocStruct Message ('Mut s)
msg Word16
1 Word16
1))
instance (Basics.ListElem mut (Message mut)) where
    newtype List mut (Message mut)
        = Message'List_ (Untyped.ListOf mut (Untyped.Struct mut))
    listFromPtr :: Message mut -> Maybe (Ptr mut) -> m (List mut (Message mut))
listFromPtr Message mut
msg Maybe (Ptr mut)
ptr = (ListOf mut (Struct mut) -> List mut (Message mut)
forall (mut :: Mutability).
ListOf mut (Struct mut) -> List mut (Message mut)
Message'List_ (ListOf mut (Struct mut) -> List mut (Message mut))
-> m (ListOf mut (Struct mut)) -> m (List mut (Message mut))
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (Message mut -> Maybe (Ptr mut) -> m (ListOf mut (Struct mut))
forall (mut :: Mutability) a (m :: * -> *).
(FromPtr mut a, ReadCtx m mut) =>
Message mut -> Maybe (Ptr mut) -> m a
Classes.fromPtr Message mut
msg Maybe (Ptr mut)
ptr))
    toUntypedList :: List mut (Message mut) -> List mut
toUntypedList (Message'List_ l) = (ListOf mut (Struct mut) -> List mut
forall (mut :: Mutability). ListOf mut (Struct mut) -> List mut
Untyped.ListStruct ListOf mut (Struct mut)
l)
    length :: List mut (Message mut) -> Int
length (Message'List_ l) = (ListOf mut (Struct mut) -> Int
forall (msg :: Mutability) a. ListOf msg a -> Int
Untyped.length ListOf mut (Struct mut)
l)
    index :: Int -> List mut (Message mut) -> m (Message mut)
index Int
i (Message'List_ l) = (do
        Struct mut
elt <- (Int -> ListOf mut (Struct mut) -> m (Struct mut)
forall (m :: * -> *) (mut :: Mutability) a.
ReadCtx m mut =>
Int -> ListOf mut a -> m a
Untyped.index Int
i ListOf mut (Struct mut)
l)
        (Struct mut -> m (Message mut)
forall (mut :: Mutability) a (m :: * -> *).
(FromStruct mut a, ReadCtx m mut) =>
Struct mut -> m a
Classes.fromStruct Struct mut
elt)
        )
instance (Basics.MutListElem s (Message (Message.Mut s))) where
    setIndex :: Message ('Mut s) -> Int -> List ('Mut s) (Message ('Mut s)) -> m ()
setIndex (Message'newtype_ Struct ('Mut s)
elt) Int
i (Message'List_ l) = (Struct ('Mut s) -> Int -> ListOf ('Mut s) (Struct ('Mut s)) -> m ()
forall (m :: * -> *) s a.
RWCtx m s =>
a -> Int -> ListOf ('Mut s) a -> m ()
Untyped.setIndex Struct ('Mut s)
elt Int
i ListOf ('Mut s) (Struct ('Mut s))
l)
    newList :: Message ('Mut s) -> Int -> m (List ('Mut s) (Message ('Mut s)))
newList Message ('Mut s)
msg Int
len = (ListOf ('Mut s) (Struct ('Mut s))
-> List ('Mut s) (Message ('Mut s))
forall (mut :: Mutability).
ListOf mut (Struct mut) -> List mut (Message mut)
Message'List_ (ListOf ('Mut s) (Struct ('Mut s))
 -> List ('Mut s) (Message ('Mut s)))
-> m (ListOf ('Mut s) (Struct ('Mut s)))
-> m (List ('Mut s) (Message ('Mut s)))
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (Message ('Mut s)
-> Word16 -> Word16 -> Int -> m (ListOf ('Mut s) (Struct ('Mut s)))
forall (m :: * -> *) s.
WriteCtx m s =>
Message ('Mut s)
-> Word16 -> Word16 -> Int -> m (ListOf ('Mut s) (Struct ('Mut s)))
Untyped.allocCompositeList Message ('Mut s)
msg Word16
1 Word16
1 Int
len))
data Message' (mut :: Message.Mutability)
    = Message'unimplemented (Message mut)
    | Message'abort (Exception mut)
    | Message'call (Call mut)
    | Message'return (Return mut)
    | Message'finish (Finish mut)
    | Message'resolve (Resolve mut)
    | Message'release (Release mut)
    | Message'obsoleteSave (Std_.Maybe (Untyped.Ptr mut))
    | Message'bootstrap (Bootstrap mut)
    | Message'obsoleteDelete (Std_.Maybe (Untyped.Ptr mut))
    | Message'provide (Provide mut)
    | Message'accept (Accept mut)
    | Message'join (Join mut)
    | Message'disembargo (Disembargo mut)
    | Message'unknown' Std_.Word16
instance (Classes.FromStruct mut (Message' mut)) where
    fromStruct :: Struct mut -> m (Message' mut)
fromStruct Struct mut
struct = (do
        Word16
tag <- (Struct mut -> Int -> m Word16
forall (m :: * -> *) (mut :: Mutability).
ReadCtx m mut =>
Struct mut -> Int -> m Word16
GenHelpers.getTag Struct mut
struct Int
0)
        case Word16
tag of
            Word16
0 ->
                (Message mut -> Message' mut
forall (mut :: Mutability). Message mut -> Message' mut
Message'unimplemented (Message mut -> Message' mut)
-> m (Message mut) -> m (Message' mut)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (do
                    Maybe (Ptr mut)
ptr <- (Int -> Struct mut -> m (Maybe (Ptr mut))
forall (m :: * -> *) (msg :: Mutability).
ReadCtx m msg =>
Int -> Struct msg -> m (Maybe (Ptr msg))
Untyped.getPtr Int
0 Struct mut
struct)
                    (Message mut -> Maybe (Ptr mut) -> m (Message mut)
forall (mut :: Mutability) a (m :: * -> *).
(FromPtr mut a, ReadCtx m mut) =>
Message mut -> Maybe (Ptr mut) -> m a
Classes.fromPtr (Struct mut -> Message mut
forall a (mut :: Mutability). HasMessage a mut => a -> Message mut
Untyped.message Struct mut
struct) Maybe (Ptr mut)
ptr)
                    ))
            Word16
1 ->
                (Exception mut -> Message' mut
forall (mut :: Mutability). Exception mut -> Message' mut
Message'abort (Exception mut -> Message' mut)
-> m (Exception mut) -> m (Message' mut)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (do
                    Maybe (Ptr mut)
ptr <- (Int -> Struct mut -> m (Maybe (Ptr mut))
forall (m :: * -> *) (msg :: Mutability).
ReadCtx m msg =>
Int -> Struct msg -> m (Maybe (Ptr msg))
Untyped.getPtr Int
0 Struct mut
struct)
                    (Message mut -> Maybe (Ptr mut) -> m (Exception mut)
forall (mut :: Mutability) a (m :: * -> *).
(FromPtr mut a, ReadCtx m mut) =>
Message mut -> Maybe (Ptr mut) -> m a
Classes.fromPtr (Struct mut -> Message mut
forall a (mut :: Mutability). HasMessage a mut => a -> Message mut
Untyped.message Struct mut
struct) Maybe (Ptr mut)
ptr)
                    ))
            Word16
2 ->
                (Call mut -> Message' mut
forall (mut :: Mutability). Call mut -> Message' mut
Message'call (Call mut -> Message' mut) -> m (Call mut) -> m (Message' mut)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (do
                    Maybe (Ptr mut)
ptr <- (Int -> Struct mut -> m (Maybe (Ptr mut))
forall (m :: * -> *) (msg :: Mutability).
ReadCtx m msg =>
Int -> Struct msg -> m (Maybe (Ptr msg))
Untyped.getPtr Int
0 Struct mut
struct)
                    (Message mut -> Maybe (Ptr mut) -> m (Call mut)
forall (mut :: Mutability) a (m :: * -> *).
(FromPtr mut a, ReadCtx m mut) =>
Message mut -> Maybe (Ptr mut) -> m a
Classes.fromPtr (Struct mut -> Message mut
forall a (mut :: Mutability). HasMessage a mut => a -> Message mut
Untyped.message Struct mut
struct) Maybe (Ptr mut)
ptr)
                    ))
            Word16
3 ->
                (Return mut -> Message' mut
forall (mut :: Mutability). Return mut -> Message' mut
Message'return (Return mut -> Message' mut) -> m (Return mut) -> m (Message' mut)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (do
                    Maybe (Ptr mut)
ptr <- (Int -> Struct mut -> m (Maybe (Ptr mut))
forall (m :: * -> *) (msg :: Mutability).
ReadCtx m msg =>
Int -> Struct msg -> m (Maybe (Ptr msg))
Untyped.getPtr Int
0 Struct mut
struct)
                    (Message mut -> Maybe (Ptr mut) -> m (Return mut)
forall (mut :: Mutability) a (m :: * -> *).
(FromPtr mut a, ReadCtx m mut) =>
Message mut -> Maybe (Ptr mut) -> m a
Classes.fromPtr (Struct mut -> Message mut
forall a (mut :: Mutability). HasMessage a mut => a -> Message mut
Untyped.message Struct mut
struct) Maybe (Ptr mut)
ptr)
                    ))
            Word16
4 ->
                (Finish mut -> Message' mut
forall (mut :: Mutability). Finish mut -> Message' mut
Message'finish (Finish mut -> Message' mut) -> m (Finish mut) -> m (Message' mut)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (do
                    Maybe (Ptr mut)
ptr <- (Int -> Struct mut -> m (Maybe (Ptr mut))
forall (m :: * -> *) (msg :: Mutability).
ReadCtx m msg =>
Int -> Struct msg -> m (Maybe (Ptr msg))
Untyped.getPtr Int
0 Struct mut
struct)
                    (Message mut -> Maybe (Ptr mut) -> m (Finish mut)
forall (mut :: Mutability) a (m :: * -> *).
(FromPtr mut a, ReadCtx m mut) =>
Message mut -> Maybe (Ptr mut) -> m a
Classes.fromPtr (Struct mut -> Message mut
forall a (mut :: Mutability). HasMessage a mut => a -> Message mut
Untyped.message Struct mut
struct) Maybe (Ptr mut)
ptr)
                    ))
            Word16
5 ->
                (Resolve mut -> Message' mut
forall (mut :: Mutability). Resolve mut -> Message' mut
Message'resolve (Resolve mut -> Message' mut)
-> m (Resolve mut) -> m (Message' mut)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (do
                    Maybe (Ptr mut)
ptr <- (Int -> Struct mut -> m (Maybe (Ptr mut))
forall (m :: * -> *) (msg :: Mutability).
ReadCtx m msg =>
Int -> Struct msg -> m (Maybe (Ptr msg))
Untyped.getPtr Int
0 Struct mut
struct)
                    (Message mut -> Maybe (Ptr mut) -> m (Resolve mut)
forall (mut :: Mutability) a (m :: * -> *).
(FromPtr mut a, ReadCtx m mut) =>
Message mut -> Maybe (Ptr mut) -> m a
Classes.fromPtr (Struct mut -> Message mut
forall a (mut :: Mutability). HasMessage a mut => a -> Message mut
Untyped.message Struct mut
struct) Maybe (Ptr mut)
ptr)
                    ))
            Word16
6 ->
                (Release mut -> Message' mut
forall (mut :: Mutability). Release mut -> Message' mut
Message'release (Release mut -> Message' mut)
-> m (Release mut) -> m (Message' mut)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (do
                    Maybe (Ptr mut)
ptr <- (Int -> Struct mut -> m (Maybe (Ptr mut))
forall (m :: * -> *) (msg :: Mutability).
ReadCtx m msg =>
Int -> Struct msg -> m (Maybe (Ptr msg))
Untyped.getPtr Int
0 Struct mut
struct)
                    (Message mut -> Maybe (Ptr mut) -> m (Release mut)
forall (mut :: Mutability) a (m :: * -> *).
(FromPtr mut a, ReadCtx m mut) =>
Message mut -> Maybe (Ptr mut) -> m a
Classes.fromPtr (Struct mut -> Message mut
forall a (mut :: Mutability). HasMessage a mut => a -> Message mut
Untyped.message Struct mut
struct) Maybe (Ptr mut)
ptr)
                    ))
            Word16
7 ->
                (Maybe (Ptr mut) -> Message' mut
forall (mut :: Mutability). Maybe (Ptr mut) -> Message' mut
Message'obsoleteSave (Maybe (Ptr mut) -> Message' mut)
-> m (Maybe (Ptr mut)) -> m (Message' mut)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (do
                    Maybe (Ptr mut)
ptr <- (Int -> Struct mut -> m (Maybe (Ptr mut))
forall (m :: * -> *) (msg :: Mutability).
ReadCtx m msg =>
Int -> Struct msg -> m (Maybe (Ptr msg))
Untyped.getPtr Int
0 Struct mut
struct)
                    (Message mut -> Maybe (Ptr mut) -> m (Maybe (Ptr mut))
forall (mut :: Mutability) a (m :: * -> *).
(FromPtr mut a, ReadCtx m mut) =>
Message mut -> Maybe (Ptr mut) -> m a
Classes.fromPtr (Struct mut -> Message mut
forall a (mut :: Mutability). HasMessage a mut => a -> Message mut
Untyped.message Struct mut
struct) Maybe (Ptr mut)
ptr)
                    ))
            Word16
8 ->
                (Bootstrap mut -> Message' mut
forall (mut :: Mutability). Bootstrap mut -> Message' mut
Message'bootstrap (Bootstrap mut -> Message' mut)
-> m (Bootstrap mut) -> m (Message' mut)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (do
                    Maybe (Ptr mut)
ptr <- (Int -> Struct mut -> m (Maybe (Ptr mut))
forall (m :: * -> *) (msg :: Mutability).
ReadCtx m msg =>
Int -> Struct msg -> m (Maybe (Ptr msg))
Untyped.getPtr Int
0 Struct mut
struct)
                    (Message mut -> Maybe (Ptr mut) -> m (Bootstrap mut)
forall (mut :: Mutability) a (m :: * -> *).
(FromPtr mut a, ReadCtx m mut) =>
Message mut -> Maybe (Ptr mut) -> m a
Classes.fromPtr (Struct mut -> Message mut
forall a (mut :: Mutability). HasMessage a mut => a -> Message mut
Untyped.message Struct mut
struct) Maybe (Ptr mut)
ptr)
                    ))
            Word16
9 ->
                (Maybe (Ptr mut) -> Message' mut
forall (mut :: Mutability). Maybe (Ptr mut) -> Message' mut
Message'obsoleteDelete (Maybe (Ptr mut) -> Message' mut)
-> m (Maybe (Ptr mut)) -> m (Message' mut)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (do
                    Maybe (Ptr mut)
ptr <- (Int -> Struct mut -> m (Maybe (Ptr mut))
forall (m :: * -> *) (msg :: Mutability).
ReadCtx m msg =>
Int -> Struct msg -> m (Maybe (Ptr msg))
Untyped.getPtr Int
0 Struct mut
struct)
                    (Message mut -> Maybe (Ptr mut) -> m (Maybe (Ptr mut))
forall (mut :: Mutability) a (m :: * -> *).
(FromPtr mut a, ReadCtx m mut) =>
Message mut -> Maybe (Ptr mut) -> m a
Classes.fromPtr (Struct mut -> Message mut
forall a (mut :: Mutability). HasMessage a mut => a -> Message mut
Untyped.message Struct mut
struct) Maybe (Ptr mut)
ptr)
                    ))
            Word16
10 ->
                (Provide mut -> Message' mut
forall (mut :: Mutability). Provide mut -> Message' mut
Message'provide (Provide mut -> Message' mut)
-> m (Provide mut) -> m (Message' mut)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (do
                    Maybe (Ptr mut)
ptr <- (Int -> Struct mut -> m (Maybe (Ptr mut))
forall (m :: * -> *) (msg :: Mutability).
ReadCtx m msg =>
Int -> Struct msg -> m (Maybe (Ptr msg))
Untyped.getPtr Int
0 Struct mut
struct)
                    (Message mut -> Maybe (Ptr mut) -> m (Provide mut)
forall (mut :: Mutability) a (m :: * -> *).
(FromPtr mut a, ReadCtx m mut) =>
Message mut -> Maybe (Ptr mut) -> m a
Classes.fromPtr (Struct mut -> Message mut
forall a (mut :: Mutability). HasMessage a mut => a -> Message mut
Untyped.message Struct mut
struct) Maybe (Ptr mut)
ptr)
                    ))
            Word16
11 ->
                (Accept mut -> Message' mut
forall (mut :: Mutability). Accept mut -> Message' mut
Message'accept (Accept mut -> Message' mut) -> m (Accept mut) -> m (Message' mut)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (do
                    Maybe (Ptr mut)
ptr <- (Int -> Struct mut -> m (Maybe (Ptr mut))
forall (m :: * -> *) (msg :: Mutability).
ReadCtx m msg =>
Int -> Struct msg -> m (Maybe (Ptr msg))
Untyped.getPtr Int
0 Struct mut
struct)
                    (Message mut -> Maybe (Ptr mut) -> m (Accept mut)
forall (mut :: Mutability) a (m :: * -> *).
(FromPtr mut a, ReadCtx m mut) =>
Message mut -> Maybe (Ptr mut) -> m a
Classes.fromPtr (Struct mut -> Message mut
forall a (mut :: Mutability). HasMessage a mut => a -> Message mut
Untyped.message Struct mut
struct) Maybe (Ptr mut)
ptr)
                    ))
            Word16
12 ->
                (Join mut -> Message' mut
forall (mut :: Mutability). Join mut -> Message' mut
Message'join (Join mut -> Message' mut) -> m (Join mut) -> m (Message' mut)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (do
                    Maybe (Ptr mut)
ptr <- (Int -> Struct mut -> m (Maybe (Ptr mut))
forall (m :: * -> *) (msg :: Mutability).
ReadCtx m msg =>
Int -> Struct msg -> m (Maybe (Ptr msg))
Untyped.getPtr Int
0 Struct mut
struct)
                    (Message mut -> Maybe (Ptr mut) -> m (Join mut)
forall (mut :: Mutability) a (m :: * -> *).
(FromPtr mut a, ReadCtx m mut) =>
Message mut -> Maybe (Ptr mut) -> m a
Classes.fromPtr (Struct mut -> Message mut
forall a (mut :: Mutability). HasMessage a mut => a -> Message mut
Untyped.message Struct mut
struct) Maybe (Ptr mut)
ptr)
                    ))
            Word16
13 ->
                (Disembargo mut -> Message' mut
forall (mut :: Mutability). Disembargo mut -> Message' mut
Message'disembargo (Disembargo mut -> Message' mut)
-> m (Disembargo mut) -> m (Message' mut)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (do
                    Maybe (Ptr mut)
ptr <- (Int -> Struct mut -> m (Maybe (Ptr mut))
forall (m :: * -> *) (msg :: Mutability).
ReadCtx m msg =>
Int -> Struct msg -> m (Maybe (Ptr msg))
Untyped.getPtr Int
0 Struct mut
struct)
                    (Message mut -> Maybe (Ptr mut) -> m (Disembargo mut)
forall (mut :: Mutability) a (m :: * -> *).
(FromPtr mut a, ReadCtx m mut) =>
Message mut -> Maybe (Ptr mut) -> m a
Classes.fromPtr (Struct mut -> Message mut
forall a (mut :: Mutability). HasMessage a mut => a -> Message mut
Untyped.message Struct mut
struct) Maybe (Ptr mut)
ptr)
                    ))
            Word16
_ ->
                (Message' mut -> m (Message' mut)
forall (f :: * -> *) a. Applicative f => a -> f a
Std_.pure (Word16 -> Message' mut
forall (mut :: Mutability). Word16 -> Message' mut
Message'unknown' (Word16 -> Word16
forall a b. (Integral a, Num b) => a -> b
Std_.fromIntegral Word16
tag)))
        )
get_Message' :: ((Untyped.ReadCtx m msg)
                ,(Classes.FromStruct msg (Message' msg))) => (Message msg) -> (m (Message' msg))
get_Message' :: Message msg -> m (Message' msg)
get_Message' (Message'newtype_ Struct msg
struct) = (Struct msg -> m (Message' msg)
forall (mut :: Mutability) a (m :: * -> *).
(FromStruct mut a, ReadCtx m mut) =>
Struct mut -> m a
Classes.fromStruct Struct msg
struct)
set_Message'unimplemented :: ((Untyped.RWCtx m s)
                             ,(Classes.ToPtr s (Message (Message.Mut s)))) => (Message (Message.Mut s)) -> (Message (Message.Mut s)) -> (m ())
set_Message'unimplemented :: Message ('Mut s) -> Message ('Mut s) -> m ()
set_Message'unimplemented (Message'newtype_ Struct ('Mut s)
struct) Message ('Mut s)
value = (do
    (Struct ('Mut s) -> Word16 -> Int -> Int -> Word64 -> m ()
forall (m :: * -> *) s a.
(RWCtx m s, Bounded a, Integral a, IsWord a, Bits a) =>
Struct ('Mut s) -> a -> Int -> Int -> Word64 -> m ()
GenHelpers.setWordField Struct ('Mut s)
struct (Word16
0 :: Std_.Word16) Int
0 Int
0 Word64
0)
    (do
        Maybe (Ptr ('Mut s))
ptr <- (Message ('Mut s) -> Message ('Mut s) -> m (Maybe (Ptr ('Mut s)))
forall s a (m :: * -> *).
(ToPtr s a, WriteCtx m s) =>
Message ('Mut s) -> a -> m (Maybe (Ptr ('Mut s)))
Classes.toPtr (Struct ('Mut s) -> Message ('Mut s)
forall a (mut :: Mutability). HasMessage a mut => a -> Message mut
Untyped.message Struct ('Mut s)
struct) Message ('Mut s)
value)
        (Maybe (Ptr ('Mut s)) -> Int -> Struct ('Mut s) -> m ()
forall (m :: * -> *) s.
(ReadCtx m ('Mut s), WriteCtx m s) =>
Maybe (Ptr ('Mut s)) -> Int -> Struct ('Mut s) -> m ()
Untyped.setPtr Maybe (Ptr ('Mut s))
ptr Int
0 Struct ('Mut s)
struct)
        )
    )
set_Message'abort :: ((Untyped.RWCtx m s)
                     ,(Classes.ToPtr s (Exception (Message.Mut s)))) => (Message (Message.Mut s)) -> (Exception (Message.Mut s)) -> (m ())
set_Message'abort :: Message ('Mut s) -> Exception ('Mut s) -> m ()
set_Message'abort (Message'newtype_ Struct ('Mut s)
struct) Exception ('Mut s)
value = (do
    (Struct ('Mut s) -> Word16 -> Int -> Int -> Word64 -> m ()
forall (m :: * -> *) s a.
(RWCtx m s, Bounded a, Integral a, IsWord a, Bits a) =>
Struct ('Mut s) -> a -> Int -> Int -> Word64 -> m ()
GenHelpers.setWordField Struct ('Mut s)
struct (Word16
1 :: Std_.Word16) Int
0 Int
0 Word64
0)
    (do
        Maybe (Ptr ('Mut s))
ptr <- (Message ('Mut s) -> Exception ('Mut s) -> m (Maybe (Ptr ('Mut s)))
forall s a (m :: * -> *).
(ToPtr s a, WriteCtx m s) =>
Message ('Mut s) -> a -> m (Maybe (Ptr ('Mut s)))
Classes.toPtr (Struct ('Mut s) -> Message ('Mut s)
forall a (mut :: Mutability). HasMessage a mut => a -> Message mut
Untyped.message Struct ('Mut s)
struct) Exception ('Mut s)
value)
        (Maybe (Ptr ('Mut s)) -> Int -> Struct ('Mut s) -> m ()
forall (m :: * -> *) s.
(ReadCtx m ('Mut s), WriteCtx m s) =>
Maybe (Ptr ('Mut s)) -> Int -> Struct ('Mut s) -> m ()
Untyped.setPtr Maybe (Ptr ('Mut s))
ptr Int
0 Struct ('Mut s)
struct)
        )
    )
set_Message'call :: ((Untyped.RWCtx m s)
                    ,(Classes.ToPtr s (Call (Message.Mut s)))) => (Message (Message.Mut s)) -> (Call (Message.Mut s)) -> (m ())
set_Message'call :: Message ('Mut s) -> Call ('Mut s) -> m ()
set_Message'call (Message'newtype_ Struct ('Mut s)
struct) Call ('Mut s)
value = (do
    (Struct ('Mut s) -> Word16 -> Int -> Int -> Word64 -> m ()
forall (m :: * -> *) s a.
(RWCtx m s, Bounded a, Integral a, IsWord a, Bits a) =>
Struct ('Mut s) -> a -> Int -> Int -> Word64 -> m ()
GenHelpers.setWordField Struct ('Mut s)
struct (Word16
2 :: Std_.Word16) Int
0 Int
0 Word64
0)
    (do
        Maybe (Ptr ('Mut s))
ptr <- (Message ('Mut s) -> Call ('Mut s) -> m (Maybe (Ptr ('Mut s)))
forall s a (m :: * -> *).
(ToPtr s a, WriteCtx m s) =>
Message ('Mut s) -> a -> m (Maybe (Ptr ('Mut s)))
Classes.toPtr (Struct ('Mut s) -> Message ('Mut s)
forall a (mut :: Mutability). HasMessage a mut => a -> Message mut
Untyped.message Struct ('Mut s)
struct) Call ('Mut s)
value)
        (Maybe (Ptr ('Mut s)) -> Int -> Struct ('Mut s) -> m ()
forall (m :: * -> *) s.
(ReadCtx m ('Mut s), WriteCtx m s) =>
Maybe (Ptr ('Mut s)) -> Int -> Struct ('Mut s) -> m ()
Untyped.setPtr Maybe (Ptr ('Mut s))
ptr Int
0 Struct ('Mut s)
struct)
        )
    )
set_Message'return :: ((Untyped.RWCtx m s)
                      ,(Classes.ToPtr s (Return (Message.Mut s)))) => (Message (Message.Mut s)) -> (Return (Message.Mut s)) -> (m ())
set_Message'return :: Message ('Mut s) -> Return ('Mut s) -> m ()
set_Message'return (Message'newtype_ Struct ('Mut s)
struct) Return ('Mut s)
value = (do
    (Struct ('Mut s) -> Word16 -> Int -> Int -> Word64 -> m ()
forall (m :: * -> *) s a.
(RWCtx m s, Bounded a, Integral a, IsWord a, Bits a) =>
Struct ('Mut s) -> a -> Int -> Int -> Word64 -> m ()
GenHelpers.setWordField Struct ('Mut s)
struct (Word16
3 :: Std_.Word16) Int
0 Int
0 Word64
0)
    (do
        Maybe (Ptr ('Mut s))
ptr <- (Message ('Mut s) -> Return ('Mut s) -> m (Maybe (Ptr ('Mut s)))
forall s a (m :: * -> *).
(ToPtr s a, WriteCtx m s) =>
Message ('Mut s) -> a -> m (Maybe (Ptr ('Mut s)))
Classes.toPtr (Struct ('Mut s) -> Message ('Mut s)
forall a (mut :: Mutability). HasMessage a mut => a -> Message mut
Untyped.message Struct ('Mut s)
struct) Return ('Mut s)
value)
        (Maybe (Ptr ('Mut s)) -> Int -> Struct ('Mut s) -> m ()
forall (m :: * -> *) s.
(ReadCtx m ('Mut s), WriteCtx m s) =>
Maybe (Ptr ('Mut s)) -> Int -> Struct ('Mut s) -> m ()
Untyped.setPtr Maybe (Ptr ('Mut s))
ptr Int
0 Struct ('Mut s)
struct)
        )
    )
set_Message'finish :: ((Untyped.RWCtx m s)
                      ,(Classes.ToPtr s (Finish (Message.Mut s)))) => (Message (Message.Mut s)) -> (Finish (Message.Mut s)) -> (m ())
set_Message'finish :: Message ('Mut s) -> Finish ('Mut s) -> m ()
set_Message'finish (Message'newtype_ Struct ('Mut s)
struct) Finish ('Mut s)
value = (do
    (Struct ('Mut s) -> Word16 -> Int -> Int -> Word64 -> m ()
forall (m :: * -> *) s a.
(RWCtx m s, Bounded a, Integral a, IsWord a, Bits a) =>
Struct ('Mut s) -> a -> Int -> Int -> Word64 -> m ()
GenHelpers.setWordField Struct ('Mut s)
struct (Word16
4 :: Std_.Word16) Int
0 Int
0 Word64
0)
    (do
        Maybe (Ptr ('Mut s))
ptr <- (Message ('Mut s) -> Finish ('Mut s) -> m (Maybe (Ptr ('Mut s)))
forall s a (m :: * -> *).
(ToPtr s a, WriteCtx m s) =>
Message ('Mut s) -> a -> m (Maybe (Ptr ('Mut s)))
Classes.toPtr (Struct ('Mut s) -> Message ('Mut s)
forall a (mut :: Mutability). HasMessage a mut => a -> Message mut
Untyped.message Struct ('Mut s)
struct) Finish ('Mut s)
value)
        (Maybe (Ptr ('Mut s)) -> Int -> Struct ('Mut s) -> m ()
forall (m :: * -> *) s.
(ReadCtx m ('Mut s), WriteCtx m s) =>
Maybe (Ptr ('Mut s)) -> Int -> Struct ('Mut s) -> m ()
Untyped.setPtr Maybe (Ptr ('Mut s))
ptr Int
0 Struct ('Mut s)
struct)
        )
    )
set_Message'resolve :: ((Untyped.RWCtx m s)
                       ,(Classes.ToPtr s (Resolve (Message.Mut s)))) => (Message (Message.Mut s)) -> (Resolve (Message.Mut s)) -> (m ())
set_Message'resolve :: Message ('Mut s) -> Resolve ('Mut s) -> m ()
set_Message'resolve (Message'newtype_ Struct ('Mut s)
struct) Resolve ('Mut s)
value = (do
    (Struct ('Mut s) -> Word16 -> Int -> Int -> Word64 -> m ()
forall (m :: * -> *) s a.
(RWCtx m s, Bounded a, Integral a, IsWord a, Bits a) =>
Struct ('Mut s) -> a -> Int -> Int -> Word64 -> m ()
GenHelpers.setWordField Struct ('Mut s)
struct (Word16
5 :: Std_.Word16) Int
0 Int
0 Word64
0)
    (do
        Maybe (Ptr ('Mut s))
ptr <- (Message ('Mut s) -> Resolve ('Mut s) -> m (Maybe (Ptr ('Mut s)))
forall s a (m :: * -> *).
(ToPtr s a, WriteCtx m s) =>
Message ('Mut s) -> a -> m (Maybe (Ptr ('Mut s)))
Classes.toPtr (Struct ('Mut s) -> Message ('Mut s)
forall a (mut :: Mutability). HasMessage a mut => a -> Message mut
Untyped.message Struct ('Mut s)
struct) Resolve ('Mut s)
value)
        (Maybe (Ptr ('Mut s)) -> Int -> Struct ('Mut s) -> m ()
forall (m :: * -> *) s.
(ReadCtx m ('Mut s), WriteCtx m s) =>
Maybe (Ptr ('Mut s)) -> Int -> Struct ('Mut s) -> m ()
Untyped.setPtr Maybe (Ptr ('Mut s))
ptr Int
0 Struct ('Mut s)
struct)
        )
    )
set_Message'release :: ((Untyped.RWCtx m s)
                       ,(Classes.ToPtr s (Release (Message.Mut s)))) => (Message (Message.Mut s)) -> (Release (Message.Mut s)) -> (m ())
set_Message'release :: Message ('Mut s) -> Release ('Mut s) -> m ()
set_Message'release (Message'newtype_ Struct ('Mut s)
struct) Release ('Mut s)
value = (do
    (Struct ('Mut s) -> Word16 -> Int -> Int -> Word64 -> m ()
forall (m :: * -> *) s a.
(RWCtx m s, Bounded a, Integral a, IsWord a, Bits a) =>
Struct ('Mut s) -> a -> Int -> Int -> Word64 -> m ()
GenHelpers.setWordField Struct ('Mut s)
struct (Word16
6 :: Std_.Word16) Int
0 Int
0 Word64
0)
    (do
        Maybe (Ptr ('Mut s))
ptr <- (Message ('Mut s) -> Release ('Mut s) -> m (Maybe (Ptr ('Mut s)))
forall s a (m :: * -> *).
(ToPtr s a, WriteCtx m s) =>
Message ('Mut s) -> a -> m (Maybe (Ptr ('Mut s)))
Classes.toPtr (Struct ('Mut s) -> Message ('Mut s)
forall a (mut :: Mutability). HasMessage a mut => a -> Message mut
Untyped.message Struct ('Mut s)
struct) Release ('Mut s)
value)
        (Maybe (Ptr ('Mut s)) -> Int -> Struct ('Mut s) -> m ()
forall (m :: * -> *) s.
(ReadCtx m ('Mut s), WriteCtx m s) =>
Maybe (Ptr ('Mut s)) -> Int -> Struct ('Mut s) -> m ()
Untyped.setPtr Maybe (Ptr ('Mut s))
ptr Int
0 Struct ('Mut s)
struct)
        )
    )
set_Message'obsoleteSave :: ((Untyped.RWCtx m s)
                            ,(Classes.ToPtr s (Std_.Maybe (Untyped.Ptr (Message.Mut s))))) => (Message (Message.Mut s)) -> (Std_.Maybe (Untyped.Ptr (Message.Mut s))) -> (m ())
set_Message'obsoleteSave :: Message ('Mut s) -> Maybe (Ptr ('Mut s)) -> m ()
set_Message'obsoleteSave (Message'newtype_ Struct ('Mut s)
struct) Maybe (Ptr ('Mut s))
value = (do
    (Struct ('Mut s) -> Word16 -> Int -> Int -> Word64 -> m ()
forall (m :: * -> *) s a.
(RWCtx m s, Bounded a, Integral a, IsWord a, Bits a) =>
Struct ('Mut s) -> a -> Int -> Int -> Word64 -> m ()
GenHelpers.setWordField Struct ('Mut s)
struct (Word16
7 :: Std_.Word16) Int
0 Int
0 Word64
0)
    (do
        Maybe (Ptr ('Mut s))
ptr <- (Message ('Mut s)
-> Maybe (Ptr ('Mut s)) -> m (Maybe (Ptr ('Mut s)))
forall s a (m :: * -> *).
(ToPtr s a, WriteCtx m s) =>
Message ('Mut s) -> a -> m (Maybe (Ptr ('Mut s)))
Classes.toPtr (Struct ('Mut s) -> Message ('Mut s)
forall a (mut :: Mutability). HasMessage a mut => a -> Message mut
Untyped.message Struct ('Mut s)
struct) Maybe (Ptr ('Mut s))
value)
        (Maybe (Ptr ('Mut s)) -> Int -> Struct ('Mut s) -> m ()
forall (m :: * -> *) s.
(ReadCtx m ('Mut s), WriteCtx m s) =>
Maybe (Ptr ('Mut s)) -> Int -> Struct ('Mut s) -> m ()
Untyped.setPtr Maybe (Ptr ('Mut s))
ptr Int
0 Struct ('Mut s)
struct)
        )
    )
set_Message'bootstrap :: ((Untyped.RWCtx m s)
                         ,(Classes.ToPtr s (Bootstrap (Message.Mut s)))) => (Message (Message.Mut s)) -> (Bootstrap (Message.Mut s)) -> (m ())
set_Message'bootstrap :: Message ('Mut s) -> Bootstrap ('Mut s) -> m ()
set_Message'bootstrap (Message'newtype_ Struct ('Mut s)
struct) Bootstrap ('Mut s)
value = (do
    (Struct ('Mut s) -> Word16 -> Int -> Int -> Word64 -> m ()
forall (m :: * -> *) s a.
(RWCtx m s, Bounded a, Integral a, IsWord a, Bits a) =>
Struct ('Mut s) -> a -> Int -> Int -> Word64 -> m ()
GenHelpers.setWordField Struct ('Mut s)
struct (Word16
8 :: Std_.Word16) Int
0 Int
0 Word64
0)
    (do
        Maybe (Ptr ('Mut s))
ptr <- (Message ('Mut s) -> Bootstrap ('Mut s) -> m (Maybe (Ptr ('Mut s)))
forall s a (m :: * -> *).
(ToPtr s a, WriteCtx m s) =>
Message ('Mut s) -> a -> m (Maybe (Ptr ('Mut s)))
Classes.toPtr (Struct ('Mut s) -> Message ('Mut s)
forall a (mut :: Mutability). HasMessage a mut => a -> Message mut
Untyped.message Struct ('Mut s)
struct) Bootstrap ('Mut s)
value)
        (Maybe (Ptr ('Mut s)) -> Int -> Struct ('Mut s) -> m ()
forall (m :: * -> *) s.
(ReadCtx m ('Mut s), WriteCtx m s) =>
Maybe (Ptr ('Mut s)) -> Int -> Struct ('Mut s) -> m ()
Untyped.setPtr Maybe (Ptr ('Mut s))
ptr Int
0 Struct ('Mut s)
struct)
        )
    )
set_Message'obsoleteDelete :: ((Untyped.RWCtx m s)
                              ,(Classes.ToPtr s (Std_.Maybe (Untyped.Ptr (Message.Mut s))))) => (Message (Message.Mut s)) -> (Std_.Maybe (Untyped.Ptr (Message.Mut s))) -> (m ())
set_Message'obsoleteDelete :: Message ('Mut s) -> Maybe (Ptr ('Mut s)) -> m ()
set_Message'obsoleteDelete (Message'newtype_ Struct ('Mut s)
struct) Maybe (Ptr ('Mut s))
value = (do
    (Struct ('Mut s) -> Word16 -> Int -> Int -> Word64 -> m ()
forall (m :: * -> *) s a.
(RWCtx m s, Bounded a, Integral a, IsWord a, Bits a) =>
Struct ('Mut s) -> a -> Int -> Int -> Word64 -> m ()
GenHelpers.setWordField Struct ('Mut s)
struct (Word16
9 :: Std_.Word16) Int
0 Int
0 Word64
0)
    (do
        Maybe (Ptr ('Mut s))
ptr <- (Message ('Mut s)
-> Maybe (Ptr ('Mut s)) -> m (Maybe (Ptr ('Mut s)))
forall s a (m :: * -> *).
(ToPtr s a, WriteCtx m s) =>
Message ('Mut s) -> a -> m (Maybe (Ptr ('Mut s)))
Classes.toPtr (Struct ('Mut s) -> Message ('Mut s)
forall a (mut :: Mutability). HasMessage a mut => a -> Message mut
Untyped.message Struct ('Mut s)
struct) Maybe (Ptr ('Mut s))
value)
        (Maybe (Ptr ('Mut s)) -> Int -> Struct ('Mut s) -> m ()
forall (m :: * -> *) s.
(ReadCtx m ('Mut s), WriteCtx m s) =>
Maybe (Ptr ('Mut s)) -> Int -> Struct ('Mut s) -> m ()
Untyped.setPtr Maybe (Ptr ('Mut s))
ptr Int
0 Struct ('Mut s)
struct)
        )
    )
set_Message'provide :: ((Untyped.RWCtx m s)
                       ,(Classes.ToPtr s (Provide (Message.Mut s)))) => (Message (Message.Mut s)) -> (Provide (Message.Mut s)) -> (m ())
set_Message'provide :: Message ('Mut s) -> Provide ('Mut s) -> m ()
set_Message'provide (Message'newtype_ Struct ('Mut s)
struct) Provide ('Mut s)
value = (do
    (Struct ('Mut s) -> Word16 -> Int -> Int -> Word64 -> m ()
forall (m :: * -> *) s a.
(RWCtx m s, Bounded a, Integral a, IsWord a, Bits a) =>
Struct ('Mut s) -> a -> Int -> Int -> Word64 -> m ()
GenHelpers.setWordField Struct ('Mut s)
struct (Word16
10 :: Std_.Word16) Int
0 Int
0 Word64
0)
    (do
        Maybe (Ptr ('Mut s))
ptr <- (Message ('Mut s) -> Provide ('Mut s) -> m (Maybe (Ptr ('Mut s)))
forall s a (m :: * -> *).
(ToPtr s a, WriteCtx m s) =>
Message ('Mut s) -> a -> m (Maybe (Ptr ('Mut s)))
Classes.toPtr (Struct ('Mut s) -> Message ('Mut s)
forall a (mut :: Mutability). HasMessage a mut => a -> Message mut
Untyped.message Struct ('Mut s)
struct) Provide ('Mut s)
value)
        (Maybe (Ptr ('Mut s)) -> Int -> Struct ('Mut s) -> m ()
forall (m :: * -> *) s.
(ReadCtx m ('Mut s), WriteCtx m s) =>
Maybe (Ptr ('Mut s)) -> Int -> Struct ('Mut s) -> m ()
Untyped.setPtr Maybe (Ptr ('Mut s))
ptr Int
0 Struct ('Mut s)
struct)
        )
    )
set_Message'accept :: ((Untyped.RWCtx m s)
                      ,(Classes.ToPtr s (Accept (Message.Mut s)))) => (Message (Message.Mut s)) -> (Accept (Message.Mut s)) -> (m ())
set_Message'accept :: Message ('Mut s) -> Accept ('Mut s) -> m ()
set_Message'accept (Message'newtype_ Struct ('Mut s)
struct) Accept ('Mut s)
value = (do
    (Struct ('Mut s) -> Word16 -> Int -> Int -> Word64 -> m ()
forall (m :: * -> *) s a.
(RWCtx m s, Bounded a, Integral a, IsWord a, Bits a) =>
Struct ('Mut s) -> a -> Int -> Int -> Word64 -> m ()
GenHelpers.setWordField Struct ('Mut s)
struct (Word16
11 :: Std_.Word16) Int
0 Int
0 Word64
0)
    (do
        Maybe (Ptr ('Mut s))
ptr <- (Message ('Mut s) -> Accept ('Mut s) -> m (Maybe (Ptr ('Mut s)))
forall s a (m :: * -> *).
(ToPtr s a, WriteCtx m s) =>
Message ('Mut s) -> a -> m (Maybe (Ptr ('Mut s)))
Classes.toPtr (Struct ('Mut s) -> Message ('Mut s)
forall a (mut :: Mutability). HasMessage a mut => a -> Message mut
Untyped.message Struct ('Mut s)
struct) Accept ('Mut s)
value)
        (Maybe (Ptr ('Mut s)) -> Int -> Struct ('Mut s) -> m ()
forall (m :: * -> *) s.
(ReadCtx m ('Mut s), WriteCtx m s) =>
Maybe (Ptr ('Mut s)) -> Int -> Struct ('Mut s) -> m ()
Untyped.setPtr Maybe (Ptr ('Mut s))
ptr Int
0 Struct ('Mut s)
struct)
        )
    )
set_Message'join :: ((Untyped.RWCtx m s)
                    ,(Classes.ToPtr s (Join (Message.Mut s)))) => (Message (Message.Mut s)) -> (Join (Message.Mut s)) -> (m ())
set_Message'join :: Message ('Mut s) -> Join ('Mut s) -> m ()
set_Message'join (Message'newtype_ Struct ('Mut s)
struct) Join ('Mut s)
value = (do
    (Struct ('Mut s) -> Word16 -> Int -> Int -> Word64 -> m ()
forall (m :: * -> *) s a.
(RWCtx m s, Bounded a, Integral a, IsWord a, Bits a) =>
Struct ('Mut s) -> a -> Int -> Int -> Word64 -> m ()
GenHelpers.setWordField Struct ('Mut s)
struct (Word16
12 :: Std_.Word16) Int
0 Int
0 Word64
0)
    (do
        Maybe (Ptr ('Mut s))
ptr <- (Message ('Mut s) -> Join ('Mut s) -> m (Maybe (Ptr ('Mut s)))
forall s a (m :: * -> *).
(ToPtr s a, WriteCtx m s) =>
Message ('Mut s) -> a -> m (Maybe (Ptr ('Mut s)))
Classes.toPtr (Struct ('Mut s) -> Message ('Mut s)
forall a (mut :: Mutability). HasMessage a mut => a -> Message mut
Untyped.message Struct ('Mut s)
struct) Join ('Mut s)
value)
        (Maybe (Ptr ('Mut s)) -> Int -> Struct ('Mut s) -> m ()
forall (m :: * -> *) s.
(ReadCtx m ('Mut s), WriteCtx m s) =>
Maybe (Ptr ('Mut s)) -> Int -> Struct ('Mut s) -> m ()
Untyped.setPtr Maybe (Ptr ('Mut s))
ptr Int
0 Struct ('Mut s)
struct)
        )
    )
set_Message'disembargo :: ((Untyped.RWCtx m s)
                          ,(Classes.ToPtr s (Disembargo (Message.Mut s)))) => (Message (Message.Mut s)) -> (Disembargo (Message.Mut s)) -> (m ())
set_Message'disembargo :: Message ('Mut s) -> Disembargo ('Mut s) -> m ()
set_Message'disembargo (Message'newtype_ Struct ('Mut s)
struct) Disembargo ('Mut s)
value = (do
    (Struct ('Mut s) -> Word16 -> Int -> Int -> Word64 -> m ()
forall (m :: * -> *) s a.
(RWCtx m s, Bounded a, Integral a, IsWord a, Bits a) =>
Struct ('Mut s) -> a -> Int -> Int -> Word64 -> m ()
GenHelpers.setWordField Struct ('Mut s)
struct (Word16
13 :: Std_.Word16) Int
0 Int
0 Word64
0)
    (do
        Maybe (Ptr ('Mut s))
ptr <- (Message ('Mut s) -> Disembargo ('Mut s) -> m (Maybe (Ptr ('Mut s)))
forall s a (m :: * -> *).
(ToPtr s a, WriteCtx m s) =>
Message ('Mut s) -> a -> m (Maybe (Ptr ('Mut s)))
Classes.toPtr (Struct ('Mut s) -> Message ('Mut s)
forall a (mut :: Mutability). HasMessage a mut => a -> Message mut
Untyped.message Struct ('Mut s)
struct) Disembargo ('Mut s)
value)
        (Maybe (Ptr ('Mut s)) -> Int -> Struct ('Mut s) -> m ()
forall (m :: * -> *) s.
(ReadCtx m ('Mut s), WriteCtx m s) =>
Maybe (Ptr ('Mut s)) -> Int -> Struct ('Mut s) -> m ()
Untyped.setPtr Maybe (Ptr ('Mut s))
ptr Int
0 Struct ('Mut s)
struct)
        )
    )
set_Message'unknown' :: ((Untyped.RWCtx m s)) => (Message (Message.Mut s)) -> Std_.Word16 -> (m ())
set_Message'unknown' :: Message ('Mut s) -> Word16 -> m ()
set_Message'unknown' (Message'newtype_ Struct ('Mut s)
struct) Word16
value = (Struct ('Mut s) -> Word16 -> Int -> Int -> Word64 -> m ()
forall (m :: * -> *) s a.
(RWCtx m s, Bounded a, Integral a, IsWord a, Bits a) =>
Struct ('Mut s) -> a -> Int -> Int -> Word64 -> m ()
GenHelpers.setWordField Struct ('Mut s)
struct ((Word64 -> Word16
forall a b. (Integral a, Num b) => a -> b
Std_.fromIntegral (Word16 -> Word64
forall a. IsWord a => a -> Word64
Classes.toWord Word16
value)) :: Std_.Word16) Int
0 Int
0 Word64
0)
newtype Bootstrap msg
    = Bootstrap'newtype_ (Untyped.Struct msg)
instance (Classes.FromStruct msg (Bootstrap msg)) where
    fromStruct :: Struct msg -> m (Bootstrap msg)
fromStruct Struct msg
struct = (Bootstrap msg -> m (Bootstrap msg)
forall (f :: * -> *) a. Applicative f => a -> f a
Std_.pure (Struct msg -> Bootstrap msg
forall (msg :: Mutability). Struct msg -> Bootstrap msg
Bootstrap'newtype_ Struct msg
struct))
instance (Classes.ToStruct msg (Bootstrap msg)) where
    toStruct :: Bootstrap msg -> Struct msg
toStruct (Bootstrap'newtype_ Struct msg
struct) = Struct msg
struct
instance (Untyped.HasMessage (Bootstrap mut) mut) where
    message :: Bootstrap mut -> Message mut
message (Bootstrap'newtype_ Struct mut
struct) = (Struct mut -> Message mut
forall a (mut :: Mutability). HasMessage a mut => a -> Message mut
Untyped.message Struct mut
struct)
instance (Untyped.MessageDefault (Bootstrap mut) mut) where
    messageDefault :: Message mut -> m (Bootstrap mut)
messageDefault Message mut
msg = (Struct mut -> Bootstrap mut
forall (msg :: Mutability). Struct msg -> Bootstrap msg
Bootstrap'newtype_ (Struct mut -> Bootstrap mut)
-> m (Struct mut) -> m (Bootstrap mut)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (Message mut -> m (Struct mut)
forall a (mut :: Mutability) (m :: * -> *).
(MessageDefault a mut, ReadCtx m mut) =>
Message mut -> m a
Untyped.messageDefault Message mut
msg))
instance (Classes.FromPtr msg (Bootstrap msg)) where
    fromPtr :: Message msg -> Maybe (Ptr msg) -> m (Bootstrap msg)
fromPtr Message msg
msg Maybe (Ptr msg)
ptr = (Struct msg -> Bootstrap msg
forall (msg :: Mutability). Struct msg -> Bootstrap msg
Bootstrap'newtype_ (Struct msg -> Bootstrap msg)
-> m (Struct msg) -> m (Bootstrap msg)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (Message msg -> Maybe (Ptr msg) -> m (Struct msg)
forall (mut :: Mutability) a (m :: * -> *).
(FromPtr mut a, ReadCtx m mut) =>
Message mut -> Maybe (Ptr mut) -> m a
Classes.fromPtr Message msg
msg Maybe (Ptr msg)
ptr))
instance (Classes.ToPtr s (Bootstrap (Message.Mut s))) where
    toPtr :: Message ('Mut s) -> Bootstrap ('Mut s) -> m (Maybe (Ptr ('Mut s)))
toPtr Message ('Mut s)
msg (Bootstrap'newtype_ Struct ('Mut s)
struct) = (Message ('Mut s) -> Struct ('Mut s) -> m (Maybe (Ptr ('Mut s)))
forall s a (m :: * -> *).
(ToPtr s a, WriteCtx m s) =>
Message ('Mut s) -> a -> m (Maybe (Ptr ('Mut s)))
Classes.toPtr Message ('Mut s)
msg Struct ('Mut s)
struct)
instance (Classes.Allocate s (Bootstrap (Message.Mut s))) where
    new :: Message ('Mut s) -> m (Bootstrap ('Mut s))
new Message ('Mut s)
msg = (Struct ('Mut s) -> Bootstrap ('Mut s)
forall (msg :: Mutability). Struct msg -> Bootstrap msg
Bootstrap'newtype_ (Struct ('Mut s) -> Bootstrap ('Mut s))
-> m (Struct ('Mut s)) -> m (Bootstrap ('Mut s))
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (Message ('Mut s) -> Word16 -> Word16 -> m (Struct ('Mut s))
forall (m :: * -> *) s.
WriteCtx m s =>
Message ('Mut s) -> Word16 -> Word16 -> m (Struct ('Mut s))
Untyped.allocStruct Message ('Mut s)
msg Word16
1 Word16
1))
instance (Basics.ListElem mut (Bootstrap mut)) where
    newtype List mut (Bootstrap mut)
        = Bootstrap'List_ (Untyped.ListOf mut (Untyped.Struct mut))
    listFromPtr :: Message mut -> Maybe (Ptr mut) -> m (List mut (Bootstrap mut))
listFromPtr Message mut
msg Maybe (Ptr mut)
ptr = (ListOf mut (Struct mut) -> List mut (Bootstrap mut)
forall (mut :: Mutability).
ListOf mut (Struct mut) -> List mut (Bootstrap mut)
Bootstrap'List_ (ListOf mut (Struct mut) -> List mut (Bootstrap mut))
-> m (ListOf mut (Struct mut)) -> m (List mut (Bootstrap mut))
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (Message mut -> Maybe (Ptr mut) -> m (ListOf mut (Struct mut))
forall (mut :: Mutability) a (m :: * -> *).
(FromPtr mut a, ReadCtx m mut) =>
Message mut -> Maybe (Ptr mut) -> m a
Classes.fromPtr Message mut
msg Maybe (Ptr mut)
ptr))
    toUntypedList :: List mut (Bootstrap mut) -> List mut
toUntypedList (Bootstrap'List_ l) = (ListOf mut (Struct mut) -> List mut
forall (mut :: Mutability). ListOf mut (Struct mut) -> List mut
Untyped.ListStruct ListOf mut (Struct mut)
l)
    length :: List mut (Bootstrap mut) -> Int
length (Bootstrap'List_ l) = (ListOf mut (Struct mut) -> Int
forall (msg :: Mutability) a. ListOf msg a -> Int
Untyped.length ListOf mut (Struct mut)
l)
    index :: Int -> List mut (Bootstrap mut) -> m (Bootstrap mut)
index Int
i (Bootstrap'List_ l) = (do
        Struct mut
elt <- (Int -> ListOf mut (Struct mut) -> m (Struct mut)
forall (m :: * -> *) (mut :: Mutability) a.
ReadCtx m mut =>
Int -> ListOf mut a -> m a
Untyped.index Int
i ListOf mut (Struct mut)
l)
        (Struct mut -> m (Bootstrap mut)
forall (mut :: Mutability) a (m :: * -> *).
(FromStruct mut a, ReadCtx m mut) =>
Struct mut -> m a
Classes.fromStruct Struct mut
elt)
        )
instance (Basics.MutListElem s (Bootstrap (Message.Mut s))) where
    setIndex :: Bootstrap ('Mut s)
-> Int -> List ('Mut s) (Bootstrap ('Mut s)) -> m ()
setIndex (Bootstrap'newtype_ Struct ('Mut s)
elt) Int
i (Bootstrap'List_ l) = (Struct ('Mut s) -> Int -> ListOf ('Mut s) (Struct ('Mut s)) -> m ()
forall (m :: * -> *) s a.
RWCtx m s =>
a -> Int -> ListOf ('Mut s) a -> m ()
Untyped.setIndex Struct ('Mut s)
elt Int
i ListOf ('Mut s) (Struct ('Mut s))
l)
    newList :: Message ('Mut s) -> Int -> m (List ('Mut s) (Bootstrap ('Mut s)))
newList Message ('Mut s)
msg Int
len = (ListOf ('Mut s) (Struct ('Mut s))
-> List ('Mut s) (Bootstrap ('Mut s))
forall (mut :: Mutability).
ListOf mut (Struct mut) -> List mut (Bootstrap mut)
Bootstrap'List_ (ListOf ('Mut s) (Struct ('Mut s))
 -> List ('Mut s) (Bootstrap ('Mut s)))
-> m (ListOf ('Mut s) (Struct ('Mut s)))
-> m (List ('Mut s) (Bootstrap ('Mut s)))
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (Message ('Mut s)
-> Word16 -> Word16 -> Int -> m (ListOf ('Mut s) (Struct ('Mut s)))
forall (m :: * -> *) s.
WriteCtx m s =>
Message ('Mut s)
-> Word16 -> Word16 -> Int -> m (ListOf ('Mut s) (Struct ('Mut s)))
Untyped.allocCompositeList Message ('Mut s)
msg Word16
1 Word16
1 Int
len))
get_Bootstrap'questionId :: ((Untyped.ReadCtx m msg)) => (Bootstrap msg) -> (m Std_.Word32)
get_Bootstrap'questionId :: Bootstrap msg -> m Word32
get_Bootstrap'questionId (Bootstrap'newtype_ Struct msg
struct) = (Struct msg -> Int -> Int -> Word64 -> m Word32
forall (m :: * -> *) (mut :: Mutability) a.
(ReadCtx m mut, IsWord a) =>
Struct mut -> Int -> Int -> Word64 -> m a
GenHelpers.getWordField Struct msg
struct Int
0 Int
0 Word64
0)
set_Bootstrap'questionId :: ((Untyped.RWCtx m s)) => (Bootstrap (Message.Mut s)) -> Std_.Word32 -> (m ())
set_Bootstrap'questionId :: Bootstrap ('Mut s) -> Word32 -> m ()
set_Bootstrap'questionId (Bootstrap'newtype_ Struct ('Mut s)
struct) Word32
value = (Struct ('Mut s) -> Word32 -> Int -> Int -> Word64 -> m ()
forall (m :: * -> *) s a.
(RWCtx m s, Bounded a, Integral a, IsWord a, Bits a) =>
Struct ('Mut s) -> a -> Int -> Int -> Word64 -> m ()
GenHelpers.setWordField Struct ('Mut s)
struct ((Word64 -> Word32
forall a b. (Integral a, Num b) => a -> b
Std_.fromIntegral (Word32 -> Word64
forall a. IsWord a => a -> Word64
Classes.toWord Word32
value)) :: Std_.Word32) Int
0 Int
0 Word64
0)
get_Bootstrap'deprecatedObjectId :: ((Untyped.ReadCtx m msg)
                                    ,(Classes.FromPtr msg (Std_.Maybe (Untyped.Ptr msg)))) => (Bootstrap msg) -> (m (Std_.Maybe (Untyped.Ptr msg)))
get_Bootstrap'deprecatedObjectId :: Bootstrap msg -> m (Maybe (Ptr msg))
get_Bootstrap'deprecatedObjectId (Bootstrap'newtype_ Struct msg
struct) = (do
    Maybe (Ptr msg)
ptr <- (Int -> Struct msg -> m (Maybe (Ptr msg))
forall (m :: * -> *) (msg :: Mutability).
ReadCtx m msg =>
Int -> Struct msg -> m (Maybe (Ptr msg))
Untyped.getPtr Int
0 Struct msg
struct)
    (Message msg -> Maybe (Ptr msg) -> m (Maybe (Ptr msg))
forall (mut :: Mutability) a (m :: * -> *).
(FromPtr mut a, ReadCtx m mut) =>
Message mut -> Maybe (Ptr mut) -> m a
Classes.fromPtr (Struct msg -> Message msg
forall a (mut :: Mutability). HasMessage a mut => a -> Message mut
Untyped.message Struct msg
struct) Maybe (Ptr msg)
ptr)
    )
set_Bootstrap'deprecatedObjectId :: ((Untyped.RWCtx m s)
                                    ,(Classes.ToPtr s (Std_.Maybe (Untyped.Ptr (Message.Mut s))))) => (Bootstrap (Message.Mut s)) -> (Std_.Maybe (Untyped.Ptr (Message.Mut s))) -> (m ())
set_Bootstrap'deprecatedObjectId :: Bootstrap ('Mut s) -> Maybe (Ptr ('Mut s)) -> m ()
set_Bootstrap'deprecatedObjectId (Bootstrap'newtype_ Struct ('Mut s)
struct) Maybe (Ptr ('Mut s))
value = (do
    Maybe (Ptr ('Mut s))
ptr <- (Message ('Mut s)
-> Maybe (Ptr ('Mut s)) -> m (Maybe (Ptr ('Mut s)))
forall s a (m :: * -> *).
(ToPtr s a, WriteCtx m s) =>
Message ('Mut s) -> a -> m (Maybe (Ptr ('Mut s)))
Classes.toPtr (Struct ('Mut s) -> Message ('Mut s)
forall a (mut :: Mutability). HasMessage a mut => a -> Message mut
Untyped.message Struct ('Mut s)
struct) Maybe (Ptr ('Mut s))
value)
    (Maybe (Ptr ('Mut s)) -> Int -> Struct ('Mut s) -> m ()
forall (m :: * -> *) s.
(ReadCtx m ('Mut s), WriteCtx m s) =>
Maybe (Ptr ('Mut s)) -> Int -> Struct ('Mut s) -> m ()
Untyped.setPtr Maybe (Ptr ('Mut s))
ptr Int
0 Struct ('Mut s)
struct)
    )
has_Bootstrap'deprecatedObjectId :: ((Untyped.ReadCtx m msg)) => (Bootstrap msg) -> (m Std_.Bool)
has_Bootstrap'deprecatedObjectId :: Bootstrap msg -> m Bool
has_Bootstrap'deprecatedObjectId (Bootstrap'newtype_ Struct msg
struct) = (Maybe (Ptr msg) -> Bool
forall a. Maybe a -> Bool
Std_.isJust (Maybe (Ptr msg) -> Bool) -> m (Maybe (Ptr msg)) -> m Bool
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (Int -> Struct msg -> m (Maybe (Ptr msg))
forall (m :: * -> *) (msg :: Mutability).
ReadCtx m msg =>
Int -> Struct msg -> m (Maybe (Ptr msg))
Untyped.getPtr Int
0 Struct msg
struct))
newtype Call msg
    = Call'newtype_ (Untyped.Struct msg)
instance (Classes.FromStruct msg (Call msg)) where
    fromStruct :: Struct msg -> m (Call msg)
fromStruct Struct msg
struct = (Call msg -> m (Call msg)
forall (f :: * -> *) a. Applicative f => a -> f a
Std_.pure (Struct msg -> Call msg
forall (msg :: Mutability). Struct msg -> Call msg
Call'newtype_ Struct msg
struct))
instance (Classes.ToStruct msg (Call msg)) where
    toStruct :: Call msg -> Struct msg
toStruct (Call'newtype_ Struct msg
struct) = Struct msg
struct
instance (Untyped.HasMessage (Call mut) mut) where
    message :: Call mut -> Message mut
message (Call'newtype_ Struct mut
struct) = (Struct mut -> Message mut
forall a (mut :: Mutability). HasMessage a mut => a -> Message mut
Untyped.message Struct mut
struct)
instance (Untyped.MessageDefault (Call mut) mut) where
    messageDefault :: Message mut -> m (Call mut)
messageDefault Message mut
msg = (Struct mut -> Call mut
forall (msg :: Mutability). Struct msg -> Call msg
Call'newtype_ (Struct mut -> Call mut) -> m (Struct mut) -> m (Call mut)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (Message mut -> m (Struct mut)
forall a (mut :: Mutability) (m :: * -> *).
(MessageDefault a mut, ReadCtx m mut) =>
Message mut -> m a
Untyped.messageDefault Message mut
msg))
instance (Classes.FromPtr msg (Call msg)) where
    fromPtr :: Message msg -> Maybe (Ptr msg) -> m (Call msg)
fromPtr Message msg
msg Maybe (Ptr msg)
ptr = (Struct msg -> Call msg
forall (msg :: Mutability). Struct msg -> Call msg
Call'newtype_ (Struct msg -> Call msg) -> m (Struct msg) -> m (Call msg)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (Message msg -> Maybe (Ptr msg) -> m (Struct msg)
forall (mut :: Mutability) a (m :: * -> *).
(FromPtr mut a, ReadCtx m mut) =>
Message mut -> Maybe (Ptr mut) -> m a
Classes.fromPtr Message msg
msg Maybe (Ptr msg)
ptr))
instance (Classes.ToPtr s (Call (Message.Mut s))) where
    toPtr :: Message ('Mut s) -> Call ('Mut s) -> m (Maybe (Ptr ('Mut s)))
toPtr Message ('Mut s)
msg (Call'newtype_ Struct ('Mut s)
struct) = (Message ('Mut s) -> Struct ('Mut s) -> m (Maybe (Ptr ('Mut s)))
forall s a (m :: * -> *).
(ToPtr s a, WriteCtx m s) =>
Message ('Mut s) -> a -> m (Maybe (Ptr ('Mut s)))
Classes.toPtr Message ('Mut s)
msg Struct ('Mut s)
struct)
instance (Classes.Allocate s (Call (Message.Mut s))) where
    new :: Message ('Mut s) -> m (Call ('Mut s))
new Message ('Mut s)
msg = (Struct ('Mut s) -> Call ('Mut s)
forall (msg :: Mutability). Struct msg -> Call msg
Call'newtype_ (Struct ('Mut s) -> Call ('Mut s))
-> m (Struct ('Mut s)) -> m (Call ('Mut s))
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (Message ('Mut s) -> Word16 -> Word16 -> m (Struct ('Mut s))
forall (m :: * -> *) s.
WriteCtx m s =>
Message ('Mut s) -> Word16 -> Word16 -> m (Struct ('Mut s))
Untyped.allocStruct Message ('Mut s)
msg Word16
3 Word16
3))
instance (Basics.ListElem mut (Call mut)) where
    newtype List mut (Call mut)
        = Call'List_ (Untyped.ListOf mut (Untyped.Struct mut))
    listFromPtr :: Message mut -> Maybe (Ptr mut) -> m (List mut (Call mut))
listFromPtr Message mut
msg Maybe (Ptr mut)
ptr = (ListOf mut (Struct mut) -> List mut (Call mut)
forall (mut :: Mutability).
ListOf mut (Struct mut) -> List mut (Call mut)
Call'List_ (ListOf mut (Struct mut) -> List mut (Call mut))
-> m (ListOf mut (Struct mut)) -> m (List mut (Call mut))
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (Message mut -> Maybe (Ptr mut) -> m (ListOf mut (Struct mut))
forall (mut :: Mutability) a (m :: * -> *).
(FromPtr mut a, ReadCtx m mut) =>
Message mut -> Maybe (Ptr mut) -> m a
Classes.fromPtr Message mut
msg Maybe (Ptr mut)
ptr))
    toUntypedList :: List mut (Call mut) -> List mut
toUntypedList (Call'List_ l) = (ListOf mut (Struct mut) -> List mut
forall (mut :: Mutability). ListOf mut (Struct mut) -> List mut
Untyped.ListStruct ListOf mut (Struct mut)
l)
    length :: List mut (Call mut) -> Int
length (Call'List_ l) = (ListOf mut (Struct mut) -> Int
forall (msg :: Mutability) a. ListOf msg a -> Int
Untyped.length ListOf mut (Struct mut)
l)
    index :: Int -> List mut (Call mut) -> m (Call mut)
index Int
i (Call'List_ l) = (do
        Struct mut
elt <- (Int -> ListOf mut (Struct mut) -> m (Struct mut)
forall (m :: * -> *) (mut :: Mutability) a.
ReadCtx m mut =>
Int -> ListOf mut a -> m a
Untyped.index Int
i ListOf mut (Struct mut)
l)
        (Struct mut -> m (Call mut)
forall (mut :: Mutability) a (m :: * -> *).
(FromStruct mut a, ReadCtx m mut) =>
Struct mut -> m a
Classes.fromStruct Struct mut
elt)
        )
instance (Basics.MutListElem s (Call (Message.Mut s))) where
    setIndex :: Call ('Mut s) -> Int -> List ('Mut s) (Call ('Mut s)) -> m ()
setIndex (Call'newtype_ Struct ('Mut s)
elt) Int
i (Call'List_ l) = (Struct ('Mut s) -> Int -> ListOf ('Mut s) (Struct ('Mut s)) -> m ()
forall (m :: * -> *) s a.
RWCtx m s =>
a -> Int -> ListOf ('Mut s) a -> m ()
Untyped.setIndex Struct ('Mut s)
elt Int
i ListOf ('Mut s) (Struct ('Mut s))
l)
    newList :: Message ('Mut s) -> Int -> m (List ('Mut s) (Call ('Mut s)))
newList Message ('Mut s)
msg Int
len = (ListOf ('Mut s) (Struct ('Mut s)) -> List ('Mut s) (Call ('Mut s))
forall (mut :: Mutability).
ListOf mut (Struct mut) -> List mut (Call mut)
Call'List_ (ListOf ('Mut s) (Struct ('Mut s))
 -> List ('Mut s) (Call ('Mut s)))
-> m (ListOf ('Mut s) (Struct ('Mut s)))
-> m (List ('Mut s) (Call ('Mut s)))
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (Message ('Mut s)
-> Word16 -> Word16 -> Int -> m (ListOf ('Mut s) (Struct ('Mut s)))
forall (m :: * -> *) s.
WriteCtx m s =>
Message ('Mut s)
-> Word16 -> Word16 -> Int -> m (ListOf ('Mut s) (Struct ('Mut s)))
Untyped.allocCompositeList Message ('Mut s)
msg Word16
3 Word16
3 Int
len))
get_Call'questionId :: ((Untyped.ReadCtx m msg)) => (Call msg) -> (m Std_.Word32)
get_Call'questionId :: Call msg -> m Word32
get_Call'questionId (Call'newtype_ Struct msg
struct) = (Struct msg -> Int -> Int -> Word64 -> m Word32
forall (m :: * -> *) (mut :: Mutability) a.
(ReadCtx m mut, IsWord a) =>
Struct mut -> Int -> Int -> Word64 -> m a
GenHelpers.getWordField Struct msg
struct Int
0 Int
0 Word64
0)
set_Call'questionId :: ((Untyped.RWCtx m s)) => (Call (Message.Mut s)) -> Std_.Word32 -> (m ())
set_Call'questionId :: Call ('Mut s) -> Word32 -> m ()
set_Call'questionId (Call'newtype_ Struct ('Mut s)
struct) Word32
value = (Struct ('Mut s) -> Word32 -> Int -> Int -> Word64 -> m ()
forall (m :: * -> *) s a.
(RWCtx m s, Bounded a, Integral a, IsWord a, Bits a) =>
Struct ('Mut s) -> a -> Int -> Int -> Word64 -> m ()
GenHelpers.setWordField Struct ('Mut s)
struct ((Word64 -> Word32
forall a b. (Integral a, Num b) => a -> b
Std_.fromIntegral (Word32 -> Word64
forall a. IsWord a => a -> Word64
Classes.toWord Word32
value)) :: Std_.Word32) Int
0 Int
0 Word64
0)
get_Call'target :: ((Untyped.ReadCtx m msg)
                   ,(Classes.FromPtr msg (MessageTarget msg))) => (Call msg) -> (m (MessageTarget msg))
get_Call'target :: Call msg -> m (MessageTarget msg)
get_Call'target (Call'newtype_ Struct msg
struct) = (do
    Maybe (Ptr msg)
ptr <- (Int -> Struct msg -> m (Maybe (Ptr msg))
forall (m :: * -> *) (msg :: Mutability).
ReadCtx m msg =>
Int -> Struct msg -> m (Maybe (Ptr msg))
Untyped.getPtr Int
0 Struct msg
struct)
    (Message msg -> Maybe (Ptr msg) -> m (MessageTarget msg)
forall (mut :: Mutability) a (m :: * -> *).
(FromPtr mut a, ReadCtx m mut) =>
Message mut -> Maybe (Ptr mut) -> m a
Classes.fromPtr (Struct msg -> Message msg
forall a (mut :: Mutability). HasMessage a mut => a -> Message mut
Untyped.message Struct msg
struct) Maybe (Ptr msg)
ptr)
    )
set_Call'target :: ((Untyped.RWCtx m s)
                   ,(Classes.ToPtr s (MessageTarget (Message.Mut s)))) => (Call (Message.Mut s)) -> (MessageTarget (Message.Mut s)) -> (m ())
set_Call'target :: Call ('Mut s) -> MessageTarget ('Mut s) -> m ()
set_Call'target (Call'newtype_ Struct ('Mut s)
struct) MessageTarget ('Mut s)
value = (do
    Maybe (Ptr ('Mut s))
ptr <- (Message ('Mut s)
-> MessageTarget ('Mut s) -> m (Maybe (Ptr ('Mut s)))
forall s a (m :: * -> *).
(ToPtr s a, WriteCtx m s) =>
Message ('Mut s) -> a -> m (Maybe (Ptr ('Mut s)))
Classes.toPtr (Struct ('Mut s) -> Message ('Mut s)
forall a (mut :: Mutability). HasMessage a mut => a -> Message mut
Untyped.message Struct ('Mut s)
struct) MessageTarget ('Mut s)
value)
    (Maybe (Ptr ('Mut s)) -> Int -> Struct ('Mut s) -> m ()
forall (m :: * -> *) s.
(ReadCtx m ('Mut s), WriteCtx m s) =>
Maybe (Ptr ('Mut s)) -> Int -> Struct ('Mut s) -> m ()
Untyped.setPtr Maybe (Ptr ('Mut s))
ptr Int
0 Struct ('Mut s)
struct)
    )
has_Call'target :: ((Untyped.ReadCtx m msg)) => (Call msg) -> (m Std_.Bool)
has_Call'target :: Call msg -> m Bool
has_Call'target (Call'newtype_ Struct msg
struct) = (Maybe (Ptr msg) -> Bool
forall a. Maybe a -> Bool
Std_.isJust (Maybe (Ptr msg) -> Bool) -> m (Maybe (Ptr msg)) -> m Bool
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (Int -> Struct msg -> m (Maybe (Ptr msg))
forall (m :: * -> *) (msg :: Mutability).
ReadCtx m msg =>
Int -> Struct msg -> m (Maybe (Ptr msg))
Untyped.getPtr Int
0 Struct msg
struct))
new_Call'target :: ((Untyped.RWCtx m s)) => (Call (Message.Mut s)) -> (m (MessageTarget (Message.Mut s)))
new_Call'target :: Call ('Mut s) -> m (MessageTarget ('Mut s))
new_Call'target Call ('Mut s)
struct = (do
    MessageTarget ('Mut s)
result <- (Message ('Mut s) -> m (MessageTarget ('Mut s))
forall s e (m :: * -> *).
(Allocate s e, WriteCtx m s) =>
Message ('Mut s) -> m e
Classes.new (Call ('Mut s) -> Message ('Mut s)
forall a (mut :: Mutability). HasMessage a mut => a -> Message mut
Untyped.message Call ('Mut s)
struct))
    (Call ('Mut s) -> MessageTarget ('Mut s) -> m ()
forall (m :: * -> *) s.
(RWCtx m s, ToPtr s (MessageTarget ('Mut s))) =>
Call ('Mut s) -> MessageTarget ('Mut s) -> m ()
set_Call'target Call ('Mut s)
struct MessageTarget ('Mut s)
result)
    (MessageTarget ('Mut s) -> m (MessageTarget ('Mut s))
forall (f :: * -> *) a. Applicative f => a -> f a
Std_.pure MessageTarget ('Mut s)
result)
    )
get_Call'interfaceId :: ((Untyped.ReadCtx m msg)) => (Call msg) -> (m Std_.Word64)
get_Call'interfaceId :: Call msg -> m Word64
get_Call'interfaceId (Call'newtype_ Struct msg
struct) = (Struct msg -> Int -> Int -> Word64 -> m Word64
forall (m :: * -> *) (mut :: Mutability) a.
(ReadCtx m mut, IsWord a) =>
Struct mut -> Int -> Int -> Word64 -> m a
GenHelpers.getWordField Struct msg
struct Int
1 Int
0 Word64
0)
set_Call'interfaceId :: ((Untyped.RWCtx m s)) => (Call (Message.Mut s)) -> Std_.Word64 -> (m ())
set_Call'interfaceId :: Call ('Mut s) -> Word64 -> m ()
set_Call'interfaceId (Call'newtype_ Struct ('Mut s)
struct) Word64
value = (Struct ('Mut s) -> Word64 -> Int -> Int -> Word64 -> m ()
forall (m :: * -> *) s a.
(RWCtx m s, Bounded a, Integral a, IsWord a, Bits a) =>
Struct ('Mut s) -> a -> Int -> Int -> Word64 -> m ()
GenHelpers.setWordField Struct ('Mut s)
struct ((Word64 -> Word64
forall a b. (Integral a, Num b) => a -> b
Std_.fromIntegral (Word64 -> Word64
forall a. IsWord a => a -> Word64
Classes.toWord Word64
value)) :: Std_.Word64) Int
1 Int
0 Word64
0)
get_Call'methodId :: ((Untyped.ReadCtx m msg)) => (Call msg) -> (m Std_.Word16)
get_Call'methodId :: Call msg -> m Word16
get_Call'methodId (Call'newtype_ Struct msg
struct) = (Struct msg -> Int -> Int -> Word64 -> m Word16
forall (m :: * -> *) (mut :: Mutability) a.
(ReadCtx m mut, IsWord a) =>
Struct mut -> Int -> Int -> Word64 -> m a
GenHelpers.getWordField Struct msg
struct Int
0 Int
32 Word64
0)
set_Call'methodId :: ((Untyped.RWCtx m s)) => (Call (Message.Mut s)) -> Std_.Word16 -> (m ())
set_Call'methodId :: Call ('Mut s) -> Word16 -> m ()
set_Call'methodId (Call'newtype_ Struct ('Mut s)
struct) Word16
value = (Struct ('Mut s) -> Word16 -> Int -> Int -> Word64 -> m ()
forall (m :: * -> *) s a.
(RWCtx m s, Bounded a, Integral a, IsWord a, Bits a) =>
Struct ('Mut s) -> a -> Int -> Int -> Word64 -> m ()
GenHelpers.setWordField Struct ('Mut s)
struct ((Word64 -> Word16
forall a b. (Integral a, Num b) => a -> b
Std_.fromIntegral (Word16 -> Word64
forall a. IsWord a => a -> Word64
Classes.toWord Word16
value)) :: Std_.Word16) Int
0 Int
32 Word64
0)
get_Call'params :: ((Untyped.ReadCtx m msg)
                   ,(Classes.FromPtr msg (Payload msg))) => (Call msg) -> (m (Payload msg))
get_Call'params :: Call msg -> m (Payload msg)
get_Call'params (Call'newtype_ Struct msg
struct) = (do
    Maybe (Ptr msg)
ptr <- (Int -> Struct msg -> m (Maybe (Ptr msg))
forall (m :: * -> *) (msg :: Mutability).
ReadCtx m msg =>
Int -> Struct msg -> m (Maybe (Ptr msg))
Untyped.getPtr Int
1 Struct msg
struct)
    (Message msg -> Maybe (Ptr msg) -> m (Payload msg)
forall (mut :: Mutability) a (m :: * -> *).
(FromPtr mut a, ReadCtx m mut) =>
Message mut -> Maybe (Ptr mut) -> m a
Classes.fromPtr (Struct msg -> Message msg
forall a (mut :: Mutability). HasMessage a mut => a -> Message mut
Untyped.message Struct msg
struct) Maybe (Ptr msg)
ptr)
    )
set_Call'params :: ((Untyped.RWCtx m s)
                   ,(Classes.ToPtr s (Payload (Message.Mut s)))) => (Call (Message.Mut s)) -> (Payload (Message.Mut s)) -> (m ())
set_Call'params :: Call ('Mut s) -> Payload ('Mut s) -> m ()
set_Call'params (Call'newtype_ Struct ('Mut s)
struct) Payload ('Mut s)
value = (do
    Maybe (Ptr ('Mut s))
ptr <- (Message ('Mut s) -> Payload ('Mut s) -> m (Maybe (Ptr ('Mut s)))
forall s a (m :: * -> *).
(ToPtr s a, WriteCtx m s) =>
Message ('Mut s) -> a -> m (Maybe (Ptr ('Mut s)))
Classes.toPtr (Struct ('Mut s) -> Message ('Mut s)
forall a (mut :: Mutability). HasMessage a mut => a -> Message mut
Untyped.message Struct ('Mut s)
struct) Payload ('Mut s)
value)
    (Maybe (Ptr ('Mut s)) -> Int -> Struct ('Mut s) -> m ()
forall (m :: * -> *) s.
(ReadCtx m ('Mut s), WriteCtx m s) =>
Maybe (Ptr ('Mut s)) -> Int -> Struct ('Mut s) -> m ()
Untyped.setPtr Maybe (Ptr ('Mut s))
ptr Int
1 Struct ('Mut s)
struct)
    )
has_Call'params :: ((Untyped.ReadCtx m msg)) => (Call msg) -> (m Std_.Bool)
has_Call'params :: Call msg -> m Bool
has_Call'params (Call'newtype_ Struct msg
struct) = (Maybe (Ptr msg) -> Bool
forall a. Maybe a -> Bool
Std_.isJust (Maybe (Ptr msg) -> Bool) -> m (Maybe (Ptr msg)) -> m Bool
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (Int -> Struct msg -> m (Maybe (Ptr msg))
forall (m :: * -> *) (msg :: Mutability).
ReadCtx m msg =>
Int -> Struct msg -> m (Maybe (Ptr msg))
Untyped.getPtr Int
1 Struct msg
struct))
new_Call'params :: ((Untyped.RWCtx m s)) => (Call (Message.Mut s)) -> (m (Payload (Message.Mut s)))
new_Call'params :: Call ('Mut s) -> m (Payload ('Mut s))
new_Call'params Call ('Mut s)
struct = (do
    Payload ('Mut s)
result <- (Message ('Mut s) -> m (Payload ('Mut s))
forall s e (m :: * -> *).
(Allocate s e, WriteCtx m s) =>
Message ('Mut s) -> m e
Classes.new (Call ('Mut s) -> Message ('Mut s)
forall a (mut :: Mutability). HasMessage a mut => a -> Message mut
Untyped.message Call ('Mut s)
struct))
    (Call ('Mut s) -> Payload ('Mut s) -> m ()
forall (m :: * -> *) s.
(RWCtx m s, ToPtr s (Payload ('Mut s))) =>
Call ('Mut s) -> Payload ('Mut s) -> m ()
set_Call'params Call ('Mut s)
struct Payload ('Mut s)
result)
    (Payload ('Mut s) -> m (Payload ('Mut s))
forall (f :: * -> *) a. Applicative f => a -> f a
Std_.pure Payload ('Mut s)
result)
    )
get_Call'sendResultsTo :: ((Untyped.ReadCtx m msg)
                          ,(Classes.FromStruct msg (Call'sendResultsTo msg))) => (Call msg) -> (m (Call'sendResultsTo msg))
get_Call'sendResultsTo :: Call msg -> m (Call'sendResultsTo msg)
get_Call'sendResultsTo (Call'newtype_ Struct msg
struct) = (Struct msg -> m (Call'sendResultsTo msg)
forall (mut :: Mutability) a (m :: * -> *).
(FromStruct mut a, ReadCtx m mut) =>
Struct mut -> m a
Classes.fromStruct Struct msg
struct)
get_Call'allowThirdPartyTailCall :: ((Untyped.ReadCtx m msg)) => (Call msg) -> (m Std_.Bool)
get_Call'allowThirdPartyTailCall :: Call msg -> m Bool
get_Call'allowThirdPartyTailCall (Call'newtype_ Struct msg
struct) = (Struct msg -> Int -> Int -> Word64 -> m Bool
forall (m :: * -> *) (mut :: Mutability) a.
(ReadCtx m mut, IsWord a) =>
Struct mut -> Int -> Int -> Word64 -> m a
GenHelpers.getWordField Struct msg
struct Int
2 Int
0 Word64
0)
set_Call'allowThirdPartyTailCall :: ((Untyped.RWCtx m s)) => (Call (Message.Mut s)) -> Std_.Bool -> (m ())
set_Call'allowThirdPartyTailCall :: Call ('Mut s) -> Bool -> m ()
set_Call'allowThirdPartyTailCall (Call'newtype_ Struct ('Mut s)
struct) Bool
value = (Struct ('Mut s) -> Word1 -> Int -> Int -> Word64 -> m ()
forall (m :: * -> *) s a.
(RWCtx m s, Bounded a, Integral a, IsWord a, Bits a) =>
Struct ('Mut s) -> a -> Int -> Int -> Word64 -> m ()
GenHelpers.setWordField Struct ('Mut s)
struct ((Word64 -> Word1
forall a b. (Integral a, Num b) => a -> b
Std_.fromIntegral (Bool -> Word64
forall a. IsWord a => a -> Word64
Classes.toWord Bool
value)) :: Std_.Word1) Int
2 Int
0 Word64
0)
newtype Call'sendResultsTo msg
    = Call'sendResultsTo'newtype_ (Untyped.Struct msg)
instance (Classes.FromStruct msg (Call'sendResultsTo msg)) where
    fromStruct :: Struct msg -> m (Call'sendResultsTo msg)
fromStruct Struct msg
struct = (Call'sendResultsTo msg -> m (Call'sendResultsTo msg)
forall (f :: * -> *) a. Applicative f => a -> f a
Std_.pure (Struct msg -> Call'sendResultsTo msg
forall (msg :: Mutability). Struct msg -> Call'sendResultsTo msg
Call'sendResultsTo'newtype_ Struct msg
struct))
instance (Classes.ToStruct msg (Call'sendResultsTo msg)) where
    toStruct :: Call'sendResultsTo msg -> Struct msg
toStruct (Call'sendResultsTo'newtype_ Struct msg
struct) = Struct msg
struct
instance (Untyped.HasMessage (Call'sendResultsTo mut) mut) where
    message :: Call'sendResultsTo mut -> Message mut
message (Call'sendResultsTo'newtype_ Struct mut
struct) = (Struct mut -> Message mut
forall a (mut :: Mutability). HasMessage a mut => a -> Message mut
Untyped.message Struct mut
struct)
instance (Untyped.MessageDefault (Call'sendResultsTo mut) mut) where
    messageDefault :: Message mut -> m (Call'sendResultsTo mut)
messageDefault Message mut
msg = (Struct mut -> Call'sendResultsTo mut
forall (msg :: Mutability). Struct msg -> Call'sendResultsTo msg
Call'sendResultsTo'newtype_ (Struct mut -> Call'sendResultsTo mut)
-> m (Struct mut) -> m (Call'sendResultsTo mut)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (Message mut -> m (Struct mut)
forall a (mut :: Mutability) (m :: * -> *).
(MessageDefault a mut, ReadCtx m mut) =>
Message mut -> m a
Untyped.messageDefault Message mut
msg))
data Call'sendResultsTo' (mut :: Message.Mutability)
    = Call'sendResultsTo'caller 
    | Call'sendResultsTo'yourself 
    | Call'sendResultsTo'thirdParty (Std_.Maybe (Untyped.Ptr mut))
    | Call'sendResultsTo'unknown' Std_.Word16
instance (Classes.FromStruct mut (Call'sendResultsTo' mut)) where
    fromStruct :: Struct mut -> m (Call'sendResultsTo' mut)
fromStruct Struct mut
struct = (do
        Word16
tag <- (Struct mut -> Int -> m Word16
forall (m :: * -> *) (mut :: Mutability).
ReadCtx m mut =>
Struct mut -> Int -> m Word16
GenHelpers.getTag Struct mut
struct Int
3)
        case Word16
tag of
            Word16
0 ->
                (Call'sendResultsTo' mut -> m (Call'sendResultsTo' mut)
forall (f :: * -> *) a. Applicative f => a -> f a
Std_.pure Call'sendResultsTo' mut
forall (mut :: Mutability). Call'sendResultsTo' mut
Call'sendResultsTo'caller)
            Word16
1 ->
                (Call'sendResultsTo' mut -> m (Call'sendResultsTo' mut)
forall (f :: * -> *) a. Applicative f => a -> f a
Std_.pure Call'sendResultsTo' mut
forall (mut :: Mutability). Call'sendResultsTo' mut
Call'sendResultsTo'yourself)
            Word16
2 ->
                (Maybe (Ptr mut) -> Call'sendResultsTo' mut
forall (mut :: Mutability).
Maybe (Ptr mut) -> Call'sendResultsTo' mut
Call'sendResultsTo'thirdParty (Maybe (Ptr mut) -> Call'sendResultsTo' mut)
-> m (Maybe (Ptr mut)) -> m (Call'sendResultsTo' mut)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (do
                    Maybe (Ptr mut)
ptr <- (Int -> Struct mut -> m (Maybe (Ptr mut))
forall (m :: * -> *) (msg :: Mutability).
ReadCtx m msg =>
Int -> Struct msg -> m (Maybe (Ptr msg))
Untyped.getPtr Int
2 Struct mut
struct)
                    (Message mut -> Maybe (Ptr mut) -> m (Maybe (Ptr mut))
forall (mut :: Mutability) a (m :: * -> *).
(FromPtr mut a, ReadCtx m mut) =>
Message mut -> Maybe (Ptr mut) -> m a
Classes.fromPtr (Struct mut -> Message mut
forall a (mut :: Mutability). HasMessage a mut => a -> Message mut
Untyped.message Struct mut
struct) Maybe (Ptr mut)
ptr)
                    ))
            Word16
_ ->
                (Call'sendResultsTo' mut -> m (Call'sendResultsTo' mut)
forall (f :: * -> *) a. Applicative f => a -> f a
Std_.pure (Word16 -> Call'sendResultsTo' mut
forall (mut :: Mutability). Word16 -> Call'sendResultsTo' mut
Call'sendResultsTo'unknown' (Word16 -> Word16
forall a b. (Integral a, Num b) => a -> b
Std_.fromIntegral Word16
tag)))
        )
get_Call'sendResultsTo' :: ((Untyped.ReadCtx m msg)
                           ,(Classes.FromStruct msg (Call'sendResultsTo' msg))) => (Call'sendResultsTo msg) -> (m (Call'sendResultsTo' msg))
get_Call'sendResultsTo' :: Call'sendResultsTo msg -> m (Call'sendResultsTo' msg)
get_Call'sendResultsTo' (Call'sendResultsTo'newtype_ Struct msg
struct) = (Struct msg -> m (Call'sendResultsTo' msg)
forall (mut :: Mutability) a (m :: * -> *).
(FromStruct mut a, ReadCtx m mut) =>
Struct mut -> m a
Classes.fromStruct Struct msg
struct)
set_Call'sendResultsTo'caller :: ((Untyped.RWCtx m s)) => (Call'sendResultsTo (Message.Mut s)) -> (m ())
set_Call'sendResultsTo'caller :: Call'sendResultsTo ('Mut s) -> m ()
set_Call'sendResultsTo'caller (Call'sendResultsTo'newtype_ Struct ('Mut s)
struct) = (do
    (Struct ('Mut s) -> Word16 -> Int -> Int -> Word64 -> m ()
forall (m :: * -> *) s a.
(RWCtx m s, Bounded a, Integral a, IsWord a, Bits a) =>
Struct ('Mut s) -> a -> Int -> Int -> Word64 -> m ()
GenHelpers.setWordField Struct ('Mut s)
struct (Word16
0 :: Std_.Word16) Int
0 Int
48 Word64
0)
    (() -> m ()
forall (f :: * -> *) a. Applicative f => a -> f a
Std_.pure ())
    )
set_Call'sendResultsTo'yourself :: ((Untyped.RWCtx m s)) => (Call'sendResultsTo (Message.Mut s)) -> (m ())
set_Call'sendResultsTo'yourself :: Call'sendResultsTo ('Mut s) -> m ()
set_Call'sendResultsTo'yourself (Call'sendResultsTo'newtype_ Struct ('Mut s)
struct) = (do
    (Struct ('Mut s) -> Word16 -> Int -> Int -> Word64 -> m ()
forall (m :: * -> *) s a.
(RWCtx m s, Bounded a, Integral a, IsWord a, Bits a) =>
Struct ('Mut s) -> a -> Int -> Int -> Word64 -> m ()
GenHelpers.setWordField Struct ('Mut s)
struct (Word16
1 :: Std_.Word16) Int
0 Int
48 Word64
0)
    (() -> m ()
forall (f :: * -> *) a. Applicative f => a -> f a
Std_.pure ())
    )
set_Call'sendResultsTo'thirdParty :: ((Untyped.RWCtx m s)
                                     ,(Classes.ToPtr s (Std_.Maybe (Untyped.Ptr (Message.Mut s))))) => (Call'sendResultsTo (Message.Mut s)) -> (Std_.Maybe (Untyped.Ptr (Message.Mut s))) -> (m ())
set_Call'sendResultsTo'thirdParty :: Call'sendResultsTo ('Mut s) -> Maybe (Ptr ('Mut s)) -> m ()
set_Call'sendResultsTo'thirdParty (Call'sendResultsTo'newtype_ Struct ('Mut s)
struct) Maybe (Ptr ('Mut s))
value = (do
    (Struct ('Mut s) -> Word16 -> Int -> Int -> Word64 -> m ()
forall (m :: * -> *) s a.
(RWCtx m s, Bounded a, Integral a, IsWord a, Bits a) =>
Struct ('Mut s) -> a -> Int -> Int -> Word64 -> m ()
GenHelpers.setWordField Struct ('Mut s)
struct (Word16
2 :: Std_.Word16) Int
0 Int
48 Word64
0)
    (do
        Maybe (Ptr ('Mut s))
ptr <- (Message ('Mut s)
-> Maybe (Ptr ('Mut s)) -> m (Maybe (Ptr ('Mut s)))
forall s a (m :: * -> *).
(ToPtr s a, WriteCtx m s) =>
Message ('Mut s) -> a -> m (Maybe (Ptr ('Mut s)))
Classes.toPtr (Struct ('Mut s) -> Message ('Mut s)
forall a (mut :: Mutability). HasMessage a mut => a -> Message mut
Untyped.message Struct ('Mut s)
struct) Maybe (Ptr ('Mut s))
value)
        (Maybe (Ptr ('Mut s)) -> Int -> Struct ('Mut s) -> m ()
forall (m :: * -> *) s.
(ReadCtx m ('Mut s), WriteCtx m s) =>
Maybe (Ptr ('Mut s)) -> Int -> Struct ('Mut s) -> m ()
Untyped.setPtr Maybe (Ptr ('Mut s))
ptr Int
2 Struct ('Mut s)
struct)
        )
    )
set_Call'sendResultsTo'unknown' :: ((Untyped.RWCtx m s)) => (Call'sendResultsTo (Message.Mut s)) -> Std_.Word16 -> (m ())
set_Call'sendResultsTo'unknown' :: Call'sendResultsTo ('Mut s) -> Word16 -> m ()
set_Call'sendResultsTo'unknown' (Call'sendResultsTo'newtype_ Struct ('Mut s)
struct) Word16
value = (Struct ('Mut s) -> Word16 -> Int -> Int -> Word64 -> m ()
forall (m :: * -> *) s a.
(RWCtx m s, Bounded a, Integral a, IsWord a, Bits a) =>
Struct ('Mut s) -> a -> Int -> Int -> Word64 -> m ()
GenHelpers.setWordField Struct ('Mut s)
struct ((Word64 -> Word16
forall a b. (Integral a, Num b) => a -> b
Std_.fromIntegral (Word16 -> Word64
forall a. IsWord a => a -> Word64
Classes.toWord Word16
value)) :: Std_.Word16) Int
0 Int
48 Word64
0)
newtype Return msg
    = Return'newtype_ (Untyped.Struct msg)
instance (Classes.FromStruct msg (Return msg)) where
    fromStruct :: Struct msg -> m (Return msg)
fromStruct Struct msg
struct = (Return msg -> m (Return msg)
forall (f :: * -> *) a. Applicative f => a -> f a
Std_.pure (Struct msg -> Return msg
forall (msg :: Mutability). Struct msg -> Return msg
Return'newtype_ Struct msg
struct))
instance (Classes.ToStruct msg (Return msg)) where
    toStruct :: Return msg -> Struct msg
toStruct (Return'newtype_ Struct msg
struct) = Struct msg
struct
instance (Untyped.HasMessage (Return mut) mut) where
    message :: Return mut -> Message mut
message (Return'newtype_ Struct mut
struct) = (Struct mut -> Message mut
forall a (mut :: Mutability). HasMessage a mut => a -> Message mut
Untyped.message Struct mut
struct)
instance (Untyped.MessageDefault (Return mut) mut) where
    messageDefault :: Message mut -> m (Return mut)
messageDefault Message mut
msg = (Struct mut -> Return mut
forall (msg :: Mutability). Struct msg -> Return msg
Return'newtype_ (Struct mut -> Return mut) -> m (Struct mut) -> m (Return mut)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (Message mut -> m (Struct mut)
forall a (mut :: Mutability) (m :: * -> *).
(MessageDefault a mut, ReadCtx m mut) =>
Message mut -> m a
Untyped.messageDefault Message mut
msg))
instance (Classes.FromPtr msg (Return msg)) where
    fromPtr :: Message msg -> Maybe (Ptr msg) -> m (Return msg)
fromPtr Message msg
msg Maybe (Ptr msg)
ptr = (Struct msg -> Return msg
forall (msg :: Mutability). Struct msg -> Return msg
Return'newtype_ (Struct msg -> Return msg) -> m (Struct msg) -> m (Return msg)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (Message msg -> Maybe (Ptr msg) -> m (Struct msg)
forall (mut :: Mutability) a (m :: * -> *).
(FromPtr mut a, ReadCtx m mut) =>
Message mut -> Maybe (Ptr mut) -> m a
Classes.fromPtr Message msg
msg Maybe (Ptr msg)
ptr))
instance (Classes.ToPtr s (Return (Message.Mut s))) where
    toPtr :: Message ('Mut s) -> Return ('Mut s) -> m (Maybe (Ptr ('Mut s)))
toPtr Message ('Mut s)
msg (Return'newtype_ Struct ('Mut s)
struct) = (Message ('Mut s) -> Struct ('Mut s) -> m (Maybe (Ptr ('Mut s)))
forall s a (m :: * -> *).
(ToPtr s a, WriteCtx m s) =>
Message ('Mut s) -> a -> m (Maybe (Ptr ('Mut s)))
Classes.toPtr Message ('Mut s)
msg Struct ('Mut s)
struct)
instance (Classes.Allocate s (Return (Message.Mut s))) where
    new :: Message ('Mut s) -> m (Return ('Mut s))
new Message ('Mut s)
msg = (Struct ('Mut s) -> Return ('Mut s)
forall (msg :: Mutability). Struct msg -> Return msg
Return'newtype_ (Struct ('Mut s) -> Return ('Mut s))
-> m (Struct ('Mut s)) -> m (Return ('Mut s))
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (Message ('Mut s) -> Word16 -> Word16 -> m (Struct ('Mut s))
forall (m :: * -> *) s.
WriteCtx m s =>
Message ('Mut s) -> Word16 -> Word16 -> m (Struct ('Mut s))
Untyped.allocStruct Message ('Mut s)
msg Word16
2 Word16
1))
instance (Basics.ListElem mut (Return mut)) where
    newtype List mut (Return mut)
        = Return'List_ (Untyped.ListOf mut (Untyped.Struct mut))
    listFromPtr :: Message mut -> Maybe (Ptr mut) -> m (List mut (Return mut))
listFromPtr Message mut
msg Maybe (Ptr mut)
ptr = (ListOf mut (Struct mut) -> List mut (Return mut)
forall (mut :: Mutability).
ListOf mut (Struct mut) -> List mut (Return mut)
Return'List_ (ListOf mut (Struct mut) -> List mut (Return mut))
-> m (ListOf mut (Struct mut)) -> m (List mut (Return mut))
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (Message mut -> Maybe (Ptr mut) -> m (ListOf mut (Struct mut))
forall (mut :: Mutability) a (m :: * -> *).
(FromPtr mut a, ReadCtx m mut) =>
Message mut -> Maybe (Ptr mut) -> m a
Classes.fromPtr Message mut
msg Maybe (Ptr mut)
ptr))
    toUntypedList :: List mut (Return mut) -> List mut
toUntypedList (Return'List_ l) = (ListOf mut (Struct mut) -> List mut
forall (mut :: Mutability). ListOf mut (Struct mut) -> List mut
Untyped.ListStruct ListOf mut (Struct mut)
l)
    length :: List mut (Return mut) -> Int
length (Return'List_ l) = (ListOf mut (Struct mut) -> Int
forall (msg :: Mutability) a. ListOf msg a -> Int
Untyped.length ListOf mut (Struct mut)
l)
    index :: Int -> List mut (Return mut) -> m (Return mut)
index Int
i (Return'List_ l) = (do
        Struct mut
elt <- (Int -> ListOf mut (Struct mut) -> m (Struct mut)
forall (m :: * -> *) (mut :: Mutability) a.
ReadCtx m mut =>
Int -> ListOf mut a -> m a
Untyped.index Int
i ListOf mut (Struct mut)
l)
        (Struct mut -> m (Return mut)
forall (mut :: Mutability) a (m :: * -> *).
(FromStruct mut a, ReadCtx m mut) =>
Struct mut -> m a
Classes.fromStruct Struct mut
elt)
        )
instance (Basics.MutListElem s (Return (Message.Mut s))) where
    setIndex :: Return ('Mut s) -> Int -> List ('Mut s) (Return ('Mut s)) -> m ()
setIndex (Return'newtype_ Struct ('Mut s)
elt) Int
i (Return'List_ l) = (Struct ('Mut s) -> Int -> ListOf ('Mut s) (Struct ('Mut s)) -> m ()
forall (m :: * -> *) s a.
RWCtx m s =>
a -> Int -> ListOf ('Mut s) a -> m ()
Untyped.setIndex Struct ('Mut s)
elt Int
i ListOf ('Mut s) (Struct ('Mut s))
l)
    newList :: Message ('Mut s) -> Int -> m (List ('Mut s) (Return ('Mut s)))
newList Message ('Mut s)
msg Int
len = (ListOf ('Mut s) (Struct ('Mut s))
-> List ('Mut s) (Return ('Mut s))
forall (mut :: Mutability).
ListOf mut (Struct mut) -> List mut (Return mut)
Return'List_ (ListOf ('Mut s) (Struct ('Mut s))
 -> List ('Mut s) (Return ('Mut s)))
-> m (ListOf ('Mut s) (Struct ('Mut s)))
-> m (List ('Mut s) (Return ('Mut s)))
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (Message ('Mut s)
-> Word16 -> Word16 -> Int -> m (ListOf ('Mut s) (Struct ('Mut s)))
forall (m :: * -> *) s.
WriteCtx m s =>
Message ('Mut s)
-> Word16 -> Word16 -> Int -> m (ListOf ('Mut s) (Struct ('Mut s)))
Untyped.allocCompositeList Message ('Mut s)
msg Word16
2 Word16
1 Int
len))
get_Return'answerId :: ((Untyped.ReadCtx m msg)) => (Return msg) -> (m Std_.Word32)
get_Return'answerId :: Return msg -> m Word32
get_Return'answerId (Return'newtype_ Struct msg
struct) = (Struct msg -> Int -> Int -> Word64 -> m Word32
forall (m :: * -> *) (mut :: Mutability) a.
(ReadCtx m mut, IsWord a) =>
Struct mut -> Int -> Int -> Word64 -> m a
GenHelpers.getWordField Struct msg
struct Int
0 Int
0 Word64
0)
set_Return'answerId :: ((Untyped.RWCtx m s)) => (Return (Message.Mut s)) -> Std_.Word32 -> (m ())
set_Return'answerId :: Return ('Mut s) -> Word32 -> m ()
set_Return'answerId (Return'newtype_ Struct ('Mut s)
struct) Word32
value = (Struct ('Mut s) -> Word32 -> Int -> Int -> Word64 -> m ()
forall (m :: * -> *) s a.
(RWCtx m s, Bounded a, Integral a, IsWord a, Bits a) =>
Struct ('Mut s) -> a -> Int -> Int -> Word64 -> m ()
GenHelpers.setWordField Struct ('Mut s)
struct ((Word64 -> Word32
forall a b. (Integral a, Num b) => a -> b
Std_.fromIntegral (Word32 -> Word64
forall a. IsWord a => a -> Word64
Classes.toWord Word32
value)) :: Std_.Word32) Int
0 Int
0 Word64
0)
get_Return'releaseParamCaps :: ((Untyped.ReadCtx m msg)) => (Return msg) -> (m Std_.Bool)
get_Return'releaseParamCaps :: Return msg -> m Bool
get_Return'releaseParamCaps (Return'newtype_ Struct msg
struct) = (Struct msg -> Int -> Int -> Word64 -> m Bool
forall (m :: * -> *) (mut :: Mutability) a.
(ReadCtx m mut, IsWord a) =>
Struct mut -> Int -> Int -> Word64 -> m a
GenHelpers.getWordField Struct msg
struct Int
0 Int
32 Word64
1)
set_Return'releaseParamCaps :: ((Untyped.RWCtx m s)) => (Return (Message.Mut s)) -> Std_.Bool -> (m ())
set_Return'releaseParamCaps :: Return ('Mut s) -> Bool -> m ()
set_Return'releaseParamCaps (Return'newtype_ Struct ('Mut s)
struct) Bool
value = (Struct ('Mut s) -> Word1 -> Int -> Int -> Word64 -> m ()
forall (m :: * -> *) s a.
(RWCtx m s, Bounded a, Integral a, IsWord a, Bits a) =>
Struct ('Mut s) -> a -> Int -> Int -> Word64 -> m ()
GenHelpers.setWordField Struct ('Mut s)
struct ((Word64 -> Word1
forall a b. (Integral a, Num b) => a -> b
Std_.fromIntegral (Bool -> Word64
forall a. IsWord a => a -> Word64
Classes.toWord Bool
value)) :: Std_.Word1) Int
0 Int
32 Word64
1)
data Return' (mut :: Message.Mutability)
    = Return'results (Payload mut)
    | Return'exception (Exception mut)
    | Return'canceled 
    | Return'resultsSentElsewhere 
    | Return'takeFromOtherQuestion Std_.Word32
    | Return'acceptFromThirdParty (Std_.Maybe (Untyped.Ptr mut))
    | Return'unknown' Std_.Word16
instance (Classes.FromStruct mut (Return' mut)) where
    fromStruct :: Struct mut -> m (Return' mut)
fromStruct Struct mut
struct = (do
        Word16
tag <- (Struct mut -> Int -> m Word16
forall (m :: * -> *) (mut :: Mutability).
ReadCtx m mut =>
Struct mut -> Int -> m Word16
GenHelpers.getTag Struct mut
struct Int
3)
        case Word16
tag of
            Word16
0 ->
                (Payload mut -> Return' mut
forall (mut :: Mutability). Payload mut -> Return' mut
Return'results (Payload mut -> Return' mut) -> m (Payload mut) -> m (Return' mut)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (do
                    Maybe (Ptr mut)
ptr <- (Int -> Struct mut -> m (Maybe (Ptr mut))
forall (m :: * -> *) (msg :: Mutability).
ReadCtx m msg =>
Int -> Struct msg -> m (Maybe (Ptr msg))
Untyped.getPtr Int
0 Struct mut
struct)
                    (Message mut -> Maybe (Ptr mut) -> m (Payload mut)
forall (mut :: Mutability) a (m :: * -> *).
(FromPtr mut a, ReadCtx m mut) =>
Message mut -> Maybe (Ptr mut) -> m a
Classes.fromPtr (Struct mut -> Message mut
forall a (mut :: Mutability). HasMessage a mut => a -> Message mut
Untyped.message Struct mut
struct) Maybe (Ptr mut)
ptr)
                    ))
            Word16
1 ->
                (Exception mut -> Return' mut
forall (mut :: Mutability). Exception mut -> Return' mut
Return'exception (Exception mut -> Return' mut)
-> m (Exception mut) -> m (Return' mut)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (do
                    Maybe (Ptr mut)
ptr <- (Int -> Struct mut -> m (Maybe (Ptr mut))
forall (m :: * -> *) (msg :: Mutability).
ReadCtx m msg =>
Int -> Struct msg -> m (Maybe (Ptr msg))
Untyped.getPtr Int
0 Struct mut
struct)
                    (Message mut -> Maybe (Ptr mut) -> m (Exception mut)
forall (mut :: Mutability) a (m :: * -> *).
(FromPtr mut a, ReadCtx m mut) =>
Message mut -> Maybe (Ptr mut) -> m a
Classes.fromPtr (Struct mut -> Message mut
forall a (mut :: Mutability). HasMessage a mut => a -> Message mut
Untyped.message Struct mut
struct) Maybe (Ptr mut)
ptr)
                    ))
            Word16
2 ->
                (Return' mut -> m (Return' mut)
forall (f :: * -> *) a. Applicative f => a -> f a
Std_.pure Return' mut
forall (mut :: Mutability). Return' mut
Return'canceled)
            Word16
3 ->
                (Return' mut -> m (Return' mut)
forall (f :: * -> *) a. Applicative f => a -> f a
Std_.pure Return' mut
forall (mut :: Mutability). Return' mut
Return'resultsSentElsewhere)
            Word16
4 ->
                (Word32 -> Return' mut
forall (mut :: Mutability). Word32 -> Return' mut
Return'takeFromOtherQuestion (Word32 -> Return' mut) -> m Word32 -> m (Return' mut)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (Struct mut -> Int -> Int -> Word64 -> m Word32
forall (m :: * -> *) (mut :: Mutability) a.
(ReadCtx m mut, IsWord a) =>
Struct mut -> Int -> Int -> Word64 -> m a
GenHelpers.getWordField Struct mut
struct Int
1 Int
0 Word64
0))
            Word16
5 ->
                (Maybe (Ptr mut) -> Return' mut
forall (mut :: Mutability). Maybe (Ptr mut) -> Return' mut
Return'acceptFromThirdParty (Maybe (Ptr mut) -> Return' mut)
-> m (Maybe (Ptr mut)) -> m (Return' mut)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (do
                    Maybe (Ptr mut)
ptr <- (Int -> Struct mut -> m (Maybe (Ptr mut))
forall (m :: * -> *) (msg :: Mutability).
ReadCtx m msg =>
Int -> Struct msg -> m (Maybe (Ptr msg))
Untyped.getPtr Int
0 Struct mut
struct)
                    (Message mut -> Maybe (Ptr mut) -> m (Maybe (Ptr mut))
forall (mut :: Mutability) a (m :: * -> *).
(FromPtr mut a, ReadCtx m mut) =>
Message mut -> Maybe (Ptr mut) -> m a
Classes.fromPtr (Struct mut -> Message mut
forall a (mut :: Mutability). HasMessage a mut => a -> Message mut
Untyped.message Struct mut
struct) Maybe (Ptr mut)
ptr)
                    ))
            Word16
_ ->
                (Return' mut -> m (Return' mut)
forall (f :: * -> *) a. Applicative f => a -> f a
Std_.pure (Word16 -> Return' mut
forall (mut :: Mutability). Word16 -> Return' mut
Return'unknown' (Word16 -> Word16
forall a b. (Integral a, Num b) => a -> b
Std_.fromIntegral Word16
tag)))
        )
get_Return' :: ((Untyped.ReadCtx m msg)
               ,(Classes.FromStruct msg (Return' msg))) => (Return msg) -> (m (Return' msg))
get_Return' :: Return msg -> m (Return' msg)
get_Return' (Return'newtype_ Struct msg
struct) = (Struct msg -> m (Return' msg)
forall (mut :: Mutability) a (m :: * -> *).
(FromStruct mut a, ReadCtx m mut) =>
Struct mut -> m a
Classes.fromStruct Struct msg
struct)
set_Return'results :: ((Untyped.RWCtx m s)
                      ,(Classes.ToPtr s (Payload (Message.Mut s)))) => (Return (Message.Mut s)) -> (Payload (Message.Mut s)) -> (m ())
set_Return'results :: Return ('Mut s) -> Payload ('Mut s) -> m ()
set_Return'results (Return'newtype_ Struct ('Mut s)
struct) Payload ('Mut s)
value = (do
    (Struct ('Mut s) -> Word16 -> Int -> Int -> Word64 -> m ()
forall (m :: * -> *) s a.
(RWCtx m s, Bounded a, Integral a, IsWord a, Bits a) =>
Struct ('Mut s) -> a -> Int -> Int -> Word64 -> m ()
GenHelpers.setWordField Struct ('Mut s)
struct (Word16
0 :: Std_.Word16) Int
0 Int
48 Word64
0)
    (do
        Maybe (Ptr ('Mut s))
ptr <- (Message ('Mut s) -> Payload ('Mut s) -> m (Maybe (Ptr ('Mut s)))
forall s a (m :: * -> *).
(ToPtr s a, WriteCtx m s) =>
Message ('Mut s) -> a -> m (Maybe (Ptr ('Mut s)))
Classes.toPtr (Struct ('Mut s) -> Message ('Mut s)
forall a (mut :: Mutability). HasMessage a mut => a -> Message mut
Untyped.message Struct ('Mut s)
struct) Payload ('Mut s)
value)
        (Maybe (Ptr ('Mut s)) -> Int -> Struct ('Mut s) -> m ()
forall (m :: * -> *) s.
(ReadCtx m ('Mut s), WriteCtx m s) =>
Maybe (Ptr ('Mut s)) -> Int -> Struct ('Mut s) -> m ()
Untyped.setPtr Maybe (Ptr ('Mut s))
ptr Int
0 Struct ('Mut s)
struct)
        )
    )
set_Return'exception :: ((Untyped.RWCtx m s)
                        ,(Classes.ToPtr s (Exception (Message.Mut s)))) => (Return (Message.Mut s)) -> (Exception (Message.Mut s)) -> (m ())
set_Return'exception :: Return ('Mut s) -> Exception ('Mut s) -> m ()
set_Return'exception (Return'newtype_ Struct ('Mut s)
struct) Exception ('Mut s)
value = (do
    (Struct ('Mut s) -> Word16 -> Int -> Int -> Word64 -> m ()
forall (m :: * -> *) s a.
(RWCtx m s, Bounded a, Integral a, IsWord a, Bits a) =>
Struct ('Mut s) -> a -> Int -> Int -> Word64 -> m ()
GenHelpers.setWordField Struct ('Mut s)
struct (Word16
1 :: Std_.Word16) Int
0 Int
48 Word64
0)
    (do
        Maybe (Ptr ('Mut s))
ptr <- (Message ('Mut s) -> Exception ('Mut s) -> m (Maybe (Ptr ('Mut s)))
forall s a (m :: * -> *).
(ToPtr s a, WriteCtx m s) =>
Message ('Mut s) -> a -> m (Maybe (Ptr ('Mut s)))
Classes.toPtr (Struct ('Mut s) -> Message ('Mut s)
forall a (mut :: Mutability). HasMessage a mut => a -> Message mut
Untyped.message Struct ('Mut s)
struct) Exception ('Mut s)
value)
        (Maybe (Ptr ('Mut s)) -> Int -> Struct ('Mut s) -> m ()
forall (m :: * -> *) s.
(ReadCtx m ('Mut s), WriteCtx m s) =>
Maybe (Ptr ('Mut s)) -> Int -> Struct ('Mut s) -> m ()
Untyped.setPtr Maybe (Ptr ('Mut s))
ptr Int
0 Struct ('Mut s)
struct)
        )
    )
set_Return'canceled :: ((Untyped.RWCtx m s)) => (Return (Message.Mut s)) -> (m ())
set_Return'canceled :: Return ('Mut s) -> m ()
set_Return'canceled (Return'newtype_ Struct ('Mut s)
struct) = (do
    (Struct ('Mut s) -> Word16 -> Int -> Int -> Word64 -> m ()
forall (m :: * -> *) s a.
(RWCtx m s, Bounded a, Integral a, IsWord a, Bits a) =>
Struct ('Mut s) -> a -> Int -> Int -> Word64 -> m ()
GenHelpers.setWordField Struct ('Mut s)
struct (Word16
2 :: Std_.Word16) Int
0 Int
48 Word64
0)
    (() -> m ()
forall (f :: * -> *) a. Applicative f => a -> f a
Std_.pure ())
    )
set_Return'resultsSentElsewhere :: ((Untyped.RWCtx m s)) => (Return (Message.Mut s)) -> (m ())
set_Return'resultsSentElsewhere :: Return ('Mut s) -> m ()
set_Return'resultsSentElsewhere (Return'newtype_ Struct ('Mut s)
struct) = (do
    (Struct ('Mut s) -> Word16 -> Int -> Int -> Word64 -> m ()
forall (m :: * -> *) s a.
(RWCtx m s, Bounded a, Integral a, IsWord a, Bits a) =>
Struct ('Mut s) -> a -> Int -> Int -> Word64 -> m ()
GenHelpers.setWordField Struct ('Mut s)
struct (Word16
3 :: Std_.Word16) Int
0 Int
48 Word64
0)
    (() -> m ()
forall (f :: * -> *) a. Applicative f => a -> f a
Std_.pure ())
    )
set_Return'takeFromOtherQuestion :: ((Untyped.RWCtx m s)) => (Return (Message.Mut s)) -> Std_.Word32 -> (m ())
set_Return'takeFromOtherQuestion :: Return ('Mut s) -> Word32 -> m ()
set_Return'takeFromOtherQuestion (Return'newtype_ Struct ('Mut s)
struct) Word32
value = (do
    (Struct ('Mut s) -> Word16 -> Int -> Int -> Word64 -> m ()
forall (m :: * -> *) s a.
(RWCtx m s, Bounded a, Integral a, IsWord a, Bits a) =>
Struct ('Mut s) -> a -> Int -> Int -> Word64 -> m ()
GenHelpers.setWordField Struct ('Mut s)
struct (Word16
4 :: Std_.Word16) Int
0 Int
48 Word64
0)
    (Struct ('Mut s) -> Word32 -> Int -> Int -> Word64 -> m ()
forall (m :: * -> *) s a.
(RWCtx m s, Bounded a, Integral a, IsWord a, Bits a) =>
Struct ('Mut s) -> a -> Int -> Int -> Word64 -> m ()
GenHelpers.setWordField Struct ('Mut s)
struct ((Word64 -> Word32
forall a b. (Integral a, Num b) => a -> b
Std_.fromIntegral (Word32 -> Word64
forall a. IsWord a => a -> Word64
Classes.toWord Word32
value)) :: Std_.Word32) Int
1 Int
0 Word64
0)
    )
set_Return'acceptFromThirdParty :: ((Untyped.RWCtx m s)
                                   ,(Classes.ToPtr s (Std_.Maybe (Untyped.Ptr (Message.Mut s))))) => (Return (Message.Mut s)) -> (Std_.Maybe (Untyped.Ptr (Message.Mut s))) -> (m ())
set_Return'acceptFromThirdParty :: Return ('Mut s) -> Maybe (Ptr ('Mut s)) -> m ()
set_Return'acceptFromThirdParty (Return'newtype_ Struct ('Mut s)
struct) Maybe (Ptr ('Mut s))
value = (do
    (Struct ('Mut s) -> Word16 -> Int -> Int -> Word64 -> m ()
forall (m :: * -> *) s a.
(RWCtx m s, Bounded a, Integral a, IsWord a, Bits a) =>
Struct ('Mut s) -> a -> Int -> Int -> Word64 -> m ()
GenHelpers.setWordField Struct ('Mut s)
struct (Word16
5 :: Std_.Word16) Int
0 Int
48 Word64
0)
    (do
        Maybe (Ptr ('Mut s))
ptr <- (Message ('Mut s)
-> Maybe (Ptr ('Mut s)) -> m (Maybe (Ptr ('Mut s)))
forall s a (m :: * -> *).
(ToPtr s a, WriteCtx m s) =>
Message ('Mut s) -> a -> m (Maybe (Ptr ('Mut s)))
Classes.toPtr (Struct ('Mut s) -> Message ('Mut s)
forall a (mut :: Mutability). HasMessage a mut => a -> Message mut
Untyped.message Struct ('Mut s)
struct) Maybe (Ptr ('Mut s))
value)
        (Maybe (Ptr ('Mut s)) -> Int -> Struct ('Mut s) -> m ()
forall (m :: * -> *) s.
(ReadCtx m ('Mut s), WriteCtx m s) =>
Maybe (Ptr ('Mut s)) -> Int -> Struct ('Mut s) -> m ()
Untyped.setPtr Maybe (Ptr ('Mut s))
ptr Int
0 Struct ('Mut s)
struct)
        )
    )
set_Return'unknown' :: ((Untyped.RWCtx m s)) => (Return (Message.Mut s)) -> Std_.Word16 -> (m ())
set_Return'unknown' :: Return ('Mut s) -> Word16 -> m ()
set_Return'unknown' (Return'newtype_ Struct ('Mut s)
struct) Word16
value = (Struct ('Mut s) -> Word16 -> Int -> Int -> Word64 -> m ()
forall (m :: * -> *) s a.
(RWCtx m s, Bounded a, Integral a, IsWord a, Bits a) =>
Struct ('Mut s) -> a -> Int -> Int -> Word64 -> m ()
GenHelpers.setWordField Struct ('Mut s)
struct ((Word64 -> Word16
forall a b. (Integral a, Num b) => a -> b
Std_.fromIntegral (Word16 -> Word64
forall a. IsWord a => a -> Word64
Classes.toWord Word16
value)) :: Std_.Word16) Int
0 Int
48 Word64
0)
newtype Finish msg
    = Finish'newtype_ (Untyped.Struct msg)
instance (Classes.FromStruct msg (Finish msg)) where
    fromStruct :: Struct msg -> m (Finish msg)
fromStruct Struct msg
struct = (Finish msg -> m (Finish msg)
forall (f :: * -> *) a. Applicative f => a -> f a
Std_.pure (Struct msg -> Finish msg
forall (msg :: Mutability). Struct msg -> Finish msg
Finish'newtype_ Struct msg
struct))
instance (Classes.ToStruct msg (Finish msg)) where
    toStruct :: Finish msg -> Struct msg
toStruct (Finish'newtype_ Struct msg
struct) = Struct msg
struct
instance (Untyped.HasMessage (Finish mut) mut) where
    message :: Finish mut -> Message mut
message (Finish'newtype_ Struct mut
struct) = (Struct mut -> Message mut
forall a (mut :: Mutability). HasMessage a mut => a -> Message mut
Untyped.message Struct mut
struct)
instance (Untyped.MessageDefault (Finish mut) mut) where
    messageDefault :: Message mut -> m (Finish mut)
messageDefault Message mut
msg = (Struct mut -> Finish mut
forall (msg :: Mutability). Struct msg -> Finish msg
Finish'newtype_ (Struct mut -> Finish mut) -> m (Struct mut) -> m (Finish mut)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (Message mut -> m (Struct mut)
forall a (mut :: Mutability) (m :: * -> *).
(MessageDefault a mut, ReadCtx m mut) =>
Message mut -> m a
Untyped.messageDefault Message mut
msg))
instance (Classes.FromPtr msg (Finish msg)) where
    fromPtr :: Message msg -> Maybe (Ptr msg) -> m (Finish msg)
fromPtr Message msg
msg Maybe (Ptr msg)
ptr = (Struct msg -> Finish msg
forall (msg :: Mutability). Struct msg -> Finish msg
Finish'newtype_ (Struct msg -> Finish msg) -> m (Struct msg) -> m (Finish msg)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (Message msg -> Maybe (Ptr msg) -> m (Struct msg)
forall (mut :: Mutability) a (m :: * -> *).
(FromPtr mut a, ReadCtx m mut) =>
Message mut -> Maybe (Ptr mut) -> m a
Classes.fromPtr Message msg
msg Maybe (Ptr msg)
ptr))
instance (Classes.ToPtr s (Finish (Message.Mut s))) where
    toPtr :: Message ('Mut s) -> Finish ('Mut s) -> m (Maybe (Ptr ('Mut s)))
toPtr Message ('Mut s)
msg (Finish'newtype_ Struct ('Mut s)
struct) = (Message ('Mut s) -> Struct ('Mut s) -> m (Maybe (Ptr ('Mut s)))
forall s a (m :: * -> *).
(ToPtr s a, WriteCtx m s) =>
Message ('Mut s) -> a -> m (Maybe (Ptr ('Mut s)))
Classes.toPtr Message ('Mut s)
msg Struct ('Mut s)
struct)
instance (Classes.Allocate s (Finish (Message.Mut s))) where
    new :: Message ('Mut s) -> m (Finish ('Mut s))
new Message ('Mut s)
msg = (Struct ('Mut s) -> Finish ('Mut s)
forall (msg :: Mutability). Struct msg -> Finish msg
Finish'newtype_ (Struct ('Mut s) -> Finish ('Mut s))
-> m (Struct ('Mut s)) -> m (Finish ('Mut s))
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (Message ('Mut s) -> Word16 -> Word16 -> m (Struct ('Mut s))
forall (m :: * -> *) s.
WriteCtx m s =>
Message ('Mut s) -> Word16 -> Word16 -> m (Struct ('Mut s))
Untyped.allocStruct Message ('Mut s)
msg Word16
1 Word16
0))
instance (Basics.ListElem mut (Finish mut)) where
    newtype List mut (Finish mut)
        = Finish'List_ (Untyped.ListOf mut (Untyped.Struct mut))
    listFromPtr :: Message mut -> Maybe (Ptr mut) -> m (List mut (Finish mut))
listFromPtr Message mut
msg Maybe (Ptr mut)
ptr = (ListOf mut (Struct mut) -> List mut (Finish mut)
forall (mut :: Mutability).
ListOf mut (Struct mut) -> List mut (Finish mut)
Finish'List_ (ListOf mut (Struct mut) -> List mut (Finish mut))
-> m (ListOf mut (Struct mut)) -> m (List mut (Finish mut))
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (Message mut -> Maybe (Ptr mut) -> m (ListOf mut (Struct mut))
forall (mut :: Mutability) a (m :: * -> *).
(FromPtr mut a, ReadCtx m mut) =>
Message mut -> Maybe (Ptr mut) -> m a
Classes.fromPtr Message mut
msg Maybe (Ptr mut)
ptr))
    toUntypedList :: List mut (Finish mut) -> List mut
toUntypedList (Finish'List_ l) = (ListOf mut (Struct mut) -> List mut
forall (mut :: Mutability). ListOf mut (Struct mut) -> List mut
Untyped.ListStruct ListOf mut (Struct mut)
l)
    length :: List mut (Finish mut) -> Int
length (Finish'List_ l) = (ListOf mut (Struct mut) -> Int
forall (msg :: Mutability) a. ListOf msg a -> Int
Untyped.length ListOf mut (Struct mut)
l)
    index :: Int -> List mut (Finish mut) -> m (Finish mut)
index Int
i (Finish'List_ l) = (do
        Struct mut
elt <- (Int -> ListOf mut (Struct mut) -> m (Struct mut)
forall (m :: * -> *) (mut :: Mutability) a.
ReadCtx m mut =>
Int -> ListOf mut a -> m a
Untyped.index Int
i ListOf mut (Struct mut)
l)
        (Struct mut -> m (Finish mut)
forall (mut :: Mutability) a (m :: * -> *).
(FromStruct mut a, ReadCtx m mut) =>
Struct mut -> m a
Classes.fromStruct Struct mut
elt)
        )
instance (Basics.MutListElem s (Finish (Message.Mut s))) where
    setIndex :: Finish ('Mut s) -> Int -> List ('Mut s) (Finish ('Mut s)) -> m ()
setIndex (Finish'newtype_ Struct ('Mut s)
elt) Int
i (Finish'List_ l) = (Struct ('Mut s) -> Int -> ListOf ('Mut s) (Struct ('Mut s)) -> m ()
forall (m :: * -> *) s a.
RWCtx m s =>
a -> Int -> ListOf ('Mut s) a -> m ()
Untyped.setIndex Struct ('Mut s)
elt Int
i ListOf ('Mut s) (Struct ('Mut s))
l)
    newList :: Message ('Mut s) -> Int -> m (List ('Mut s) (Finish ('Mut s)))
newList Message ('Mut s)
msg Int
len = (ListOf ('Mut s) (Struct ('Mut s))
-> List ('Mut s) (Finish ('Mut s))
forall (mut :: Mutability).
ListOf mut (Struct mut) -> List mut (Finish mut)
Finish'List_ (ListOf ('Mut s) (Struct ('Mut s))
 -> List ('Mut s) (Finish ('Mut s)))
-> m (ListOf ('Mut s) (Struct ('Mut s)))
-> m (List ('Mut s) (Finish ('Mut s)))
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (Message ('Mut s)
-> Word16 -> Word16 -> Int -> m (ListOf ('Mut s) (Struct ('Mut s)))
forall (m :: * -> *) s.
WriteCtx m s =>
Message ('Mut s)
-> Word16 -> Word16 -> Int -> m (ListOf ('Mut s) (Struct ('Mut s)))
Untyped.allocCompositeList Message ('Mut s)
msg Word16
1 Word16
0 Int
len))
get_Finish'questionId :: ((Untyped.ReadCtx m msg)) => (Finish msg) -> (m Std_.Word32)
get_Finish'questionId :: Finish msg -> m Word32
get_Finish'questionId (Finish'newtype_ Struct msg
struct) = (Struct msg -> Int -> Int -> Word64 -> m Word32
forall (m :: * -> *) (mut :: Mutability) a.
(ReadCtx m mut, IsWord a) =>
Struct mut -> Int -> Int -> Word64 -> m a
GenHelpers.getWordField Struct msg
struct Int
0 Int
0 Word64
0)
set_Finish'questionId :: ((Untyped.RWCtx m s)) => (Finish (Message.Mut s)) -> Std_.Word32 -> (m ())
set_Finish'questionId :: Finish ('Mut s) -> Word32 -> m ()
set_Finish'questionId (Finish'newtype_ Struct ('Mut s)
struct) Word32
value = (Struct ('Mut s) -> Word32 -> Int -> Int -> Word64 -> m ()
forall (m :: * -> *) s a.
(RWCtx m s, Bounded a, Integral a, IsWord a, Bits a) =>
Struct ('Mut s) -> a -> Int -> Int -> Word64 -> m ()
GenHelpers.setWordField Struct ('Mut s)
struct ((Word64 -> Word32
forall a b. (Integral a, Num b) => a -> b
Std_.fromIntegral (Word32 -> Word64
forall a. IsWord a => a -> Word64
Classes.toWord Word32
value)) :: Std_.Word32) Int
0 Int
0 Word64
0)
get_Finish'releaseResultCaps :: ((Untyped.ReadCtx m msg)) => (Finish msg) -> (m Std_.Bool)
get_Finish'releaseResultCaps :: Finish msg -> m Bool
get_Finish'releaseResultCaps (Finish'newtype_ Struct msg
struct) = (Struct msg -> Int -> Int -> Word64 -> m Bool
forall (m :: * -> *) (mut :: Mutability) a.
(ReadCtx m mut, IsWord a) =>
Struct mut -> Int -> Int -> Word64 -> m a
GenHelpers.getWordField Struct msg
struct Int
0 Int
32 Word64
1)
set_Finish'releaseResultCaps :: ((Untyped.RWCtx m s)) => (Finish (Message.Mut s)) -> Std_.Bool -> (m ())
set_Finish'releaseResultCaps :: Finish ('Mut s) -> Bool -> m ()
set_Finish'releaseResultCaps (Finish'newtype_ Struct ('Mut s)
struct) Bool
value = (Struct ('Mut s) -> Word1 -> Int -> Int -> Word64 -> m ()
forall (m :: * -> *) s a.
(RWCtx m s, Bounded a, Integral a, IsWord a, Bits a) =>
Struct ('Mut s) -> a -> Int -> Int -> Word64 -> m ()
GenHelpers.setWordField Struct ('Mut s)
struct ((Word64 -> Word1
forall a b. (Integral a, Num b) => a -> b
Std_.fromIntegral (Bool -> Word64
forall a. IsWord a => a -> Word64
Classes.toWord Bool
value)) :: Std_.Word1) Int
0 Int
32 Word64
1)
newtype Resolve msg
    = Resolve'newtype_ (Untyped.Struct msg)
instance (Classes.FromStruct msg (Resolve msg)) where
    fromStruct :: Struct msg -> m (Resolve msg)
fromStruct Struct msg
struct = (Resolve msg -> m (Resolve msg)
forall (f :: * -> *) a. Applicative f => a -> f a
Std_.pure (Struct msg -> Resolve msg
forall (msg :: Mutability). Struct msg -> Resolve msg
Resolve'newtype_ Struct msg
struct))
instance (Classes.ToStruct msg (Resolve msg)) where
    toStruct :: Resolve msg -> Struct msg
toStruct (Resolve'newtype_ Struct msg
struct) = Struct msg
struct
instance (Untyped.HasMessage (Resolve mut) mut) where
    message :: Resolve mut -> Message mut
message (Resolve'newtype_ Struct mut
struct) = (Struct mut -> Message mut
forall a (mut :: Mutability). HasMessage a mut => a -> Message mut
Untyped.message Struct mut
struct)
instance (Untyped.MessageDefault (Resolve mut) mut) where
    messageDefault :: Message mut -> m (Resolve mut)
messageDefault Message mut
msg = (Struct mut -> Resolve mut
forall (msg :: Mutability). Struct msg -> Resolve msg
Resolve'newtype_ (Struct mut -> Resolve mut) -> m (Struct mut) -> m (Resolve mut)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (Message mut -> m (Struct mut)
forall a (mut :: Mutability) (m :: * -> *).
(MessageDefault a mut, ReadCtx m mut) =>
Message mut -> m a
Untyped.messageDefault Message mut
msg))
instance (Classes.FromPtr msg (Resolve msg)) where
    fromPtr :: Message msg -> Maybe (Ptr msg) -> m (Resolve msg)
fromPtr Message msg
msg Maybe (Ptr msg)
ptr = (Struct msg -> Resolve msg
forall (msg :: Mutability). Struct msg -> Resolve msg
Resolve'newtype_ (Struct msg -> Resolve msg) -> m (Struct msg) -> m (Resolve msg)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (Message msg -> Maybe (Ptr msg) -> m (Struct msg)
forall (mut :: Mutability) a (m :: * -> *).
(FromPtr mut a, ReadCtx m mut) =>
Message mut -> Maybe (Ptr mut) -> m a
Classes.fromPtr Message msg
msg Maybe (Ptr msg)
ptr))
instance (Classes.ToPtr s (Resolve (Message.Mut s))) where
    toPtr :: Message ('Mut s) -> Resolve ('Mut s) -> m (Maybe (Ptr ('Mut s)))
toPtr Message ('Mut s)
msg (Resolve'newtype_ Struct ('Mut s)
struct) = (Message ('Mut s) -> Struct ('Mut s) -> m (Maybe (Ptr ('Mut s)))
forall s a (m :: * -> *).
(ToPtr s a, WriteCtx m s) =>
Message ('Mut s) -> a -> m (Maybe (Ptr ('Mut s)))
Classes.toPtr Message ('Mut s)
msg Struct ('Mut s)
struct)
instance (Classes.Allocate s (Resolve (Message.Mut s))) where
    new :: Message ('Mut s) -> m (Resolve ('Mut s))
new Message ('Mut s)
msg = (Struct ('Mut s) -> Resolve ('Mut s)
forall (msg :: Mutability). Struct msg -> Resolve msg
Resolve'newtype_ (Struct ('Mut s) -> Resolve ('Mut s))
-> m (Struct ('Mut s)) -> m (Resolve ('Mut s))
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (Message ('Mut s) -> Word16 -> Word16 -> m (Struct ('Mut s))
forall (m :: * -> *) s.
WriteCtx m s =>
Message ('Mut s) -> Word16 -> Word16 -> m (Struct ('Mut s))
Untyped.allocStruct Message ('Mut s)
msg Word16
1 Word16
1))
instance (Basics.ListElem mut (Resolve mut)) where
    newtype List mut (Resolve mut)
        = Resolve'List_ (Untyped.ListOf mut (Untyped.Struct mut))
    listFromPtr :: Message mut -> Maybe (Ptr mut) -> m (List mut (Resolve mut))
listFromPtr Message mut
msg Maybe (Ptr mut)
ptr = (ListOf mut (Struct mut) -> List mut (Resolve mut)
forall (mut :: Mutability).
ListOf mut (Struct mut) -> List mut (Resolve mut)
Resolve'List_ (ListOf mut (Struct mut) -> List mut (Resolve mut))
-> m (ListOf mut (Struct mut)) -> m (List mut (Resolve mut))
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (Message mut -> Maybe (Ptr mut) -> m (ListOf mut (Struct mut))
forall (mut :: Mutability) a (m :: * -> *).
(FromPtr mut a, ReadCtx m mut) =>
Message mut -> Maybe (Ptr mut) -> m a
Classes.fromPtr Message mut
msg Maybe (Ptr mut)
ptr))
    toUntypedList :: List mut (Resolve mut) -> List mut
toUntypedList (Resolve'List_ l) = (ListOf mut (Struct mut) -> List mut
forall (mut :: Mutability). ListOf mut (Struct mut) -> List mut
Untyped.ListStruct ListOf mut (Struct mut)
l)
    length :: List mut (Resolve mut) -> Int
length (Resolve'List_ l) = (ListOf mut (Struct mut) -> Int
forall (msg :: Mutability) a. ListOf msg a -> Int
Untyped.length ListOf mut (Struct mut)
l)
    index :: Int -> List mut (Resolve mut) -> m (Resolve mut)
index Int
i (Resolve'List_ l) = (do
        Struct mut
elt <- (Int -> ListOf mut (Struct mut) -> m (Struct mut)
forall (m :: * -> *) (mut :: Mutability) a.
ReadCtx m mut =>
Int -> ListOf mut a -> m a
Untyped.index Int
i ListOf mut (Struct mut)
l)
        (Struct mut -> m (Resolve mut)
forall (mut :: Mutability) a (m :: * -> *).
(FromStruct mut a, ReadCtx m mut) =>
Struct mut -> m a
Classes.fromStruct Struct mut
elt)
        )
instance (Basics.MutListElem s (Resolve (Message.Mut s))) where
    setIndex :: Resolve ('Mut s) -> Int -> List ('Mut s) (Resolve ('Mut s)) -> m ()
setIndex (Resolve'newtype_ Struct ('Mut s)
elt) Int
i (Resolve'List_ l) = (Struct ('Mut s) -> Int -> ListOf ('Mut s) (Struct ('Mut s)) -> m ()
forall (m :: * -> *) s a.
RWCtx m s =>
a -> Int -> ListOf ('Mut s) a -> m ()
Untyped.setIndex Struct ('Mut s)
elt Int
i ListOf ('Mut s) (Struct ('Mut s))
l)
    newList :: Message ('Mut s) -> Int -> m (List ('Mut s) (Resolve ('Mut s)))
newList Message ('Mut s)
msg Int
len = (ListOf ('Mut s) (Struct ('Mut s))
-> List ('Mut s) (Resolve ('Mut s))
forall (mut :: Mutability).
ListOf mut (Struct mut) -> List mut (Resolve mut)
Resolve'List_ (ListOf ('Mut s) (Struct ('Mut s))
 -> List ('Mut s) (Resolve ('Mut s)))
-> m (ListOf ('Mut s) (Struct ('Mut s)))
-> m (List ('Mut s) (Resolve ('Mut s)))
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (Message ('Mut s)
-> Word16 -> Word16 -> Int -> m (ListOf ('Mut s) (Struct ('Mut s)))
forall (m :: * -> *) s.
WriteCtx m s =>
Message ('Mut s)
-> Word16 -> Word16 -> Int -> m (ListOf ('Mut s) (Struct ('Mut s)))
Untyped.allocCompositeList Message ('Mut s)
msg Word16
1 Word16
1 Int
len))
get_Resolve'promiseId :: ((Untyped.ReadCtx m msg)) => (Resolve msg) -> (m Std_.Word32)
get_Resolve'promiseId :: Resolve msg -> m Word32
get_Resolve'promiseId (Resolve'newtype_ Struct msg
struct) = (Struct msg -> Int -> Int -> Word64 -> m Word32
forall (m :: * -> *) (mut :: Mutability) a.
(ReadCtx m mut, IsWord a) =>
Struct mut -> Int -> Int -> Word64 -> m a
GenHelpers.getWordField Struct msg
struct Int
0 Int
0 Word64
0)
set_Resolve'promiseId :: ((Untyped.RWCtx m s)) => (Resolve (Message.Mut s)) -> Std_.Word32 -> (m ())
set_Resolve'promiseId :: Resolve ('Mut s) -> Word32 -> m ()
set_Resolve'promiseId (Resolve'newtype_ Struct ('Mut s)
struct) Word32
value = (Struct ('Mut s) -> Word32 -> Int -> Int -> Word64 -> m ()
forall (m :: * -> *) s a.
(RWCtx m s, Bounded a, Integral a, IsWord a, Bits a) =>
Struct ('Mut s) -> a -> Int -> Int -> Word64 -> m ()
GenHelpers.setWordField Struct ('Mut s)
struct ((Word64 -> Word32
forall a b. (Integral a, Num b) => a -> b
Std_.fromIntegral (Word32 -> Word64
forall a. IsWord a => a -> Word64
Classes.toWord Word32
value)) :: Std_.Word32) Int
0 Int
0 Word64
0)
data Resolve' (mut :: Message.Mutability)
    = Resolve'cap (CapDescriptor mut)
    | Resolve'exception (Exception mut)
    | Resolve'unknown' Std_.Word16
instance (Classes.FromStruct mut (Resolve' mut)) where
    fromStruct :: Struct mut -> m (Resolve' mut)
fromStruct Struct mut
struct = (do
        Word16
tag <- (Struct mut -> Int -> m Word16
forall (m :: * -> *) (mut :: Mutability).
ReadCtx m mut =>
Struct mut -> Int -> m Word16
GenHelpers.getTag Struct mut
struct Int
2)
        case Word16
tag of
            Word16
0 ->
                (CapDescriptor mut -> Resolve' mut
forall (mut :: Mutability). CapDescriptor mut -> Resolve' mut
Resolve'cap (CapDescriptor mut -> Resolve' mut)
-> m (CapDescriptor mut) -> m (Resolve' mut)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (do
                    Maybe (Ptr mut)
ptr <- (Int -> Struct mut -> m (Maybe (Ptr mut))
forall (m :: * -> *) (msg :: Mutability).
ReadCtx m msg =>
Int -> Struct msg -> m (Maybe (Ptr msg))
Untyped.getPtr Int
0 Struct mut
struct)
                    (Message mut -> Maybe (Ptr mut) -> m (CapDescriptor mut)
forall (mut :: Mutability) a (m :: * -> *).
(FromPtr mut a, ReadCtx m mut) =>
Message mut -> Maybe (Ptr mut) -> m a
Classes.fromPtr (Struct mut -> Message mut
forall a (mut :: Mutability). HasMessage a mut => a -> Message mut
Untyped.message Struct mut
struct) Maybe (Ptr mut)
ptr)
                    ))
            Word16
1 ->
                (Exception mut -> Resolve' mut
forall (mut :: Mutability). Exception mut -> Resolve' mut
Resolve'exception (Exception mut -> Resolve' mut)
-> m (Exception mut) -> m (Resolve' mut)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (do
                    Maybe (Ptr mut)
ptr <- (Int -> Struct mut -> m (Maybe (Ptr mut))
forall (m :: * -> *) (msg :: Mutability).
ReadCtx m msg =>
Int -> Struct msg -> m (Maybe (Ptr msg))
Untyped.getPtr Int
0 Struct mut
struct)
                    (Message mut -> Maybe (Ptr mut) -> m (Exception mut)
forall (mut :: Mutability) a (m :: * -> *).
(FromPtr mut a, ReadCtx m mut) =>
Message mut -> Maybe (Ptr mut) -> m a
Classes.fromPtr (Struct mut -> Message mut
forall a (mut :: Mutability). HasMessage a mut => a -> Message mut
Untyped.message Struct mut
struct) Maybe (Ptr mut)
ptr)
                    ))
            Word16
_ ->
                (Resolve' mut -> m (Resolve' mut)
forall (f :: * -> *) a. Applicative f => a -> f a
Std_.pure (Word16 -> Resolve' mut
forall (mut :: Mutability). Word16 -> Resolve' mut
Resolve'unknown' (Word16 -> Word16
forall a b. (Integral a, Num b) => a -> b
Std_.fromIntegral Word16
tag)))
        )
get_Resolve' :: ((Untyped.ReadCtx m msg)
                ,(Classes.FromStruct msg (Resolve' msg))) => (Resolve msg) -> (m (Resolve' msg))
get_Resolve' :: Resolve msg -> m (Resolve' msg)
get_Resolve' (Resolve'newtype_ Struct msg
struct) = (Struct msg -> m (Resolve' msg)
forall (mut :: Mutability) a (m :: * -> *).
(FromStruct mut a, ReadCtx m mut) =>
Struct mut -> m a
Classes.fromStruct Struct msg
struct)
set_Resolve'cap :: ((Untyped.RWCtx m s)
                   ,(Classes.ToPtr s (CapDescriptor (Message.Mut s)))) => (Resolve (Message.Mut s)) -> (CapDescriptor (Message.Mut s)) -> (m ())
set_Resolve'cap :: Resolve ('Mut s) -> CapDescriptor ('Mut s) -> m ()
set_Resolve'cap (Resolve'newtype_ Struct ('Mut s)
struct) CapDescriptor ('Mut s)
value = (do
    (Struct ('Mut s) -> Word16 -> Int -> Int -> Word64 -> m ()
forall (m :: * -> *) s a.
(RWCtx m s, Bounded a, Integral a, IsWord a, Bits a) =>
Struct ('Mut s) -> a -> Int -> Int -> Word64 -> m ()
GenHelpers.setWordField Struct ('Mut s)
struct (Word16
0 :: Std_.Word16) Int
0 Int
32 Word64
0)
    (do
        Maybe (Ptr ('Mut s))
ptr <- (Message ('Mut s)
-> CapDescriptor ('Mut s) -> m (Maybe (Ptr ('Mut s)))
forall s a (m :: * -> *).
(ToPtr s a, WriteCtx m s) =>
Message ('Mut s) -> a -> m (Maybe (Ptr ('Mut s)))
Classes.toPtr (Struct ('Mut s) -> Message ('Mut s)
forall a (mut :: Mutability). HasMessage a mut => a -> Message mut
Untyped.message Struct ('Mut s)
struct) CapDescriptor ('Mut s)
value)
        (Maybe (Ptr ('Mut s)) -> Int -> Struct ('Mut s) -> m ()
forall (m :: * -> *) s.
(ReadCtx m ('Mut s), WriteCtx m s) =>
Maybe (Ptr ('Mut s)) -> Int -> Struct ('Mut s) -> m ()
Untyped.setPtr Maybe (Ptr ('Mut s))
ptr Int
0 Struct ('Mut s)
struct)
        )
    )
set_Resolve'exception :: ((Untyped.RWCtx m s)
                         ,(Classes.ToPtr s (Exception (Message.Mut s)))) => (Resolve (Message.Mut s)) -> (Exception (Message.Mut s)) -> (m ())
set_Resolve'exception :: Resolve ('Mut s) -> Exception ('Mut s) -> m ()
set_Resolve'exception (Resolve'newtype_ Struct ('Mut s)
struct) Exception ('Mut s)
value = (do
    (Struct ('Mut s) -> Word16 -> Int -> Int -> Word64 -> m ()
forall (m :: * -> *) s a.
(RWCtx m s, Bounded a, Integral a, IsWord a, Bits a) =>
Struct ('Mut s) -> a -> Int -> Int -> Word64 -> m ()
GenHelpers.setWordField Struct ('Mut s)
struct (Word16
1 :: Std_.Word16) Int
0 Int
32 Word64
0)
    (do
        Maybe (Ptr ('Mut s))
ptr <- (Message ('Mut s) -> Exception ('Mut s) -> m (Maybe (Ptr ('Mut s)))
forall s a (m :: * -> *).
(ToPtr s a, WriteCtx m s) =>
Message ('Mut s) -> a -> m (Maybe (Ptr ('Mut s)))
Classes.toPtr (Struct ('Mut s) -> Message ('Mut s)
forall a (mut :: Mutability). HasMessage a mut => a -> Message mut
Untyped.message Struct ('Mut s)
struct) Exception ('Mut s)
value)
        (Maybe (Ptr ('Mut s)) -> Int -> Struct ('Mut s) -> m ()
forall (m :: * -> *) s.
(ReadCtx m ('Mut s), WriteCtx m s) =>
Maybe (Ptr ('Mut s)) -> Int -> Struct ('Mut s) -> m ()
Untyped.setPtr Maybe (Ptr ('Mut s))
ptr Int
0 Struct ('Mut s)
struct)
        )
    )
set_Resolve'unknown' :: ((Untyped.RWCtx m s)) => (Resolve (Message.Mut s)) -> Std_.Word16 -> (m ())
set_Resolve'unknown' :: Resolve ('Mut s) -> Word16 -> m ()
set_Resolve'unknown' (Resolve'newtype_ Struct ('Mut s)
struct) Word16
value = (Struct ('Mut s) -> Word16 -> Int -> Int -> Word64 -> m ()
forall (m :: * -> *) s a.
(RWCtx m s, Bounded a, Integral a, IsWord a, Bits a) =>
Struct ('Mut s) -> a -> Int -> Int -> Word64 -> m ()
GenHelpers.setWordField Struct ('Mut s)
struct ((Word64 -> Word16
forall a b. (Integral a, Num b) => a -> b
Std_.fromIntegral (Word16 -> Word64
forall a. IsWord a => a -> Word64
Classes.toWord Word16
value)) :: Std_.Word16) Int
0 Int
32 Word64
0)
newtype Release msg
    = Release'newtype_ (Untyped.Struct msg)
instance (Classes.FromStruct msg (Release msg)) where
    fromStruct :: Struct msg -> m (Release msg)
fromStruct Struct msg
struct = (Release msg -> m (Release msg)
forall (f :: * -> *) a. Applicative f => a -> f a
Std_.pure (Struct msg -> Release msg
forall (msg :: Mutability). Struct msg -> Release msg
Release'newtype_ Struct msg
struct))
instance (Classes.ToStruct msg (Release msg)) where
    toStruct :: Release msg -> Struct msg
toStruct (Release'newtype_ Struct msg
struct) = Struct msg
struct
instance (Untyped.HasMessage (Release mut) mut) where
    message :: Release mut -> Message mut
message (Release'newtype_ Struct mut
struct) = (Struct mut -> Message mut
forall a (mut :: Mutability). HasMessage a mut => a -> Message mut
Untyped.message Struct mut
struct)
instance (Untyped.MessageDefault (Release mut) mut) where
    messageDefault :: Message mut -> m (Release mut)
messageDefault Message mut
msg = (Struct mut -> Release mut
forall (msg :: Mutability). Struct msg -> Release msg
Release'newtype_ (Struct mut -> Release mut) -> m (Struct mut) -> m (Release mut)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (Message mut -> m (Struct mut)
forall a (mut :: Mutability) (m :: * -> *).
(MessageDefault a mut, ReadCtx m mut) =>
Message mut -> m a
Untyped.messageDefault Message mut
msg))
instance (Classes.FromPtr msg (Release msg)) where
    fromPtr :: Message msg -> Maybe (Ptr msg) -> m (Release msg)
fromPtr Message msg
msg Maybe (Ptr msg)
ptr = (Struct msg -> Release msg
forall (msg :: Mutability). Struct msg -> Release msg
Release'newtype_ (Struct msg -> Release msg) -> m (Struct msg) -> m (Release msg)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (Message msg -> Maybe (Ptr msg) -> m (Struct msg)
forall (mut :: Mutability) a (m :: * -> *).
(FromPtr mut a, ReadCtx m mut) =>
Message mut -> Maybe (Ptr mut) -> m a
Classes.fromPtr Message msg
msg Maybe (Ptr msg)
ptr))
instance (Classes.ToPtr s (Release (Message.Mut s))) where
    toPtr :: Message ('Mut s) -> Release ('Mut s) -> m (Maybe (Ptr ('Mut s)))
toPtr Message ('Mut s)
msg (Release'newtype_ Struct ('Mut s)
struct) = (Message ('Mut s) -> Struct ('Mut s) -> m (Maybe (Ptr ('Mut s)))
forall s a (m :: * -> *).
(ToPtr s a, WriteCtx m s) =>
Message ('Mut s) -> a -> m (Maybe (Ptr ('Mut s)))
Classes.toPtr Message ('Mut s)
msg Struct ('Mut s)
struct)
instance (Classes.Allocate s (Release (Message.Mut s))) where
    new :: Message ('Mut s) -> m (Release ('Mut s))
new Message ('Mut s)
msg = (Struct ('Mut s) -> Release ('Mut s)
forall (msg :: Mutability). Struct msg -> Release msg
Release'newtype_ (Struct ('Mut s) -> Release ('Mut s))
-> m (Struct ('Mut s)) -> m (Release ('Mut s))
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (Message ('Mut s) -> Word16 -> Word16 -> m (Struct ('Mut s))
forall (m :: * -> *) s.
WriteCtx m s =>
Message ('Mut s) -> Word16 -> Word16 -> m (Struct ('Mut s))
Untyped.allocStruct Message ('Mut s)
msg Word16
1 Word16
0))
instance (Basics.ListElem mut (Release mut)) where
    newtype List mut (Release mut)
        = Release'List_ (Untyped.ListOf mut (Untyped.Struct mut))
    listFromPtr :: Message mut -> Maybe (Ptr mut) -> m (List mut (Release mut))
listFromPtr Message mut
msg Maybe (Ptr mut)
ptr = (ListOf mut (Struct mut) -> List mut (Release mut)
forall (mut :: Mutability).
ListOf mut (Struct mut) -> List mut (Release mut)
Release'List_ (ListOf mut (Struct mut) -> List mut (Release mut))
-> m (ListOf mut (Struct mut)) -> m (List mut (Release mut))
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (Message mut -> Maybe (Ptr mut) -> m (ListOf mut (Struct mut))
forall (mut :: Mutability) a (m :: * -> *).
(FromPtr mut a, ReadCtx m mut) =>
Message mut -> Maybe (Ptr mut) -> m a
Classes.fromPtr Message mut
msg Maybe (Ptr mut)
ptr))
    toUntypedList :: List mut (Release mut) -> List mut
toUntypedList (Release'List_ l) = (ListOf mut (Struct mut) -> List mut
forall (mut :: Mutability). ListOf mut (Struct mut) -> List mut
Untyped.ListStruct ListOf mut (Struct mut)
l)
    length :: List mut (Release mut) -> Int
length (Release'List_ l) = (ListOf mut (Struct mut) -> Int
forall (msg :: Mutability) a. ListOf msg a -> Int
Untyped.length ListOf mut (Struct mut)
l)
    index :: Int -> List mut (Release mut) -> m (Release mut)
index Int
i (Release'List_ l) = (do
        Struct mut
elt <- (Int -> ListOf mut (Struct mut) -> m (Struct mut)
forall (m :: * -> *) (mut :: Mutability) a.
ReadCtx m mut =>
Int -> ListOf mut a -> m a
Untyped.index Int
i ListOf mut (Struct mut)
l)
        (Struct mut -> m (Release mut)
forall (mut :: Mutability) a (m :: * -> *).
(FromStruct mut a, ReadCtx m mut) =>
Struct mut -> m a
Classes.fromStruct Struct mut
elt)
        )
instance (Basics.MutListElem s (Release (Message.Mut s))) where
    setIndex :: Release ('Mut s) -> Int -> List ('Mut s) (Release ('Mut s)) -> m ()
setIndex (Release'newtype_ Struct ('Mut s)
elt) Int
i (Release'List_ l) = (Struct ('Mut s) -> Int -> ListOf ('Mut s) (Struct ('Mut s)) -> m ()
forall (m :: * -> *) s a.
RWCtx m s =>
a -> Int -> ListOf ('Mut s) a -> m ()
Untyped.setIndex Struct ('Mut s)
elt Int
i ListOf ('Mut s) (Struct ('Mut s))
l)
    newList :: Message ('Mut s) -> Int -> m (List ('Mut s) (Release ('Mut s)))
newList Message ('Mut s)
msg Int
len = (ListOf ('Mut s) (Struct ('Mut s))
-> List ('Mut s) (Release ('Mut s))
forall (mut :: Mutability).
ListOf mut (Struct mut) -> List mut (Release mut)
Release'List_ (ListOf ('Mut s) (Struct ('Mut s))
 -> List ('Mut s) (Release ('Mut s)))
-> m (ListOf ('Mut s) (Struct ('Mut s)))
-> m (List ('Mut s) (Release ('Mut s)))
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (Message ('Mut s)
-> Word16 -> Word16 -> Int -> m (ListOf ('Mut s) (Struct ('Mut s)))
forall (m :: * -> *) s.
WriteCtx m s =>
Message ('Mut s)
-> Word16 -> Word16 -> Int -> m (ListOf ('Mut s) (Struct ('Mut s)))
Untyped.allocCompositeList Message ('Mut s)
msg Word16
1 Word16
0 Int
len))
get_Release'id :: ((Untyped.ReadCtx m msg)) => (Release msg) -> (m Std_.Word32)
get_Release'id :: Release msg -> m Word32
get_Release'id (Release'newtype_ Struct msg
struct) = (Struct msg -> Int -> Int -> Word64 -> m Word32
forall (m :: * -> *) (mut :: Mutability) a.
(ReadCtx m mut, IsWord a) =>
Struct mut -> Int -> Int -> Word64 -> m a
GenHelpers.getWordField Struct msg
struct Int
0 Int
0 Word64
0)
set_Release'id :: ((Untyped.RWCtx m s)) => (Release (Message.Mut s)) -> Std_.Word32 -> (m ())
set_Release'id :: Release ('Mut s) -> Word32 -> m ()
set_Release'id (Release'newtype_ Struct ('Mut s)
struct) Word32
value = (Struct ('Mut s) -> Word32 -> Int -> Int -> Word64 -> m ()
forall (m :: * -> *) s a.
(RWCtx m s, Bounded a, Integral a, IsWord a, Bits a) =>
Struct ('Mut s) -> a -> Int -> Int -> Word64 -> m ()
GenHelpers.setWordField Struct ('Mut s)
struct ((Word64 -> Word32
forall a b. (Integral a, Num b) => a -> b
Std_.fromIntegral (Word32 -> Word64
forall a. IsWord a => a -> Word64
Classes.toWord Word32
value)) :: Std_.Word32) Int
0 Int
0 Word64
0)
get_Release'referenceCount :: ((Untyped.ReadCtx m msg)) => (Release msg) -> (m Std_.Word32)
get_Release'referenceCount :: Release msg -> m Word32
get_Release'referenceCount (Release'newtype_ Struct msg
struct) = (Struct msg -> Int -> Int -> Word64 -> m Word32
forall (m :: * -> *) (mut :: Mutability) a.
(ReadCtx m mut, IsWord a) =>
Struct mut -> Int -> Int -> Word64 -> m a
GenHelpers.getWordField Struct msg
struct Int
0 Int
32 Word64
0)
set_Release'referenceCount :: ((Untyped.RWCtx m s)) => (Release (Message.Mut s)) -> Std_.Word32 -> (m ())
set_Release'referenceCount :: Release ('Mut s) -> Word32 -> m ()
set_Release'referenceCount (Release'newtype_ Struct ('Mut s)
struct) Word32
value = (Struct ('Mut s) -> Word32 -> Int -> Int -> Word64 -> m ()
forall (m :: * -> *) s a.
(RWCtx m s, Bounded a, Integral a, IsWord a, Bits a) =>
Struct ('Mut s) -> a -> Int -> Int -> Word64 -> m ()
GenHelpers.setWordField Struct ('Mut s)
struct ((Word64 -> Word32
forall a b. (Integral a, Num b) => a -> b
Std_.fromIntegral (Word32 -> Word64
forall a. IsWord a => a -> Word64
Classes.toWord Word32
value)) :: Std_.Word32) Int
0 Int
32 Word64
0)
newtype Disembargo msg
    = Disembargo'newtype_ (Untyped.Struct msg)
instance (Classes.FromStruct msg (Disembargo msg)) where
    fromStruct :: Struct msg -> m (Disembargo msg)
fromStruct Struct msg
struct = (Disembargo msg -> m (Disembargo msg)
forall (f :: * -> *) a. Applicative f => a -> f a
Std_.pure (Struct msg -> Disembargo msg
forall (msg :: Mutability). Struct msg -> Disembargo msg
Disembargo'newtype_ Struct msg
struct))
instance (Classes.ToStruct msg (Disembargo msg)) where
    toStruct :: Disembargo msg -> Struct msg
toStruct (Disembargo'newtype_ Struct msg
struct) = Struct msg
struct
instance (Untyped.HasMessage (Disembargo mut) mut) where
    message :: Disembargo mut -> Message mut
message (Disembargo'newtype_ Struct mut
struct) = (Struct mut -> Message mut
forall a (mut :: Mutability). HasMessage a mut => a -> Message mut
Untyped.message Struct mut
struct)
instance (Untyped.MessageDefault (Disembargo mut) mut) where
    messageDefault :: Message mut -> m (Disembargo mut)
messageDefault Message mut
msg = (Struct mut -> Disembargo mut
forall (msg :: Mutability). Struct msg -> Disembargo msg
Disembargo'newtype_ (Struct mut -> Disembargo mut)
-> m (Struct mut) -> m (Disembargo mut)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (Message mut -> m (Struct mut)
forall a (mut :: Mutability) (m :: * -> *).
(MessageDefault a mut, ReadCtx m mut) =>
Message mut -> m a
Untyped.messageDefault Message mut
msg))
instance (Classes.FromPtr msg (Disembargo msg)) where
    fromPtr :: Message msg -> Maybe (Ptr msg) -> m (Disembargo msg)
fromPtr Message msg
msg Maybe (Ptr msg)
ptr = (Struct msg -> Disembargo msg
forall (msg :: Mutability). Struct msg -> Disembargo msg
Disembargo'newtype_ (Struct msg -> Disembargo msg)
-> m (Struct msg) -> m (Disembargo msg)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (Message msg -> Maybe (Ptr msg) -> m (Struct msg)
forall (mut :: Mutability) a (m :: * -> *).
(FromPtr mut a, ReadCtx m mut) =>
Message mut -> Maybe (Ptr mut) -> m a
Classes.fromPtr Message msg
msg Maybe (Ptr msg)
ptr))
instance (Classes.ToPtr s (Disembargo (Message.Mut s))) where
    toPtr :: Message ('Mut s) -> Disembargo ('Mut s) -> m (Maybe (Ptr ('Mut s)))
toPtr Message ('Mut s)
msg (Disembargo'newtype_ Struct ('Mut s)
struct) = (Message ('Mut s) -> Struct ('Mut s) -> m (Maybe (Ptr ('Mut s)))
forall s a (m :: * -> *).
(ToPtr s a, WriteCtx m s) =>
Message ('Mut s) -> a -> m (Maybe (Ptr ('Mut s)))
Classes.toPtr Message ('Mut s)
msg Struct ('Mut s)
struct)
instance (Classes.Allocate s (Disembargo (Message.Mut s))) where
    new :: Message ('Mut s) -> m (Disembargo ('Mut s))
new Message ('Mut s)
msg = (Struct ('Mut s) -> Disembargo ('Mut s)
forall (msg :: Mutability). Struct msg -> Disembargo msg
Disembargo'newtype_ (Struct ('Mut s) -> Disembargo ('Mut s))
-> m (Struct ('Mut s)) -> m (Disembargo ('Mut s))
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (Message ('Mut s) -> Word16 -> Word16 -> m (Struct ('Mut s))
forall (m :: * -> *) s.
WriteCtx m s =>
Message ('Mut s) -> Word16 -> Word16 -> m (Struct ('Mut s))
Untyped.allocStruct Message ('Mut s)
msg Word16
1 Word16
1))
instance (Basics.ListElem mut (Disembargo mut)) where
    newtype List mut (Disembargo mut)
        = Disembargo'List_ (Untyped.ListOf mut (Untyped.Struct mut))
    listFromPtr :: Message mut -> Maybe (Ptr mut) -> m (List mut (Disembargo mut))
listFromPtr Message mut
msg Maybe (Ptr mut)
ptr = (ListOf mut (Struct mut) -> List mut (Disembargo mut)
forall (mut :: Mutability).
ListOf mut (Struct mut) -> List mut (Disembargo mut)
Disembargo'List_ (ListOf mut (Struct mut) -> List mut (Disembargo mut))
-> m (ListOf mut (Struct mut)) -> m (List mut (Disembargo mut))
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (Message mut -> Maybe (Ptr mut) -> m (ListOf mut (Struct mut))
forall (mut :: Mutability) a (m :: * -> *).
(FromPtr mut a, ReadCtx m mut) =>
Message mut -> Maybe (Ptr mut) -> m a
Classes.fromPtr Message mut
msg Maybe (Ptr mut)
ptr))
    toUntypedList :: List mut (Disembargo mut) -> List mut
toUntypedList (Disembargo'List_ l) = (ListOf mut (Struct mut) -> List mut
forall (mut :: Mutability). ListOf mut (Struct mut) -> List mut
Untyped.ListStruct ListOf mut (Struct mut)
l)
    length :: List mut (Disembargo mut) -> Int
length (Disembargo'List_ l) = (ListOf mut (Struct mut) -> Int
forall (msg :: Mutability) a. ListOf msg a -> Int
Untyped.length ListOf mut (Struct mut)
l)
    index :: Int -> List mut (Disembargo mut) -> m (Disembargo mut)
index Int
i (Disembargo'List_ l) = (do
        Struct mut
elt <- (Int -> ListOf mut (Struct mut) -> m (Struct mut)
forall (m :: * -> *) (mut :: Mutability) a.
ReadCtx m mut =>
Int -> ListOf mut a -> m a
Untyped.index Int
i ListOf mut (Struct mut)
l)
        (Struct mut -> m (Disembargo mut)
forall (mut :: Mutability) a (m :: * -> *).
(FromStruct mut a, ReadCtx m mut) =>
Struct mut -> m a
Classes.fromStruct Struct mut
elt)
        )
instance (Basics.MutListElem s (Disembargo (Message.Mut s))) where
    setIndex :: Disembargo ('Mut s)
-> Int -> List ('Mut s) (Disembargo ('Mut s)) -> m ()
setIndex (Disembargo'newtype_ Struct ('Mut s)
elt) Int
i (Disembargo'List_ l) = (Struct ('Mut s) -> Int -> ListOf ('Mut s) (Struct ('Mut s)) -> m ()
forall (m :: * -> *) s a.
RWCtx m s =>
a -> Int -> ListOf ('Mut s) a -> m ()
Untyped.setIndex Struct ('Mut s)
elt Int
i ListOf ('Mut s) (Struct ('Mut s))
l)
    newList :: Message ('Mut s) -> Int -> m (List ('Mut s) (Disembargo ('Mut s)))
newList Message ('Mut s)
msg Int
len = (ListOf ('Mut s) (Struct ('Mut s))
-> List ('Mut s) (Disembargo ('Mut s))
forall (mut :: Mutability).
ListOf mut (Struct mut) -> List mut (Disembargo mut)
Disembargo'List_ (ListOf ('Mut s) (Struct ('Mut s))
 -> List ('Mut s) (Disembargo ('Mut s)))
-> m (ListOf ('Mut s) (Struct ('Mut s)))
-> m (List ('Mut s) (Disembargo ('Mut s)))
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (Message ('Mut s)
-> Word16 -> Word16 -> Int -> m (ListOf ('Mut s) (Struct ('Mut s)))
forall (m :: * -> *) s.
WriteCtx m s =>
Message ('Mut s)
-> Word16 -> Word16 -> Int -> m (ListOf ('Mut s) (Struct ('Mut s)))
Untyped.allocCompositeList Message ('Mut s)
msg Word16
1 Word16
1 Int
len))
get_Disembargo'target :: ((Untyped.ReadCtx m msg)
                         ,(Classes.FromPtr msg (MessageTarget msg))) => (Disembargo msg) -> (m (MessageTarget msg))
get_Disembargo'target :: Disembargo msg -> m (MessageTarget msg)
get_Disembargo'target (Disembargo'newtype_ Struct msg
struct) = (do
    Maybe (Ptr msg)
ptr <- (Int -> Struct msg -> m (Maybe (Ptr msg))
forall (m :: * -> *) (msg :: Mutability).
ReadCtx m msg =>
Int -> Struct msg -> m (Maybe (Ptr msg))
Untyped.getPtr Int
0 Struct msg
struct)
    (Message msg -> Maybe (Ptr msg) -> m (MessageTarget msg)
forall (mut :: Mutability) a (m :: * -> *).
(FromPtr mut a, ReadCtx m mut) =>
Message mut -> Maybe (Ptr mut) -> m a
Classes.fromPtr (Struct msg -> Message msg
forall a (mut :: Mutability). HasMessage a mut => a -> Message mut
Untyped.message Struct msg
struct) Maybe (Ptr msg)
ptr)
    )
set_Disembargo'target :: ((Untyped.RWCtx m s)
                         ,(Classes.ToPtr s (MessageTarget (Message.Mut s)))) => (Disembargo (Message.Mut s)) -> (MessageTarget (Message.Mut s)) -> (m ())
set_Disembargo'target :: Disembargo ('Mut s) -> MessageTarget ('Mut s) -> m ()
set_Disembargo'target (Disembargo'newtype_ Struct ('Mut s)
struct) MessageTarget ('Mut s)
value = (do
    Maybe (Ptr ('Mut s))
ptr <- (Message ('Mut s)
-> MessageTarget ('Mut s) -> m (Maybe (Ptr ('Mut s)))
forall s a (m :: * -> *).
(ToPtr s a, WriteCtx m s) =>
Message ('Mut s) -> a -> m (Maybe (Ptr ('Mut s)))
Classes.toPtr (Struct ('Mut s) -> Message ('Mut s)
forall a (mut :: Mutability). HasMessage a mut => a -> Message mut
Untyped.message Struct ('Mut s)
struct) MessageTarget ('Mut s)
value)
    (Maybe (Ptr ('Mut s)) -> Int -> Struct ('Mut s) -> m ()
forall (m :: * -> *) s.
(ReadCtx m ('Mut s), WriteCtx m s) =>
Maybe (Ptr ('Mut s)) -> Int -> Struct ('Mut s) -> m ()
Untyped.setPtr Maybe (Ptr ('Mut s))
ptr Int
0 Struct ('Mut s)
struct)
    )
has_Disembargo'target :: ((Untyped.ReadCtx m msg)) => (Disembargo msg) -> (m Std_.Bool)
has_Disembargo'target :: Disembargo msg -> m Bool
has_Disembargo'target (Disembargo'newtype_ Struct msg
struct) = (Maybe (Ptr msg) -> Bool
forall a. Maybe a -> Bool
Std_.isJust (Maybe (Ptr msg) -> Bool) -> m (Maybe (Ptr msg)) -> m Bool
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (Int -> Struct msg -> m (Maybe (Ptr msg))
forall (m :: * -> *) (msg :: Mutability).
ReadCtx m msg =>
Int -> Struct msg -> m (Maybe (Ptr msg))
Untyped.getPtr Int
0 Struct msg
struct))
new_Disembargo'target :: ((Untyped.RWCtx m s)) => (Disembargo (Message.Mut s)) -> (m (MessageTarget (Message.Mut s)))
new_Disembargo'target :: Disembargo ('Mut s) -> m (MessageTarget ('Mut s))
new_Disembargo'target Disembargo ('Mut s)
struct = (do
    MessageTarget ('Mut s)
result <- (Message ('Mut s) -> m (MessageTarget ('Mut s))
forall s e (m :: * -> *).
(Allocate s e, WriteCtx m s) =>
Message ('Mut s) -> m e
Classes.new (Disembargo ('Mut s) -> Message ('Mut s)
forall a (mut :: Mutability). HasMessage a mut => a -> Message mut
Untyped.message Disembargo ('Mut s)
struct))
    (Disembargo ('Mut s) -> MessageTarget ('Mut s) -> m ()
forall (m :: * -> *) s.
(RWCtx m s, ToPtr s (MessageTarget ('Mut s))) =>
Disembargo ('Mut s) -> MessageTarget ('Mut s) -> m ()
set_Disembargo'target Disembargo ('Mut s)
struct MessageTarget ('Mut s)
result)
    (MessageTarget ('Mut s) -> m (MessageTarget ('Mut s))
forall (f :: * -> *) a. Applicative f => a -> f a
Std_.pure MessageTarget ('Mut s)
result)
    )
get_Disembargo'context :: ((Untyped.ReadCtx m msg)
                          ,(Classes.FromStruct msg (Disembargo'context msg))) => (Disembargo msg) -> (m (Disembargo'context msg))
get_Disembargo'context :: Disembargo msg -> m (Disembargo'context msg)
get_Disembargo'context (Disembargo'newtype_ Struct msg
struct) = (Struct msg -> m (Disembargo'context msg)
forall (mut :: Mutability) a (m :: * -> *).
(FromStruct mut a, ReadCtx m mut) =>
Struct mut -> m a
Classes.fromStruct Struct msg
struct)
newtype Disembargo'context msg
    = Disembargo'context'newtype_ (Untyped.Struct msg)
instance (Classes.FromStruct msg (Disembargo'context msg)) where
    fromStruct :: Struct msg -> m (Disembargo'context msg)
fromStruct Struct msg
struct = (Disembargo'context msg -> m (Disembargo'context msg)
forall (f :: * -> *) a. Applicative f => a -> f a
Std_.pure (Struct msg -> Disembargo'context msg
forall (msg :: Mutability). Struct msg -> Disembargo'context msg
Disembargo'context'newtype_ Struct msg
struct))
instance (Classes.ToStruct msg (Disembargo'context msg)) where
    toStruct :: Disembargo'context msg -> Struct msg
toStruct (Disembargo'context'newtype_ Struct msg
struct) = Struct msg
struct
instance (Untyped.HasMessage (Disembargo'context mut) mut) where
    message :: Disembargo'context mut -> Message mut
message (Disembargo'context'newtype_ Struct mut
struct) = (Struct mut -> Message mut
forall a (mut :: Mutability). HasMessage a mut => a -> Message mut
Untyped.message Struct mut
struct)
instance (Untyped.MessageDefault (Disembargo'context mut) mut) where
    messageDefault :: Message mut -> m (Disembargo'context mut)
messageDefault Message mut
msg = (Struct mut -> Disembargo'context mut
forall (msg :: Mutability). Struct msg -> Disembargo'context msg
Disembargo'context'newtype_ (Struct mut -> Disembargo'context mut)
-> m (Struct mut) -> m (Disembargo'context mut)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (Message mut -> m (Struct mut)
forall a (mut :: Mutability) (m :: * -> *).
(MessageDefault a mut, ReadCtx m mut) =>
Message mut -> m a
Untyped.messageDefault Message mut
msg))
data Disembargo'context' (mut :: Message.Mutability)
    = Disembargo'context'senderLoopback Std_.Word32
    | Disembargo'context'receiverLoopback Std_.Word32
    | Disembargo'context'accept 
    | Disembargo'context'provide Std_.Word32
    | Disembargo'context'unknown' Std_.Word16
instance (Classes.FromStruct mut (Disembargo'context' mut)) where
    fromStruct :: Struct mut -> m (Disembargo'context' mut)
fromStruct Struct mut
struct = (do
        Word16
tag <- (Struct mut -> Int -> m Word16
forall (m :: * -> *) (mut :: Mutability).
ReadCtx m mut =>
Struct mut -> Int -> m Word16
GenHelpers.getTag Struct mut
struct Int
2)
        case Word16
tag of
            Word16
0 ->
                (Word32 -> Disembargo'context' mut
forall (mut :: Mutability). Word32 -> Disembargo'context' mut
Disembargo'context'senderLoopback (Word32 -> Disembargo'context' mut)
-> m Word32 -> m (Disembargo'context' mut)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (Struct mut -> Int -> Int -> Word64 -> m Word32
forall (m :: * -> *) (mut :: Mutability) a.
(ReadCtx m mut, IsWord a) =>
Struct mut -> Int -> Int -> Word64 -> m a
GenHelpers.getWordField Struct mut
struct Int
0 Int
0 Word64
0))
            Word16
1 ->
                (Word32 -> Disembargo'context' mut
forall (mut :: Mutability). Word32 -> Disembargo'context' mut
Disembargo'context'receiverLoopback (Word32 -> Disembargo'context' mut)
-> m Word32 -> m (Disembargo'context' mut)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (Struct mut -> Int -> Int -> Word64 -> m Word32
forall (m :: * -> *) (mut :: Mutability) a.
(ReadCtx m mut, IsWord a) =>
Struct mut -> Int -> Int -> Word64 -> m a
GenHelpers.getWordField Struct mut
struct Int
0 Int
0 Word64
0))
            Word16
2 ->
                (Disembargo'context' mut -> m (Disembargo'context' mut)
forall (f :: * -> *) a. Applicative f => a -> f a
Std_.pure Disembargo'context' mut
forall (mut :: Mutability). Disembargo'context' mut
Disembargo'context'accept)
            Word16
3 ->
                (Word32 -> Disembargo'context' mut
forall (mut :: Mutability). Word32 -> Disembargo'context' mut
Disembargo'context'provide (Word32 -> Disembargo'context' mut)
-> m Word32 -> m (Disembargo'context' mut)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (Struct mut -> Int -> Int -> Word64 -> m Word32
forall (m :: * -> *) (mut :: Mutability) a.
(ReadCtx m mut, IsWord a) =>
Struct mut -> Int -> Int -> Word64 -> m a
GenHelpers.getWordField Struct mut
struct Int
0 Int
0 Word64
0))
            Word16
_ ->
                (Disembargo'context' mut -> m (Disembargo'context' mut)
forall (f :: * -> *) a. Applicative f => a -> f a
Std_.pure (Word16 -> Disembargo'context' mut
forall (mut :: Mutability). Word16 -> Disembargo'context' mut
Disembargo'context'unknown' (Word16 -> Word16
forall a b. (Integral a, Num b) => a -> b
Std_.fromIntegral Word16
tag)))
        )
get_Disembargo'context' :: ((Untyped.ReadCtx m msg)
                           ,(Classes.FromStruct msg (Disembargo'context' msg))) => (Disembargo'context msg) -> (m (Disembargo'context' msg))
get_Disembargo'context' :: Disembargo'context msg -> m (Disembargo'context' msg)
get_Disembargo'context' (Disembargo'context'newtype_ Struct msg
struct) = (Struct msg -> m (Disembargo'context' msg)
forall (mut :: Mutability) a (m :: * -> *).
(FromStruct mut a, ReadCtx m mut) =>
Struct mut -> m a
Classes.fromStruct Struct msg
struct)
set_Disembargo'context'senderLoopback :: ((Untyped.RWCtx m s)) => (Disembargo'context (Message.Mut s)) -> Std_.Word32 -> (m ())
set_Disembargo'context'senderLoopback :: Disembargo'context ('Mut s) -> Word32 -> m ()
set_Disembargo'context'senderLoopback (Disembargo'context'newtype_ Struct ('Mut s)
struct) Word32
value = (do
    (Struct ('Mut s) -> Word16 -> Int -> Int -> Word64 -> m ()
forall (m :: * -> *) s a.
(RWCtx m s, Bounded a, Integral a, IsWord a, Bits a) =>
Struct ('Mut s) -> a -> Int -> Int -> Word64 -> m ()
GenHelpers.setWordField Struct ('Mut s)
struct (Word16
0 :: Std_.Word16) Int
0 Int
32 Word64
0)
    (Struct ('Mut s) -> Word32 -> Int -> Int -> Word64 -> m ()
forall (m :: * -> *) s a.
(RWCtx m s, Bounded a, Integral a, IsWord a, Bits a) =>
Struct ('Mut s) -> a -> Int -> Int -> Word64 -> m ()
GenHelpers.setWordField Struct ('Mut s)
struct ((Word64 -> Word32
forall a b. (Integral a, Num b) => a -> b
Std_.fromIntegral (Word32 -> Word64
forall a. IsWord a => a -> Word64
Classes.toWord Word32
value)) :: Std_.Word32) Int
0 Int
0 Word64
0)
    )
set_Disembargo'context'receiverLoopback :: ((Untyped.RWCtx m s)) => (Disembargo'context (Message.Mut s)) -> Std_.Word32 -> (m ())
set_Disembargo'context'receiverLoopback :: Disembargo'context ('Mut s) -> Word32 -> m ()
set_Disembargo'context'receiverLoopback (Disembargo'context'newtype_ Struct ('Mut s)
struct) Word32
value = (do
    (Struct ('Mut s) -> Word16 -> Int -> Int -> Word64 -> m ()
forall (m :: * -> *) s a.
(RWCtx m s, Bounded a, Integral a, IsWord a, Bits a) =>
Struct ('Mut s) -> a -> Int -> Int -> Word64 -> m ()
GenHelpers.setWordField Struct ('Mut s)
struct (Word16
1 :: Std_.Word16) Int
0 Int
32 Word64
0)
    (Struct ('Mut s) -> Word32 -> Int -> Int -> Word64 -> m ()
forall (m :: * -> *) s a.
(RWCtx m s, Bounded a, Integral a, IsWord a, Bits a) =>
Struct ('Mut s) -> a -> Int -> Int -> Word64 -> m ()
GenHelpers.setWordField Struct ('Mut s)
struct ((Word64 -> Word32
forall a b. (Integral a, Num b) => a -> b
Std_.fromIntegral (Word32 -> Word64
forall a. IsWord a => a -> Word64
Classes.toWord Word32
value)) :: Std_.Word32) Int
0 Int
0 Word64
0)
    )
set_Disembargo'context'accept :: ((Untyped.RWCtx m s)) => (Disembargo'context (Message.Mut s)) -> (m ())
set_Disembargo'context'accept :: Disembargo'context ('Mut s) -> m ()
set_Disembargo'context'accept (Disembargo'context'newtype_ Struct ('Mut s)
struct) = (do
    (Struct ('Mut s) -> Word16 -> Int -> Int -> Word64 -> m ()
forall (m :: * -> *) s a.
(RWCtx m s, Bounded a, Integral a, IsWord a, Bits a) =>
Struct ('Mut s) -> a -> Int -> Int -> Word64 -> m ()
GenHelpers.setWordField Struct ('Mut s)
struct (Word16
2 :: Std_.Word16) Int
0 Int
32 Word64
0)
    (() -> m ()
forall (f :: * -> *) a. Applicative f => a -> f a
Std_.pure ())
    )
set_Disembargo'context'provide :: ((Untyped.RWCtx m s)) => (Disembargo'context (Message.Mut s)) -> Std_.Word32 -> (m ())
set_Disembargo'context'provide :: Disembargo'context ('Mut s) -> Word32 -> m ()
set_Disembargo'context'provide (Disembargo'context'newtype_ Struct ('Mut s)
struct) Word32
value = (do
    (Struct ('Mut s) -> Word16 -> Int -> Int -> Word64 -> m ()
forall (m :: * -> *) s a.
(RWCtx m s, Bounded a, Integral a, IsWord a, Bits a) =>
Struct ('Mut s) -> a -> Int -> Int -> Word64 -> m ()
GenHelpers.setWordField Struct ('Mut s)
struct (Word16
3 :: Std_.Word16) Int
0 Int
32 Word64
0)
    (Struct ('Mut s) -> Word32 -> Int -> Int -> Word64 -> m ()
forall (m :: * -> *) s a.
(RWCtx m s, Bounded a, Integral a, IsWord a, Bits a) =>
Struct ('Mut s) -> a -> Int -> Int -> Word64 -> m ()
GenHelpers.setWordField Struct ('Mut s)
struct ((Word64 -> Word32
forall a b. (Integral a, Num b) => a -> b
Std_.fromIntegral (Word32 -> Word64
forall a. IsWord a => a -> Word64
Classes.toWord Word32
value)) :: Std_.Word32) Int
0 Int
0 Word64
0)
    )
set_Disembargo'context'unknown' :: ((Untyped.RWCtx m s)) => (Disembargo'context (Message.Mut s)) -> Std_.Word16 -> (m ())
set_Disembargo'context'unknown' :: Disembargo'context ('Mut s) -> Word16 -> m ()
set_Disembargo'context'unknown' (Disembargo'context'newtype_ Struct ('Mut s)
struct) Word16
value = (Struct ('Mut s) -> Word16 -> Int -> Int -> Word64 -> m ()
forall (m :: * -> *) s a.
(RWCtx m s, Bounded a, Integral a, IsWord a, Bits a) =>
Struct ('Mut s) -> a -> Int -> Int -> Word64 -> m ()
GenHelpers.setWordField Struct ('Mut s)
struct ((Word64 -> Word16
forall a b. (Integral a, Num b) => a -> b
Std_.fromIntegral (Word16 -> Word64
forall a. IsWord a => a -> Word64
Classes.toWord Word16
value)) :: Std_.Word16) Int
0 Int
32 Word64
0)
newtype Provide msg
    = Provide'newtype_ (Untyped.Struct msg)
instance (Classes.FromStruct msg (Provide msg)) where
    fromStruct :: Struct msg -> m (Provide msg)
fromStruct Struct msg
struct = (Provide msg -> m (Provide msg)
forall (f :: * -> *) a. Applicative f => a -> f a
Std_.pure (Struct msg -> Provide msg
forall (msg :: Mutability). Struct msg -> Provide msg
Provide'newtype_ Struct msg
struct))
instance (Classes.ToStruct msg (Provide msg)) where
    toStruct :: Provide msg -> Struct msg
toStruct (Provide'newtype_ Struct msg
struct) = Struct msg
struct
instance (Untyped.HasMessage (Provide mut) mut) where
    message :: Provide mut -> Message mut
message (Provide'newtype_ Struct mut
struct) = (Struct mut -> Message mut
forall a (mut :: Mutability). HasMessage a mut => a -> Message mut
Untyped.message Struct mut
struct)
instance (Untyped.MessageDefault (Provide mut) mut) where
    messageDefault :: Message mut -> m (Provide mut)
messageDefault Message mut
msg = (Struct mut -> Provide mut
forall (msg :: Mutability). Struct msg -> Provide msg
Provide'newtype_ (Struct mut -> Provide mut) -> m (Struct mut) -> m (Provide mut)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (Message mut -> m (Struct mut)
forall a (mut :: Mutability) (m :: * -> *).
(MessageDefault a mut, ReadCtx m mut) =>
Message mut -> m a
Untyped.messageDefault Message mut
msg))
instance (Classes.FromPtr msg (Provide msg)) where
    fromPtr :: Message msg -> Maybe (Ptr msg) -> m (Provide msg)
fromPtr Message msg
msg Maybe (Ptr msg)
ptr = (Struct msg -> Provide msg
forall (msg :: Mutability). Struct msg -> Provide msg
Provide'newtype_ (Struct msg -> Provide msg) -> m (Struct msg) -> m (Provide msg)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (Message msg -> Maybe (Ptr msg) -> m (Struct msg)
forall (mut :: Mutability) a (m :: * -> *).
(FromPtr mut a, ReadCtx m mut) =>
Message mut -> Maybe (Ptr mut) -> m a
Classes.fromPtr Message msg
msg Maybe (Ptr msg)
ptr))
instance (Classes.ToPtr s (Provide (Message.Mut s))) where
    toPtr :: Message ('Mut s) -> Provide ('Mut s) -> m (Maybe (Ptr ('Mut s)))
toPtr Message ('Mut s)
msg (Provide'newtype_ Struct ('Mut s)
struct) = (Message ('Mut s) -> Struct ('Mut s) -> m (Maybe (Ptr ('Mut s)))
forall s a (m :: * -> *).
(ToPtr s a, WriteCtx m s) =>
Message ('Mut s) -> a -> m (Maybe (Ptr ('Mut s)))
Classes.toPtr Message ('Mut s)
msg Struct ('Mut s)
struct)
instance (Classes.Allocate s (Provide (Message.Mut s))) where
    new :: Message ('Mut s) -> m (Provide ('Mut s))
new Message ('Mut s)
msg = (Struct ('Mut s) -> Provide ('Mut s)
forall (msg :: Mutability). Struct msg -> Provide msg
Provide'newtype_ (Struct ('Mut s) -> Provide ('Mut s))
-> m (Struct ('Mut s)) -> m (Provide ('Mut s))
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (Message ('Mut s) -> Word16 -> Word16 -> m (Struct ('Mut s))
forall (m :: * -> *) s.
WriteCtx m s =>
Message ('Mut s) -> Word16 -> Word16 -> m (Struct ('Mut s))
Untyped.allocStruct Message ('Mut s)
msg Word16
1 Word16
2))
instance (Basics.ListElem mut (Provide mut)) where
    newtype List mut (Provide mut)
        = Provide'List_ (Untyped.ListOf mut (Untyped.Struct mut))
    listFromPtr :: Message mut -> Maybe (Ptr mut) -> m (List mut (Provide mut))
listFromPtr Message mut
msg Maybe (Ptr mut)
ptr = (ListOf mut (Struct mut) -> List mut (Provide mut)
forall (mut :: Mutability).
ListOf mut (Struct mut) -> List mut (Provide mut)
Provide'List_ (ListOf mut (Struct mut) -> List mut (Provide mut))
-> m (ListOf mut (Struct mut)) -> m (List mut (Provide mut))
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (Message mut -> Maybe (Ptr mut) -> m (ListOf mut (Struct mut))
forall (mut :: Mutability) a (m :: * -> *).
(FromPtr mut a, ReadCtx m mut) =>
Message mut -> Maybe (Ptr mut) -> m a
Classes.fromPtr Message mut
msg Maybe (Ptr mut)
ptr))
    toUntypedList :: List mut (Provide mut) -> List mut
toUntypedList (Provide'List_ l) = (ListOf mut (Struct mut) -> List mut
forall (mut :: Mutability). ListOf mut (Struct mut) -> List mut
Untyped.ListStruct ListOf mut (Struct mut)
l)
    length :: List mut (Provide mut) -> Int
length (Provide'List_ l) = (ListOf mut (Struct mut) -> Int
forall (msg :: Mutability) a. ListOf msg a -> Int
Untyped.length ListOf mut (Struct mut)
l)
    index :: Int -> List mut (Provide mut) -> m (Provide mut)
index Int
i (Provide'List_ l) = (do
        Struct mut
elt <- (Int -> ListOf mut (Struct mut) -> m (Struct mut)
forall (m :: * -> *) (mut :: Mutability) a.
ReadCtx m mut =>
Int -> ListOf mut a -> m a
Untyped.index Int
i ListOf mut (Struct mut)
l)
        (Struct mut -> m (Provide mut)
forall (mut :: Mutability) a (m :: * -> *).
(FromStruct mut a, ReadCtx m mut) =>
Struct mut -> m a
Classes.fromStruct Struct mut
elt)
        )
instance (Basics.MutListElem s (Provide (Message.Mut s))) where
    setIndex :: Provide ('Mut s) -> Int -> List ('Mut s) (Provide ('Mut s)) -> m ()
setIndex (Provide'newtype_ Struct ('Mut s)
elt) Int
i (Provide'List_ l) = (Struct ('Mut s) -> Int -> ListOf ('Mut s) (Struct ('Mut s)) -> m ()
forall (m :: * -> *) s a.
RWCtx m s =>
a -> Int -> ListOf ('Mut s) a -> m ()
Untyped.setIndex Struct ('Mut s)
elt Int
i ListOf ('Mut s) (Struct ('Mut s))
l)
    newList :: Message ('Mut s) -> Int -> m (List ('Mut s) (Provide ('Mut s)))
newList Message ('Mut s)
msg Int
len = (ListOf ('Mut s) (Struct ('Mut s))
-> List ('Mut s) (Provide ('Mut s))
forall (mut :: Mutability).
ListOf mut (Struct mut) -> List mut (Provide mut)
Provide'List_ (ListOf ('Mut s) (Struct ('Mut s))
 -> List ('Mut s) (Provide ('Mut s)))
-> m (ListOf ('Mut s) (Struct ('Mut s)))
-> m (List ('Mut s) (Provide ('Mut s)))
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (Message ('Mut s)
-> Word16 -> Word16 -> Int -> m (ListOf ('Mut s) (Struct ('Mut s)))
forall (m :: * -> *) s.
WriteCtx m s =>
Message ('Mut s)
-> Word16 -> Word16 -> Int -> m (ListOf ('Mut s) (Struct ('Mut s)))
Untyped.allocCompositeList Message ('Mut s)
msg Word16
1 Word16
2 Int
len))
get_Provide'questionId :: ((Untyped.ReadCtx m msg)) => (Provide msg) -> (m Std_.Word32)
get_Provide'questionId :: Provide msg -> m Word32
get_Provide'questionId (Provide'newtype_ Struct msg
struct) = (Struct msg -> Int -> Int -> Word64 -> m Word32
forall (m :: * -> *) (mut :: Mutability) a.
(ReadCtx m mut, IsWord a) =>
Struct mut -> Int -> Int -> Word64 -> m a
GenHelpers.getWordField Struct msg
struct Int
0 Int
0 Word64
0)
set_Provide'questionId :: ((Untyped.RWCtx m s)) => (Provide (Message.Mut s)) -> Std_.Word32 -> (m ())
set_Provide'questionId :: Provide ('Mut s) -> Word32 -> m ()
set_Provide'questionId (Provide'newtype_ Struct ('Mut s)
struct) Word32
value = (Struct ('Mut s) -> Word32 -> Int -> Int -> Word64 -> m ()
forall (m :: * -> *) s a.
(RWCtx m s, Bounded a, Integral a, IsWord a, Bits a) =>
Struct ('Mut s) -> a -> Int -> Int -> Word64 -> m ()
GenHelpers.setWordField Struct ('Mut s)
struct ((Word64 -> Word32
forall a b. (Integral a, Num b) => a -> b
Std_.fromIntegral (Word32 -> Word64
forall a. IsWord a => a -> Word64
Classes.toWord Word32
value)) :: Std_.Word32) Int
0 Int
0 Word64
0)
get_Provide'target :: ((Untyped.ReadCtx m msg)
                      ,(Classes.FromPtr msg (MessageTarget msg))) => (Provide msg) -> (m (MessageTarget msg))
get_Provide'target :: Provide msg -> m (MessageTarget msg)
get_Provide'target (Provide'newtype_ Struct msg
struct) = (do
    Maybe (Ptr msg)
ptr <- (Int -> Struct msg -> m (Maybe (Ptr msg))
forall (m :: * -> *) (msg :: Mutability).
ReadCtx m msg =>
Int -> Struct msg -> m (Maybe (Ptr msg))
Untyped.getPtr Int
0 Struct msg
struct)
    (Message msg -> Maybe (Ptr msg) -> m (MessageTarget msg)
forall (mut :: Mutability) a (m :: * -> *).
(FromPtr mut a, ReadCtx m mut) =>
Message mut -> Maybe (Ptr mut) -> m a
Classes.fromPtr (Struct msg -> Message msg
forall a (mut :: Mutability). HasMessage a mut => a -> Message mut
Untyped.message Struct msg
struct) Maybe (Ptr msg)
ptr)
    )
set_Provide'target :: ((Untyped.RWCtx m s)
                      ,(Classes.ToPtr s (MessageTarget (Message.Mut s)))) => (Provide (Message.Mut s)) -> (MessageTarget (Message.Mut s)) -> (m ())
set_Provide'target :: Provide ('Mut s) -> MessageTarget ('Mut s) -> m ()
set_Provide'target (Provide'newtype_ Struct ('Mut s)
struct) MessageTarget ('Mut s)
value = (do
    Maybe (Ptr ('Mut s))
ptr <- (Message ('Mut s)
-> MessageTarget ('Mut s) -> m (Maybe (Ptr ('Mut s)))
forall s a (m :: * -> *).
(ToPtr s a, WriteCtx m s) =>
Message ('Mut s) -> a -> m (Maybe (Ptr ('Mut s)))
Classes.toPtr (Struct ('Mut s) -> Message ('Mut s)
forall a (mut :: Mutability). HasMessage a mut => a -> Message mut
Untyped.message Struct ('Mut s)
struct) MessageTarget ('Mut s)
value)
    (Maybe (Ptr ('Mut s)) -> Int -> Struct ('Mut s) -> m ()
forall (m :: * -> *) s.
(ReadCtx m ('Mut s), WriteCtx m s) =>
Maybe (Ptr ('Mut s)) -> Int -> Struct ('Mut s) -> m ()
Untyped.setPtr Maybe (Ptr ('Mut s))
ptr Int
0 Struct ('Mut s)
struct)
    )
has_Provide'target :: ((Untyped.ReadCtx m msg)) => (Provide msg) -> (m Std_.Bool)
has_Provide'target :: Provide msg -> m Bool
has_Provide'target (Provide'newtype_ Struct msg
struct) = (Maybe (Ptr msg) -> Bool
forall a. Maybe a -> Bool
Std_.isJust (Maybe (Ptr msg) -> Bool) -> m (Maybe (Ptr msg)) -> m Bool
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (Int -> Struct msg -> m (Maybe (Ptr msg))
forall (m :: * -> *) (msg :: Mutability).
ReadCtx m msg =>
Int -> Struct msg -> m (Maybe (Ptr msg))
Untyped.getPtr Int
0 Struct msg
struct))
new_Provide'target :: ((Untyped.RWCtx m s)) => (Provide (Message.Mut s)) -> (m (MessageTarget (Message.Mut s)))
new_Provide'target :: Provide ('Mut s) -> m (MessageTarget ('Mut s))
new_Provide'target Provide ('Mut s)
struct = (do
    MessageTarget ('Mut s)
result <- (Message ('Mut s) -> m (MessageTarget ('Mut s))
forall s e (m :: * -> *).
(Allocate s e, WriteCtx m s) =>
Message ('Mut s) -> m e
Classes.new (Provide ('Mut s) -> Message ('Mut s)
forall a (mut :: Mutability). HasMessage a mut => a -> Message mut
Untyped.message Provide ('Mut s)
struct))
    (Provide ('Mut s) -> MessageTarget ('Mut s) -> m ()
forall (m :: * -> *) s.
(RWCtx m s, ToPtr s (MessageTarget ('Mut s))) =>
Provide ('Mut s) -> MessageTarget ('Mut s) -> m ()
set_Provide'target Provide ('Mut s)
struct MessageTarget ('Mut s)
result)
    (MessageTarget ('Mut s) -> m (MessageTarget ('Mut s))
forall (f :: * -> *) a. Applicative f => a -> f a
Std_.pure MessageTarget ('Mut s)
result)
    )
get_Provide'recipient :: ((Untyped.ReadCtx m msg)
                         ,(Classes.FromPtr msg (Std_.Maybe (Untyped.Ptr msg)))) => (Provide msg) -> (m (Std_.Maybe (Untyped.Ptr msg)))
get_Provide'recipient :: Provide msg -> m (Maybe (Ptr msg))
get_Provide'recipient (Provide'newtype_ Struct msg
struct) = (do
    Maybe (Ptr msg)
ptr <- (Int -> Struct msg -> m (Maybe (Ptr msg))
forall (m :: * -> *) (msg :: Mutability).
ReadCtx m msg =>
Int -> Struct msg -> m (Maybe (Ptr msg))
Untyped.getPtr Int
1 Struct msg
struct)
    (Message msg -> Maybe (Ptr msg) -> m (Maybe (Ptr msg))
forall (mut :: Mutability) a (m :: * -> *).
(FromPtr mut a, ReadCtx m mut) =>
Message mut -> Maybe (Ptr mut) -> m a
Classes.fromPtr (Struct msg -> Message msg
forall a (mut :: Mutability). HasMessage a mut => a -> Message mut
Untyped.message Struct msg
struct) Maybe (Ptr msg)
ptr)
    )
set_Provide'recipient :: ((Untyped.RWCtx m s)
                         ,(Classes.ToPtr s (Std_.Maybe (Untyped.Ptr (Message.Mut s))))) => (Provide (Message.Mut s)) -> (Std_.Maybe (Untyped.Ptr (Message.Mut s))) -> (m ())
set_Provide'recipient :: Provide ('Mut s) -> Maybe (Ptr ('Mut s)) -> m ()
set_Provide'recipient (Provide'newtype_ Struct ('Mut s)
struct) Maybe (Ptr ('Mut s))
value = (do
    Maybe (Ptr ('Mut s))
ptr <- (Message ('Mut s)
-> Maybe (Ptr ('Mut s)) -> m (Maybe (Ptr ('Mut s)))
forall s a (m :: * -> *).
(ToPtr s a, WriteCtx m s) =>
Message ('Mut s) -> a -> m (Maybe (Ptr ('Mut s)))
Classes.toPtr (Struct ('Mut s) -> Message ('Mut s)
forall a (mut :: Mutability). HasMessage a mut => a -> Message mut
Untyped.message Struct ('Mut s)
struct) Maybe (Ptr ('Mut s))
value)
    (Maybe (Ptr ('Mut s)) -> Int -> Struct ('Mut s) -> m ()
forall (m :: * -> *) s.
(ReadCtx m ('Mut s), WriteCtx m s) =>
Maybe (Ptr ('Mut s)) -> Int -> Struct ('Mut s) -> m ()
Untyped.setPtr Maybe (Ptr ('Mut s))
ptr Int
1 Struct ('Mut s)
struct)
    )
has_Provide'recipient :: ((Untyped.ReadCtx m msg)) => (Provide msg) -> (m Std_.Bool)
has_Provide'recipient :: Provide msg -> m Bool
has_Provide'recipient (Provide'newtype_ Struct msg
struct) = (Maybe (Ptr msg) -> Bool
forall a. Maybe a -> Bool
Std_.isJust (Maybe (Ptr msg) -> Bool) -> m (Maybe (Ptr msg)) -> m Bool
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (Int -> Struct msg -> m (Maybe (Ptr msg))
forall (m :: * -> *) (msg :: Mutability).
ReadCtx m msg =>
Int -> Struct msg -> m (Maybe (Ptr msg))
Untyped.getPtr Int
1 Struct msg
struct))
newtype Accept msg
    = Accept'newtype_ (Untyped.Struct msg)
instance (Classes.FromStruct msg (Accept msg)) where
    fromStruct :: Struct msg -> m (Accept msg)
fromStruct Struct msg
struct = (Accept msg -> m (Accept msg)
forall (f :: * -> *) a. Applicative f => a -> f a
Std_.pure (Struct msg -> Accept msg
forall (msg :: Mutability). Struct msg -> Accept msg
Accept'newtype_ Struct msg
struct))
instance (Classes.ToStruct msg (Accept msg)) where
    toStruct :: Accept msg -> Struct msg
toStruct (Accept'newtype_ Struct msg
struct) = Struct msg
struct
instance (Untyped.HasMessage (Accept mut) mut) where
    message :: Accept mut -> Message mut
message (Accept'newtype_ Struct mut
struct) = (Struct mut -> Message mut
forall a (mut :: Mutability). HasMessage a mut => a -> Message mut
Untyped.message Struct mut
struct)
instance (Untyped.MessageDefault (Accept mut) mut) where
    messageDefault :: Message mut -> m (Accept mut)
messageDefault Message mut
msg = (Struct mut -> Accept mut
forall (msg :: Mutability). Struct msg -> Accept msg
Accept'newtype_ (Struct mut -> Accept mut) -> m (Struct mut) -> m (Accept mut)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (Message mut -> m (Struct mut)
forall a (mut :: Mutability) (m :: * -> *).
(MessageDefault a mut, ReadCtx m mut) =>
Message mut -> m a
Untyped.messageDefault Message mut
msg))
instance (Classes.FromPtr msg (Accept msg)) where
    fromPtr :: Message msg -> Maybe (Ptr msg) -> m (Accept msg)
fromPtr Message msg
msg Maybe (Ptr msg)
ptr = (Struct msg -> Accept msg
forall (msg :: Mutability). Struct msg -> Accept msg
Accept'newtype_ (Struct msg -> Accept msg) -> m (Struct msg) -> m (Accept msg)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (Message msg -> Maybe (Ptr msg) -> m (Struct msg)
forall (mut :: Mutability) a (m :: * -> *).
(FromPtr mut a, ReadCtx m mut) =>
Message mut -> Maybe (Ptr mut) -> m a
Classes.fromPtr Message msg
msg Maybe (Ptr msg)
ptr))
instance (Classes.ToPtr s (Accept (Message.Mut s))) where
    toPtr :: Message ('Mut s) -> Accept ('Mut s) -> m (Maybe (Ptr ('Mut s)))
toPtr Message ('Mut s)
msg (Accept'newtype_ Struct ('Mut s)
struct) = (Message ('Mut s) -> Struct ('Mut s) -> m (Maybe (Ptr ('Mut s)))
forall s a (m :: * -> *).
(ToPtr s a, WriteCtx m s) =>
Message ('Mut s) -> a -> m (Maybe (Ptr ('Mut s)))
Classes.toPtr Message ('Mut s)
msg Struct ('Mut s)
struct)
instance (Classes.Allocate s (Accept (Message.Mut s))) where
    new :: Message ('Mut s) -> m (Accept ('Mut s))
new Message ('Mut s)
msg = (Struct ('Mut s) -> Accept ('Mut s)
forall (msg :: Mutability). Struct msg -> Accept msg
Accept'newtype_ (Struct ('Mut s) -> Accept ('Mut s))
-> m (Struct ('Mut s)) -> m (Accept ('Mut s))
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (Message ('Mut s) -> Word16 -> Word16 -> m (Struct ('Mut s))
forall (m :: * -> *) s.
WriteCtx m s =>
Message ('Mut s) -> Word16 -> Word16 -> m (Struct ('Mut s))
Untyped.allocStruct Message ('Mut s)
msg Word16
1 Word16
1))
instance (Basics.ListElem mut (Accept mut)) where
    newtype List mut (Accept mut)
        = Accept'List_ (Untyped.ListOf mut (Untyped.Struct mut))
    listFromPtr :: Message mut -> Maybe (Ptr mut) -> m (List mut (Accept mut))
listFromPtr Message mut
msg Maybe (Ptr mut)
ptr = (ListOf mut (Struct mut) -> List mut (Accept mut)
forall (mut :: Mutability).
ListOf mut (Struct mut) -> List mut (Accept mut)
Accept'List_ (ListOf mut (Struct mut) -> List mut (Accept mut))
-> m (ListOf mut (Struct mut)) -> m (List mut (Accept mut))
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (Message mut -> Maybe (Ptr mut) -> m (ListOf mut (Struct mut))
forall (mut :: Mutability) a (m :: * -> *).
(FromPtr mut a, ReadCtx m mut) =>
Message mut -> Maybe (Ptr mut) -> m a
Classes.fromPtr Message mut
msg Maybe (Ptr mut)
ptr))
    toUntypedList :: List mut (Accept mut) -> List mut
toUntypedList (Accept'List_ l) = (ListOf mut (Struct mut) -> List mut
forall (mut :: Mutability). ListOf mut (Struct mut) -> List mut
Untyped.ListStruct ListOf mut (Struct mut)
l)
    length :: List mut (Accept mut) -> Int
length (Accept'List_ l) = (ListOf mut (Struct mut) -> Int
forall (msg :: Mutability) a. ListOf msg a -> Int
Untyped.length ListOf mut (Struct mut)
l)
    index :: Int -> List mut (Accept mut) -> m (Accept mut)
index Int
i (Accept'List_ l) = (do
        Struct mut
elt <- (Int -> ListOf mut (Struct mut) -> m (Struct mut)
forall (m :: * -> *) (mut :: Mutability) a.
ReadCtx m mut =>
Int -> ListOf mut a -> m a
Untyped.index Int
i ListOf mut (Struct mut)
l)
        (Struct mut -> m (Accept mut)
forall (mut :: Mutability) a (m :: * -> *).
(FromStruct mut a, ReadCtx m mut) =>
Struct mut -> m a
Classes.fromStruct Struct mut
elt)
        )
instance (Basics.MutListElem s (Accept (Message.Mut s))) where
    setIndex :: Accept ('Mut s) -> Int -> List ('Mut s) (Accept ('Mut s)) -> m ()
setIndex (Accept'newtype_ Struct ('Mut s)
elt) Int
i (Accept'List_ l) = (Struct ('Mut s) -> Int -> ListOf ('Mut s) (Struct ('Mut s)) -> m ()
forall (m :: * -> *) s a.
RWCtx m s =>
a -> Int -> ListOf ('Mut s) a -> m ()
Untyped.setIndex Struct ('Mut s)
elt Int
i ListOf ('Mut s) (Struct ('Mut s))
l)
    newList :: Message ('Mut s) -> Int -> m (List ('Mut s) (Accept ('Mut s)))
newList Message ('Mut s)
msg Int
len = (ListOf ('Mut s) (Struct ('Mut s))
-> List ('Mut s) (Accept ('Mut s))
forall (mut :: Mutability).
ListOf mut (Struct mut) -> List mut (Accept mut)
Accept'List_ (ListOf ('Mut s) (Struct ('Mut s))
 -> List ('Mut s) (Accept ('Mut s)))
-> m (ListOf ('Mut s) (Struct ('Mut s)))
-> m (List ('Mut s) (Accept ('Mut s)))
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (Message ('Mut s)
-> Word16 -> Word16 -> Int -> m (ListOf ('Mut s) (Struct ('Mut s)))
forall (m :: * -> *) s.
WriteCtx m s =>
Message ('Mut s)
-> Word16 -> Word16 -> Int -> m (ListOf ('Mut s) (Struct ('Mut s)))
Untyped.allocCompositeList Message ('Mut s)
msg Word16
1 Word16
1 Int
len))
get_Accept'questionId :: ((Untyped.ReadCtx m msg)) => (Accept msg) -> (m Std_.Word32)
get_Accept'questionId :: Accept msg -> m Word32
get_Accept'questionId (Accept'newtype_ Struct msg
struct) = (Struct msg -> Int -> Int -> Word64 -> m Word32
forall (m :: * -> *) (mut :: Mutability) a.
(ReadCtx m mut, IsWord a) =>
Struct mut -> Int -> Int -> Word64 -> m a
GenHelpers.getWordField Struct msg
struct Int
0 Int
0 Word64
0)
set_Accept'questionId :: ((Untyped.RWCtx m s)) => (Accept (Message.Mut s)) -> Std_.Word32 -> (m ())
set_Accept'questionId :: Accept ('Mut s) -> Word32 -> m ()
set_Accept'questionId (Accept'newtype_ Struct ('Mut s)
struct) Word32
value = (Struct ('Mut s) -> Word32 -> Int -> Int -> Word64 -> m ()
forall (m :: * -> *) s a.
(RWCtx m s, Bounded a, Integral a, IsWord a, Bits a) =>
Struct ('Mut s) -> a -> Int -> Int -> Word64 -> m ()
GenHelpers.setWordField Struct ('Mut s)
struct ((Word64 -> Word32
forall a b. (Integral a, Num b) => a -> b
Std_.fromIntegral (Word32 -> Word64
forall a. IsWord a => a -> Word64
Classes.toWord Word32
value)) :: Std_.Word32) Int
0 Int
0 Word64
0)
get_Accept'provision :: ((Untyped.ReadCtx m msg)
                        ,(Classes.FromPtr msg (Std_.Maybe (Untyped.Ptr msg)))) => (Accept msg) -> (m (Std_.Maybe (Untyped.Ptr msg)))
get_Accept'provision :: Accept msg -> m (Maybe (Ptr msg))
get_Accept'provision (Accept'newtype_ Struct msg
struct) = (do
    Maybe (Ptr msg)
ptr <- (Int -> Struct msg -> m (Maybe (Ptr msg))
forall (m :: * -> *) (msg :: Mutability).
ReadCtx m msg =>
Int -> Struct msg -> m (Maybe (Ptr msg))
Untyped.getPtr Int
0 Struct msg
struct)
    (Message msg -> Maybe (Ptr msg) -> m (Maybe (Ptr msg))
forall (mut :: Mutability) a (m :: * -> *).
(FromPtr mut a, ReadCtx m mut) =>
Message mut -> Maybe (Ptr mut) -> m a
Classes.fromPtr (Struct msg -> Message msg
forall a (mut :: Mutability). HasMessage a mut => a -> Message mut
Untyped.message Struct msg
struct) Maybe (Ptr msg)
ptr)
    )
set_Accept'provision :: ((Untyped.RWCtx m s)
                        ,(Classes.ToPtr s (Std_.Maybe (Untyped.Ptr (Message.Mut s))))) => (Accept (Message.Mut s)) -> (Std_.Maybe (Untyped.Ptr (Message.Mut s))) -> (m ())
set_Accept'provision :: Accept ('Mut s) -> Maybe (Ptr ('Mut s)) -> m ()
set_Accept'provision (Accept'newtype_ Struct ('Mut s)
struct) Maybe (Ptr ('Mut s))
value = (do
    Maybe (Ptr ('Mut s))
ptr <- (Message ('Mut s)
-> Maybe (Ptr ('Mut s)) -> m (Maybe (Ptr ('Mut s)))
forall s a (m :: * -> *).
(ToPtr s a, WriteCtx m s) =>
Message ('Mut s) -> a -> m (Maybe (Ptr ('Mut s)))
Classes.toPtr (Struct ('Mut s) -> Message ('Mut s)
forall a (mut :: Mutability). HasMessage a mut => a -> Message mut
Untyped.message Struct ('Mut s)
struct) Maybe (Ptr ('Mut s))
value)
    (Maybe (Ptr ('Mut s)) -> Int -> Struct ('Mut s) -> m ()
forall (m :: * -> *) s.
(ReadCtx m ('Mut s), WriteCtx m s) =>
Maybe (Ptr ('Mut s)) -> Int -> Struct ('Mut s) -> m ()
Untyped.setPtr Maybe (Ptr ('Mut s))
ptr Int
0 Struct ('Mut s)
struct)
    )
has_Accept'provision :: ((Untyped.ReadCtx m msg)) => (Accept msg) -> (m Std_.Bool)
has_Accept'provision :: Accept msg -> m Bool
has_Accept'provision (Accept'newtype_ Struct msg
struct) = (Maybe (Ptr msg) -> Bool
forall a. Maybe a -> Bool
Std_.isJust (Maybe (Ptr msg) -> Bool) -> m (Maybe (Ptr msg)) -> m Bool
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (Int -> Struct msg -> m (Maybe (Ptr msg))
forall (m :: * -> *) (msg :: Mutability).
ReadCtx m msg =>
Int -> Struct msg -> m (Maybe (Ptr msg))
Untyped.getPtr Int
0 Struct msg
struct))
get_Accept'embargo :: ((Untyped.ReadCtx m msg)) => (Accept msg) -> (m Std_.Bool)
get_Accept'embargo :: Accept msg -> m Bool
get_Accept'embargo (Accept'newtype_ Struct msg
struct) = (Struct msg -> Int -> Int -> Word64 -> m Bool
forall (m :: * -> *) (mut :: Mutability) a.
(ReadCtx m mut, IsWord a) =>
Struct mut -> Int -> Int -> Word64 -> m a
GenHelpers.getWordField Struct msg
struct Int
0 Int
32 Word64
0)
set_Accept'embargo :: ((Untyped.RWCtx m s)) => (Accept (Message.Mut s)) -> Std_.Bool -> (m ())
set_Accept'embargo :: Accept ('Mut s) -> Bool -> m ()
set_Accept'embargo (Accept'newtype_ Struct ('Mut s)
struct) Bool
value = (Struct ('Mut s) -> Word1 -> Int -> Int -> Word64 -> m ()
forall (m :: * -> *) s a.
(RWCtx m s, Bounded a, Integral a, IsWord a, Bits a) =>
Struct ('Mut s) -> a -> Int -> Int -> Word64 -> m ()
GenHelpers.setWordField Struct ('Mut s)
struct ((Word64 -> Word1
forall a b. (Integral a, Num b) => a -> b
Std_.fromIntegral (Bool -> Word64
forall a. IsWord a => a -> Word64
Classes.toWord Bool
value)) :: Std_.Word1) Int
0 Int
32 Word64
0)
newtype Join msg
    = Join'newtype_ (Untyped.Struct msg)
instance (Classes.FromStruct msg (Join msg)) where
    fromStruct :: Struct msg -> m (Join msg)
fromStruct Struct msg
struct = (Join msg -> m (Join msg)
forall (f :: * -> *) a. Applicative f => a -> f a
Std_.pure (Struct msg -> Join msg
forall (msg :: Mutability). Struct msg -> Join msg
Join'newtype_ Struct msg
struct))
instance (Classes.ToStruct msg (Join msg)) where
    toStruct :: Join msg -> Struct msg
toStruct (Join'newtype_ Struct msg
struct) = Struct msg
struct
instance (Untyped.HasMessage (Join mut) mut) where
    message :: Join mut -> Message mut
message (Join'newtype_ Struct mut
struct) = (Struct mut -> Message mut
forall a (mut :: Mutability). HasMessage a mut => a -> Message mut
Untyped.message Struct mut
struct)
instance (Untyped.MessageDefault (Join mut) mut) where
    messageDefault :: Message mut -> m (Join mut)
messageDefault Message mut
msg = (Struct mut -> Join mut
forall (msg :: Mutability). Struct msg -> Join msg
Join'newtype_ (Struct mut -> Join mut) -> m (Struct mut) -> m (Join mut)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (Message mut -> m (Struct mut)
forall a (mut :: Mutability) (m :: * -> *).
(MessageDefault a mut, ReadCtx m mut) =>
Message mut -> m a
Untyped.messageDefault Message mut
msg))
instance (Classes.FromPtr msg (Join msg)) where
    fromPtr :: Message msg -> Maybe (Ptr msg) -> m (Join msg)
fromPtr Message msg
msg Maybe (Ptr msg)
ptr = (Struct msg -> Join msg
forall (msg :: Mutability). Struct msg -> Join msg
Join'newtype_ (Struct msg -> Join msg) -> m (Struct msg) -> m (Join msg)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (Message msg -> Maybe (Ptr msg) -> m (Struct msg)
forall (mut :: Mutability) a (m :: * -> *).
(FromPtr mut a, ReadCtx m mut) =>
Message mut -> Maybe (Ptr mut) -> m a
Classes.fromPtr Message msg
msg Maybe (Ptr msg)
ptr))
instance (Classes.ToPtr s (Join (Message.Mut s))) where
    toPtr :: Message ('Mut s) -> Join ('Mut s) -> m (Maybe (Ptr ('Mut s)))
toPtr Message ('Mut s)
msg (Join'newtype_ Struct ('Mut s)
struct) = (Message ('Mut s) -> Struct ('Mut s) -> m (Maybe (Ptr ('Mut s)))
forall s a (m :: * -> *).
(ToPtr s a, WriteCtx m s) =>
Message ('Mut s) -> a -> m (Maybe (Ptr ('Mut s)))
Classes.toPtr Message ('Mut s)
msg Struct ('Mut s)
struct)
instance (Classes.Allocate s (Join (Message.Mut s))) where
    new :: Message ('Mut s) -> m (Join ('Mut s))
new Message ('Mut s)
msg = (Struct ('Mut s) -> Join ('Mut s)
forall (msg :: Mutability). Struct msg -> Join msg
Join'newtype_ (Struct ('Mut s) -> Join ('Mut s))
-> m (Struct ('Mut s)) -> m (Join ('Mut s))
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (Message ('Mut s) -> Word16 -> Word16 -> m (Struct ('Mut s))
forall (m :: * -> *) s.
WriteCtx m s =>
Message ('Mut s) -> Word16 -> Word16 -> m (Struct ('Mut s))
Untyped.allocStruct Message ('Mut s)
msg Word16
1 Word16
2))
instance (Basics.ListElem mut (Join mut)) where
    newtype List mut (Join mut)
        = Join'List_ (Untyped.ListOf mut (Untyped.Struct mut))
    listFromPtr :: Message mut -> Maybe (Ptr mut) -> m (List mut (Join mut))
listFromPtr Message mut
msg Maybe (Ptr mut)
ptr = (ListOf mut (Struct mut) -> List mut (Join mut)
forall (mut :: Mutability).
ListOf mut (Struct mut) -> List mut (Join mut)
Join'List_ (ListOf mut (Struct mut) -> List mut (Join mut))
-> m (ListOf mut (Struct mut)) -> m (List mut (Join mut))
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (Message mut -> Maybe (Ptr mut) -> m (ListOf mut (Struct mut))
forall (mut :: Mutability) a (m :: * -> *).
(FromPtr mut a, ReadCtx m mut) =>
Message mut -> Maybe (Ptr mut) -> m a
Classes.fromPtr Message mut
msg Maybe (Ptr mut)
ptr))
    toUntypedList :: List mut (Join mut) -> List mut
toUntypedList (Join'List_ l) = (ListOf mut (Struct mut) -> List mut
forall (mut :: Mutability). ListOf mut (Struct mut) -> List mut
Untyped.ListStruct ListOf mut (Struct mut)
l)
    length :: List mut (Join mut) -> Int
length (Join'List_ l) = (ListOf mut (Struct mut) -> Int
forall (msg :: Mutability) a. ListOf msg a -> Int
Untyped.length ListOf mut (Struct mut)
l)
    index :: Int -> List mut (Join mut) -> m (Join mut)
index Int
i (Join'List_ l) = (do
        Struct mut
elt <- (Int -> ListOf mut (Struct mut) -> m (Struct mut)
forall (m :: * -> *) (mut :: Mutability) a.
ReadCtx m mut =>
Int -> ListOf mut a -> m a
Untyped.index Int
i ListOf mut (Struct mut)
l)
        (Struct mut -> m (Join mut)
forall (mut :: Mutability) a (m :: * -> *).
(FromStruct mut a, ReadCtx m mut) =>
Struct mut -> m a
Classes.fromStruct Struct mut
elt)
        )
instance (Basics.MutListElem s (Join (Message.Mut s))) where
    setIndex :: Join ('Mut s) -> Int -> List ('Mut s) (Join ('Mut s)) -> m ()
setIndex (Join'newtype_ Struct ('Mut s)
elt) Int
i (Join'List_ l) = (Struct ('Mut s) -> Int -> ListOf ('Mut s) (Struct ('Mut s)) -> m ()
forall (m :: * -> *) s a.
RWCtx m s =>
a -> Int -> ListOf ('Mut s) a -> m ()
Untyped.setIndex Struct ('Mut s)
elt Int
i ListOf ('Mut s) (Struct ('Mut s))
l)
    newList :: Message ('Mut s) -> Int -> m (List ('Mut s) (Join ('Mut s)))
newList Message ('Mut s)
msg Int
len = (ListOf ('Mut s) (Struct ('Mut s)) -> List ('Mut s) (Join ('Mut s))
forall (mut :: Mutability).
ListOf mut (Struct mut) -> List mut (Join mut)
Join'List_ (ListOf ('Mut s) (Struct ('Mut s))
 -> List ('Mut s) (Join ('Mut s)))
-> m (ListOf ('Mut s) (Struct ('Mut s)))
-> m (List ('Mut s) (Join ('Mut s)))
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (Message ('Mut s)
-> Word16 -> Word16 -> Int -> m (ListOf ('Mut s) (Struct ('Mut s)))
forall (m :: * -> *) s.
WriteCtx m s =>
Message ('Mut s)
-> Word16 -> Word16 -> Int -> m (ListOf ('Mut s) (Struct ('Mut s)))
Untyped.allocCompositeList Message ('Mut s)
msg Word16
1 Word16
2 Int
len))
get_Join'questionId :: ((Untyped.ReadCtx m msg)) => (Join msg) -> (m Std_.Word32)
get_Join'questionId :: Join msg -> m Word32
get_Join'questionId (Join'newtype_ Struct msg
struct) = (Struct msg -> Int -> Int -> Word64 -> m Word32
forall (m :: * -> *) (mut :: Mutability) a.
(ReadCtx m mut, IsWord a) =>
Struct mut -> Int -> Int -> Word64 -> m a
GenHelpers.getWordField Struct msg
struct Int
0 Int
0 Word64
0)
set_Join'questionId :: ((Untyped.RWCtx m s)) => (Join (Message.Mut s)) -> Std_.Word32 -> (m ())
set_Join'questionId :: Join ('Mut s) -> Word32 -> m ()
set_Join'questionId (Join'newtype_ Struct ('Mut s)
struct) Word32
value = (Struct ('Mut s) -> Word32 -> Int -> Int -> Word64 -> m ()
forall (m :: * -> *) s a.
(RWCtx m s, Bounded a, Integral a, IsWord a, Bits a) =>
Struct ('Mut s) -> a -> Int -> Int -> Word64 -> m ()
GenHelpers.setWordField Struct ('Mut s)
struct ((Word64 -> Word32
forall a b. (Integral a, Num b) => a -> b
Std_.fromIntegral (Word32 -> Word64
forall a. IsWord a => a -> Word64
Classes.toWord Word32
value)) :: Std_.Word32) Int
0 Int
0 Word64
0)
get_Join'target :: ((Untyped.ReadCtx m msg)
                   ,(Classes.FromPtr msg (MessageTarget msg))) => (Join msg) -> (m (MessageTarget msg))
get_Join'target :: Join msg -> m (MessageTarget msg)
get_Join'target (Join'newtype_ Struct msg
struct) = (do
    Maybe (Ptr msg)
ptr <- (Int -> Struct msg -> m (Maybe (Ptr msg))
forall (m :: * -> *) (msg :: Mutability).
ReadCtx m msg =>
Int -> Struct msg -> m (Maybe (Ptr msg))
Untyped.getPtr Int
0 Struct msg
struct)
    (Message msg -> Maybe (Ptr msg) -> m (MessageTarget msg)
forall (mut :: Mutability) a (m :: * -> *).
(FromPtr mut a, ReadCtx m mut) =>
Message mut -> Maybe (Ptr mut) -> m a
Classes.fromPtr (Struct msg -> Message msg
forall a (mut :: Mutability). HasMessage a mut => a -> Message mut
Untyped.message Struct msg
struct) Maybe (Ptr msg)
ptr)
    )
set_Join'target :: ((Untyped.RWCtx m s)
                   ,(Classes.ToPtr s (MessageTarget (Message.Mut s)))) => (Join (Message.Mut s)) -> (MessageTarget (Message.Mut s)) -> (m ())
set_Join'target :: Join ('Mut s) -> MessageTarget ('Mut s) -> m ()
set_Join'target (Join'newtype_ Struct ('Mut s)
struct) MessageTarget ('Mut s)
value = (do
    Maybe (Ptr ('Mut s))
ptr <- (Message ('Mut s)
-> MessageTarget ('Mut s) -> m (Maybe (Ptr ('Mut s)))
forall s a (m :: * -> *).
(ToPtr s a, WriteCtx m s) =>
Message ('Mut s) -> a -> m (Maybe (Ptr ('Mut s)))
Classes.toPtr (Struct ('Mut s) -> Message ('Mut s)
forall a (mut :: Mutability). HasMessage a mut => a -> Message mut
Untyped.message Struct ('Mut s)
struct) MessageTarget ('Mut s)
value)
    (Maybe (Ptr ('Mut s)) -> Int -> Struct ('Mut s) -> m ()
forall (m :: * -> *) s.
(ReadCtx m ('Mut s), WriteCtx m s) =>
Maybe (Ptr ('Mut s)) -> Int -> Struct ('Mut s) -> m ()
Untyped.setPtr Maybe (Ptr ('Mut s))
ptr Int
0 Struct ('Mut s)
struct)
    )
has_Join'target :: ((Untyped.ReadCtx m msg)) => (Join msg) -> (m Std_.Bool)
has_Join'target :: Join msg -> m Bool
has_Join'target (Join'newtype_ Struct msg
struct) = (Maybe (Ptr msg) -> Bool
forall a. Maybe a -> Bool
Std_.isJust (Maybe (Ptr msg) -> Bool) -> m (Maybe (Ptr msg)) -> m Bool
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (Int -> Struct msg -> m (Maybe (Ptr msg))
forall (m :: * -> *) (msg :: Mutability).
ReadCtx m msg =>
Int -> Struct msg -> m (Maybe (Ptr msg))
Untyped.getPtr Int
0 Struct msg
struct))
new_Join'target :: ((Untyped.RWCtx m s)) => (Join (Message.Mut s)) -> (m (MessageTarget (Message.Mut s)))
new_Join'target :: Join ('Mut s) -> m (MessageTarget ('Mut s))
new_Join'target Join ('Mut s)
struct = (do
    MessageTarget ('Mut s)
result <- (Message ('Mut s) -> m (MessageTarget ('Mut s))
forall s e (m :: * -> *).
(Allocate s e, WriteCtx m s) =>
Message ('Mut s) -> m e
Classes.new (Join ('Mut s) -> Message ('Mut s)
forall a (mut :: Mutability). HasMessage a mut => a -> Message mut
Untyped.message Join ('Mut s)
struct))
    (Join ('Mut s) -> MessageTarget ('Mut s) -> m ()
forall (m :: * -> *) s.
(RWCtx m s, ToPtr s (MessageTarget ('Mut s))) =>
Join ('Mut s) -> MessageTarget ('Mut s) -> m ()
set_Join'target Join ('Mut s)
struct MessageTarget ('Mut s)
result)
    (MessageTarget ('Mut s) -> m (MessageTarget ('Mut s))
forall (f :: * -> *) a. Applicative f => a -> f a
Std_.pure MessageTarget ('Mut s)
result)
    )
get_Join'keyPart :: ((Untyped.ReadCtx m msg)
                    ,(Classes.FromPtr msg (Std_.Maybe (Untyped.Ptr msg)))) => (Join msg) -> (m (Std_.Maybe (Untyped.Ptr msg)))
get_Join'keyPart :: Join msg -> m (Maybe (Ptr msg))
get_Join'keyPart (Join'newtype_ Struct msg
struct) = (do
    Maybe (Ptr msg)
ptr <- (Int -> Struct msg -> m (Maybe (Ptr msg))
forall (m :: * -> *) (msg :: Mutability).
ReadCtx m msg =>
Int -> Struct msg -> m (Maybe (Ptr msg))
Untyped.getPtr Int
1 Struct msg
struct)
    (Message msg -> Maybe (Ptr msg) -> m (Maybe (Ptr msg))
forall (mut :: Mutability) a (m :: * -> *).
(FromPtr mut a, ReadCtx m mut) =>
Message mut -> Maybe (Ptr mut) -> m a
Classes.fromPtr (Struct msg -> Message msg
forall a (mut :: Mutability). HasMessage a mut => a -> Message mut
Untyped.message Struct msg
struct) Maybe (Ptr msg)
ptr)
    )
set_Join'keyPart :: ((Untyped.RWCtx m s)
                    ,(Classes.ToPtr s (Std_.Maybe (Untyped.Ptr (Message.Mut s))))) => (Join (Message.Mut s)) -> (Std_.Maybe (Untyped.Ptr (Message.Mut s))) -> (m ())
set_Join'keyPart :: Join ('Mut s) -> Maybe (Ptr ('Mut s)) -> m ()
set_Join'keyPart (Join'newtype_ Struct ('Mut s)
struct) Maybe (Ptr ('Mut s))
value = (do
    Maybe (Ptr ('Mut s))
ptr <- (Message ('Mut s)
-> Maybe (Ptr ('Mut s)) -> m (Maybe (Ptr ('Mut s)))
forall s a (m :: * -> *).
(ToPtr s a, WriteCtx m s) =>
Message ('Mut s) -> a -> m (Maybe (Ptr ('Mut s)))
Classes.toPtr (Struct ('Mut s) -> Message ('Mut s)
forall a (mut :: Mutability). HasMessage a mut => a -> Message mut
Untyped.message Struct ('Mut s)
struct) Maybe (Ptr ('Mut s))
value)
    (Maybe (Ptr ('Mut s)) -> Int -> Struct ('Mut s) -> m ()
forall (m :: * -> *) s.
(ReadCtx m ('Mut s), WriteCtx m s) =>
Maybe (Ptr ('Mut s)) -> Int -> Struct ('Mut s) -> m ()
Untyped.setPtr Maybe (Ptr ('Mut s))
ptr Int
1 Struct ('Mut s)
struct)
    )
has_Join'keyPart :: ((Untyped.ReadCtx m msg)) => (Join msg) -> (m Std_.Bool)
has_Join'keyPart :: Join msg -> m Bool
has_Join'keyPart (Join'newtype_ Struct msg
struct) = (Maybe (Ptr msg) -> Bool
forall a. Maybe a -> Bool
Std_.isJust (Maybe (Ptr msg) -> Bool) -> m (Maybe (Ptr msg)) -> m Bool
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (Int -> Struct msg -> m (Maybe (Ptr msg))
forall (m :: * -> *) (msg :: Mutability).
ReadCtx m msg =>
Int -> Struct msg -> m (Maybe (Ptr msg))
Untyped.getPtr Int
1 Struct msg
struct))
newtype MessageTarget msg
    = MessageTarget'newtype_ (Untyped.Struct msg)
instance (Classes.FromStruct msg (MessageTarget msg)) where
    fromStruct :: Struct msg -> m (MessageTarget msg)
fromStruct Struct msg
struct = (MessageTarget msg -> m (MessageTarget msg)
forall (f :: * -> *) a. Applicative f => a -> f a
Std_.pure (Struct msg -> MessageTarget msg
forall (msg :: Mutability). Struct msg -> MessageTarget msg
MessageTarget'newtype_ Struct msg
struct))
instance (Classes.ToStruct msg (MessageTarget msg)) where
    toStruct :: MessageTarget msg -> Struct msg
toStruct (MessageTarget'newtype_ Struct msg
struct) = Struct msg
struct
instance (Untyped.HasMessage (MessageTarget mut) mut) where
    message :: MessageTarget mut -> Message mut
message (MessageTarget'newtype_ Struct mut
struct) = (Struct mut -> Message mut
forall a (mut :: Mutability). HasMessage a mut => a -> Message mut
Untyped.message Struct mut
struct)
instance (Untyped.MessageDefault (MessageTarget mut) mut) where
    messageDefault :: Message mut -> m (MessageTarget mut)
messageDefault Message mut
msg = (Struct mut -> MessageTarget mut
forall (msg :: Mutability). Struct msg -> MessageTarget msg
MessageTarget'newtype_ (Struct mut -> MessageTarget mut)
-> m (Struct mut) -> m (MessageTarget mut)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (Message mut -> m (Struct mut)
forall a (mut :: Mutability) (m :: * -> *).
(MessageDefault a mut, ReadCtx m mut) =>
Message mut -> m a
Untyped.messageDefault Message mut
msg))
instance (Classes.FromPtr msg (MessageTarget msg)) where
    fromPtr :: Message msg -> Maybe (Ptr msg) -> m (MessageTarget msg)
fromPtr Message msg
msg Maybe (Ptr msg)
ptr = (Struct msg -> MessageTarget msg
forall (msg :: Mutability). Struct msg -> MessageTarget msg
MessageTarget'newtype_ (Struct msg -> MessageTarget msg)
-> m (Struct msg) -> m (MessageTarget msg)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (Message msg -> Maybe (Ptr msg) -> m (Struct msg)
forall (mut :: Mutability) a (m :: * -> *).
(FromPtr mut a, ReadCtx m mut) =>
Message mut -> Maybe (Ptr mut) -> m a
Classes.fromPtr Message msg
msg Maybe (Ptr msg)
ptr))
instance (Classes.ToPtr s (MessageTarget (Message.Mut s))) where
    toPtr :: Message ('Mut s)
-> MessageTarget ('Mut s) -> m (Maybe (Ptr ('Mut s)))
toPtr Message ('Mut s)
msg (MessageTarget'newtype_ Struct ('Mut s)
struct) = (Message ('Mut s) -> Struct ('Mut s) -> m (Maybe (Ptr ('Mut s)))
forall s a (m :: * -> *).
(ToPtr s a, WriteCtx m s) =>
Message ('Mut s) -> a -> m (Maybe (Ptr ('Mut s)))
Classes.toPtr Message ('Mut s)
msg Struct ('Mut s)
struct)
instance (Classes.Allocate s (MessageTarget (Message.Mut s))) where
    new :: Message ('Mut s) -> m (MessageTarget ('Mut s))
new Message ('Mut s)
msg = (Struct ('Mut s) -> MessageTarget ('Mut s)
forall (msg :: Mutability). Struct msg -> MessageTarget msg
MessageTarget'newtype_ (Struct ('Mut s) -> MessageTarget ('Mut s))
-> m (Struct ('Mut s)) -> m (MessageTarget ('Mut s))
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (Message ('Mut s) -> Word16 -> Word16 -> m (Struct ('Mut s))
forall (m :: * -> *) s.
WriteCtx m s =>
Message ('Mut s) -> Word16 -> Word16 -> m (Struct ('Mut s))
Untyped.allocStruct Message ('Mut s)
msg Word16
1 Word16
1))
instance (Basics.ListElem mut (MessageTarget mut)) where
    newtype List mut (MessageTarget mut)
        = MessageTarget'List_ (Untyped.ListOf mut (Untyped.Struct mut))
    listFromPtr :: Message mut -> Maybe (Ptr mut) -> m (List mut (MessageTarget mut))
listFromPtr Message mut
msg Maybe (Ptr mut)
ptr = (ListOf mut (Struct mut) -> List mut (MessageTarget mut)
forall (mut :: Mutability).
ListOf mut (Struct mut) -> List mut (MessageTarget mut)
MessageTarget'List_ (ListOf mut (Struct mut) -> List mut (MessageTarget mut))
-> m (ListOf mut (Struct mut)) -> m (List mut (MessageTarget mut))
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (Message mut -> Maybe (Ptr mut) -> m (ListOf mut (Struct mut))
forall (mut :: Mutability) a (m :: * -> *).
(FromPtr mut a, ReadCtx m mut) =>
Message mut -> Maybe (Ptr mut) -> m a
Classes.fromPtr Message mut
msg Maybe (Ptr mut)
ptr))
    toUntypedList :: List mut (MessageTarget mut) -> List mut
toUntypedList (MessageTarget'List_ l) = (ListOf mut (Struct mut) -> List mut
forall (mut :: Mutability). ListOf mut (Struct mut) -> List mut
Untyped.ListStruct ListOf mut (Struct mut)
l)
    length :: List mut (MessageTarget mut) -> Int
length (MessageTarget'List_ l) = (ListOf mut (Struct mut) -> Int
forall (msg :: Mutability) a. ListOf msg a -> Int
Untyped.length ListOf mut (Struct mut)
l)
    index :: Int -> List mut (MessageTarget mut) -> m (MessageTarget mut)
index Int
i (MessageTarget'List_ l) = (do
        Struct mut
elt <- (Int -> ListOf mut (Struct mut) -> m (Struct mut)
forall (m :: * -> *) (mut :: Mutability) a.
ReadCtx m mut =>
Int -> ListOf mut a -> m a
Untyped.index Int
i ListOf mut (Struct mut)
l)
        (Struct mut -> m (MessageTarget mut)
forall (mut :: Mutability) a (m :: * -> *).
(FromStruct mut a, ReadCtx m mut) =>
Struct mut -> m a
Classes.fromStruct Struct mut
elt)
        )
instance (Basics.MutListElem s (MessageTarget (Message.Mut s))) where
    setIndex :: MessageTarget ('Mut s)
-> Int -> List ('Mut s) (MessageTarget ('Mut s)) -> m ()
setIndex (MessageTarget'newtype_ Struct ('Mut s)
elt) Int
i (MessageTarget'List_ l) = (Struct ('Mut s) -> Int -> ListOf ('Mut s) (Struct ('Mut s)) -> m ()
forall (m :: * -> *) s a.
RWCtx m s =>
a -> Int -> ListOf ('Mut s) a -> m ()
Untyped.setIndex Struct ('Mut s)
elt Int
i ListOf ('Mut s) (Struct ('Mut s))
l)
    newList :: Message ('Mut s)
-> Int -> m (List ('Mut s) (MessageTarget ('Mut s)))
newList Message ('Mut s)
msg Int
len = (ListOf ('Mut s) (Struct ('Mut s))
-> List ('Mut s) (MessageTarget ('Mut s))
forall (mut :: Mutability).
ListOf mut (Struct mut) -> List mut (MessageTarget mut)
MessageTarget'List_ (ListOf ('Mut s) (Struct ('Mut s))
 -> List ('Mut s) (MessageTarget ('Mut s)))
-> m (ListOf ('Mut s) (Struct ('Mut s)))
-> m (List ('Mut s) (MessageTarget ('Mut s)))
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (Message ('Mut s)
-> Word16 -> Word16 -> Int -> m (ListOf ('Mut s) (Struct ('Mut s)))
forall (m :: * -> *) s.
WriteCtx m s =>
Message ('Mut s)
-> Word16 -> Word16 -> Int -> m (ListOf ('Mut s) (Struct ('Mut s)))
Untyped.allocCompositeList Message ('Mut s)
msg Word16
1 Word16
1 Int
len))
data MessageTarget' (mut :: Message.Mutability)
    = MessageTarget'importedCap Std_.Word32
    | MessageTarget'promisedAnswer (PromisedAnswer mut)
    | MessageTarget'unknown' Std_.Word16
instance (Classes.FromStruct mut (MessageTarget' mut)) where
    fromStruct :: Struct mut -> m (MessageTarget' mut)
fromStruct Struct mut
struct = (do
        Word16
tag <- (Struct mut -> Int -> m Word16
forall (m :: * -> *) (mut :: Mutability).
ReadCtx m mut =>
Struct mut -> Int -> m Word16
GenHelpers.getTag Struct mut
struct Int
2)
        case Word16
tag of
            Word16
0 ->
                (Word32 -> MessageTarget' mut
forall (mut :: Mutability). Word32 -> MessageTarget' mut
MessageTarget'importedCap (Word32 -> MessageTarget' mut)
-> m Word32 -> m (MessageTarget' mut)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (Struct mut -> Int -> Int -> Word64 -> m Word32
forall (m :: * -> *) (mut :: Mutability) a.
(ReadCtx m mut, IsWord a) =>
Struct mut -> Int -> Int -> Word64 -> m a
GenHelpers.getWordField Struct mut
struct Int
0 Int
0 Word64
0))
            Word16
1 ->
                (PromisedAnswer mut -> MessageTarget' mut
forall (mut :: Mutability).
PromisedAnswer mut -> MessageTarget' mut
MessageTarget'promisedAnswer (PromisedAnswer mut -> MessageTarget' mut)
-> m (PromisedAnswer mut) -> m (MessageTarget' mut)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (do
                    Maybe (Ptr mut)
ptr <- (Int -> Struct mut -> m (Maybe (Ptr mut))
forall (m :: * -> *) (msg :: Mutability).
ReadCtx m msg =>
Int -> Struct msg -> m (Maybe (Ptr msg))
Untyped.getPtr Int
0 Struct mut
struct)
                    (Message mut -> Maybe (Ptr mut) -> m (PromisedAnswer mut)
forall (mut :: Mutability) a (m :: * -> *).
(FromPtr mut a, ReadCtx m mut) =>
Message mut -> Maybe (Ptr mut) -> m a
Classes.fromPtr (Struct mut -> Message mut
forall a (mut :: Mutability). HasMessage a mut => a -> Message mut
Untyped.message Struct mut
struct) Maybe (Ptr mut)
ptr)
                    ))
            Word16
_ ->
                (MessageTarget' mut -> m (MessageTarget' mut)
forall (f :: * -> *) a. Applicative f => a -> f a
Std_.pure (Word16 -> MessageTarget' mut
forall (mut :: Mutability). Word16 -> MessageTarget' mut
MessageTarget'unknown' (Word16 -> Word16
forall a b. (Integral a, Num b) => a -> b
Std_.fromIntegral Word16
tag)))
        )
get_MessageTarget' :: ((Untyped.ReadCtx m msg)
                      ,(Classes.FromStruct msg (MessageTarget' msg))) => (MessageTarget msg) -> (m (MessageTarget' msg))
get_MessageTarget' :: MessageTarget msg -> m (MessageTarget' msg)
get_MessageTarget' (MessageTarget'newtype_ Struct msg
struct) = (Struct msg -> m (MessageTarget' msg)
forall (mut :: Mutability) a (m :: * -> *).
(FromStruct mut a, ReadCtx m mut) =>
Struct mut -> m a
Classes.fromStruct Struct msg
struct)
set_MessageTarget'importedCap :: ((Untyped.RWCtx m s)) => (MessageTarget (Message.Mut s)) -> Std_.Word32 -> (m ())
set_MessageTarget'importedCap :: MessageTarget ('Mut s) -> Word32 -> m ()
set_MessageTarget'importedCap (MessageTarget'newtype_ Struct ('Mut s)
struct) Word32
value = (do
    (Struct ('Mut s) -> Word16 -> Int -> Int -> Word64 -> m ()
forall (m :: * -> *) s a.
(RWCtx m s, Bounded a, Integral a, IsWord a, Bits a) =>
Struct ('Mut s) -> a -> Int -> Int -> Word64 -> m ()
GenHelpers.setWordField Struct ('Mut s)
struct (Word16
0 :: Std_.Word16) Int
0 Int
32 Word64
0)
    (Struct ('Mut s) -> Word32 -> Int -> Int -> Word64 -> m ()
forall (m :: * -> *) s a.
(RWCtx m s, Bounded a, Integral a, IsWord a, Bits a) =>
Struct ('Mut s) -> a -> Int -> Int -> Word64 -> m ()
GenHelpers.setWordField Struct ('Mut s)
struct ((Word64 -> Word32
forall a b. (Integral a, Num b) => a -> b
Std_.fromIntegral (Word32 -> Word64
forall a. IsWord a => a -> Word64
Classes.toWord Word32
value)) :: Std_.Word32) Int
0 Int
0 Word64
0)
    )
set_MessageTarget'promisedAnswer :: ((Untyped.RWCtx m s)
                                    ,(Classes.ToPtr s (PromisedAnswer (Message.Mut s)))) => (MessageTarget (Message.Mut s)) -> (PromisedAnswer (Message.Mut s)) -> (m ())
set_MessageTarget'promisedAnswer :: MessageTarget ('Mut s) -> PromisedAnswer ('Mut s) -> m ()
set_MessageTarget'promisedAnswer (MessageTarget'newtype_ Struct ('Mut s)
struct) PromisedAnswer ('Mut s)
value = (do
    (Struct ('Mut s) -> Word16 -> Int -> Int -> Word64 -> m ()
forall (m :: * -> *) s a.
(RWCtx m s, Bounded a, Integral a, IsWord a, Bits a) =>
Struct ('Mut s) -> a -> Int -> Int -> Word64 -> m ()
GenHelpers.setWordField Struct ('Mut s)
struct (Word16
1 :: Std_.Word16) Int
0 Int
32 Word64
0)
    (do
        Maybe (Ptr ('Mut s))
ptr <- (Message ('Mut s)
-> PromisedAnswer ('Mut s) -> m (Maybe (Ptr ('Mut s)))
forall s a (m :: * -> *).
(ToPtr s a, WriteCtx m s) =>
Message ('Mut s) -> a -> m (Maybe (Ptr ('Mut s)))
Classes.toPtr (Struct ('Mut s) -> Message ('Mut s)
forall a (mut :: Mutability). HasMessage a mut => a -> Message mut
Untyped.message Struct ('Mut s)
struct) PromisedAnswer ('Mut s)
value)
        (Maybe (Ptr ('Mut s)) -> Int -> Struct ('Mut s) -> m ()
forall (m :: * -> *) s.
(ReadCtx m ('Mut s), WriteCtx m s) =>
Maybe (Ptr ('Mut s)) -> Int -> Struct ('Mut s) -> m ()
Untyped.setPtr Maybe (Ptr ('Mut s))
ptr Int
0 Struct ('Mut s)
struct)
        )
    )
set_MessageTarget'unknown' :: ((Untyped.RWCtx m s)) => (MessageTarget (Message.Mut s)) -> Std_.Word16 -> (m ())
set_MessageTarget'unknown' :: MessageTarget ('Mut s) -> Word16 -> m ()
set_MessageTarget'unknown' (MessageTarget'newtype_ Struct ('Mut s)
struct) Word16
value = (Struct ('Mut s) -> Word16 -> Int -> Int -> Word64 -> m ()
forall (m :: * -> *) s a.
(RWCtx m s, Bounded a, Integral a, IsWord a, Bits a) =>
Struct ('Mut s) -> a -> Int -> Int -> Word64 -> m ()
GenHelpers.setWordField Struct ('Mut s)
struct ((Word64 -> Word16
forall a b. (Integral a, Num b) => a -> b
Std_.fromIntegral (Word16 -> Word64
forall a. IsWord a => a -> Word64
Classes.toWord Word16
value)) :: Std_.Word16) Int
0 Int
32 Word64
0)
newtype Payload msg
    = Payload'newtype_ (Untyped.Struct msg)
instance (Classes.FromStruct msg (Payload msg)) where
    fromStruct :: Struct msg -> m (Payload msg)
fromStruct Struct msg
struct = (Payload msg -> m (Payload msg)
forall (f :: * -> *) a. Applicative f => a -> f a
Std_.pure (Struct msg -> Payload msg
forall (msg :: Mutability). Struct msg -> Payload msg
Payload'newtype_ Struct msg
struct))
instance (Classes.ToStruct msg (Payload msg)) where
    toStruct :: Payload msg -> Struct msg
toStruct (Payload'newtype_ Struct msg
struct) = Struct msg
struct
instance (Untyped.HasMessage (Payload mut) mut) where
    message :: Payload mut -> Message mut
message (Payload'newtype_ Struct mut
struct) = (Struct mut -> Message mut
forall a (mut :: Mutability). HasMessage a mut => a -> Message mut
Untyped.message Struct mut
struct)
instance (Untyped.MessageDefault (Payload mut) mut) where
    messageDefault :: Message mut -> m (Payload mut)
messageDefault Message mut
msg = (Struct mut -> Payload mut
forall (msg :: Mutability). Struct msg -> Payload msg
Payload'newtype_ (Struct mut -> Payload mut) -> m (Struct mut) -> m (Payload mut)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (Message mut -> m (Struct mut)
forall a (mut :: Mutability) (m :: * -> *).
(MessageDefault a mut, ReadCtx m mut) =>
Message mut -> m a
Untyped.messageDefault Message mut
msg))
instance (Classes.FromPtr msg (Payload msg)) where
    fromPtr :: Message msg -> Maybe (Ptr msg) -> m (Payload msg)
fromPtr Message msg
msg Maybe (Ptr msg)
ptr = (Struct msg -> Payload msg
forall (msg :: Mutability). Struct msg -> Payload msg
Payload'newtype_ (Struct msg -> Payload msg) -> m (Struct msg) -> m (Payload msg)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (Message msg -> Maybe (Ptr msg) -> m (Struct msg)
forall (mut :: Mutability) a (m :: * -> *).
(FromPtr mut a, ReadCtx m mut) =>
Message mut -> Maybe (Ptr mut) -> m a
Classes.fromPtr Message msg
msg Maybe (Ptr msg)
ptr))
instance (Classes.ToPtr s (Payload (Message.Mut s))) where
    toPtr :: Message ('Mut s) -> Payload ('Mut s) -> m (Maybe (Ptr ('Mut s)))
toPtr Message ('Mut s)
msg (Payload'newtype_ Struct ('Mut s)
struct) = (Message ('Mut s) -> Struct ('Mut s) -> m (Maybe (Ptr ('Mut s)))
forall s a (m :: * -> *).
(ToPtr s a, WriteCtx m s) =>
Message ('Mut s) -> a -> m (Maybe (Ptr ('Mut s)))
Classes.toPtr Message ('Mut s)
msg Struct ('Mut s)
struct)
instance (Classes.Allocate s (Payload (Message.Mut s))) where
    new :: Message ('Mut s) -> m (Payload ('Mut s))
new Message ('Mut s)
msg = (Struct ('Mut s) -> Payload ('Mut s)
forall (msg :: Mutability). Struct msg -> Payload msg
Payload'newtype_ (Struct ('Mut s) -> Payload ('Mut s))
-> m (Struct ('Mut s)) -> m (Payload ('Mut s))
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (Message ('Mut s) -> Word16 -> Word16 -> m (Struct ('Mut s))
forall (m :: * -> *) s.
WriteCtx m s =>
Message ('Mut s) -> Word16 -> Word16 -> m (Struct ('Mut s))
Untyped.allocStruct Message ('Mut s)
msg Word16
0 Word16
2))
instance (Basics.ListElem mut (Payload mut)) where
    newtype List mut (Payload mut)
        = Payload'List_ (Untyped.ListOf mut (Untyped.Struct mut))
    listFromPtr :: Message mut -> Maybe (Ptr mut) -> m (List mut (Payload mut))
listFromPtr Message mut
msg Maybe (Ptr mut)
ptr = (ListOf mut (Struct mut) -> List mut (Payload mut)
forall (mut :: Mutability).
ListOf mut (Struct mut) -> List mut (Payload mut)
Payload'List_ (ListOf mut (Struct mut) -> List mut (Payload mut))
-> m (ListOf mut (Struct mut)) -> m (List mut (Payload mut))
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (Message mut -> Maybe (Ptr mut) -> m (ListOf mut (Struct mut))
forall (mut :: Mutability) a (m :: * -> *).
(FromPtr mut a, ReadCtx m mut) =>
Message mut -> Maybe (Ptr mut) -> m a
Classes.fromPtr Message mut
msg Maybe (Ptr mut)
ptr))
    toUntypedList :: List mut (Payload mut) -> List mut
toUntypedList (Payload'List_ l) = (ListOf mut (Struct mut) -> List mut
forall (mut :: Mutability). ListOf mut (Struct mut) -> List mut
Untyped.ListStruct ListOf mut (Struct mut)
l)
    length :: List mut (Payload mut) -> Int
length (Payload'List_ l) = (ListOf mut (Struct mut) -> Int
forall (msg :: Mutability) a. ListOf msg a -> Int
Untyped.length ListOf mut (Struct mut)
l)
    index :: Int -> List mut (Payload mut) -> m (Payload mut)
index Int
i (Payload'List_ l) = (do
        Struct mut
elt <- (Int -> ListOf mut (Struct mut) -> m (Struct mut)
forall (m :: * -> *) (mut :: Mutability) a.
ReadCtx m mut =>
Int -> ListOf mut a -> m a
Untyped.index Int
i ListOf mut (Struct mut)
l)
        (Struct mut -> m (Payload mut)
forall (mut :: Mutability) a (m :: * -> *).
(FromStruct mut a, ReadCtx m mut) =>
Struct mut -> m a
Classes.fromStruct Struct mut
elt)
        )
instance (Basics.MutListElem s (Payload (Message.Mut s))) where
    setIndex :: Payload ('Mut s) -> Int -> List ('Mut s) (Payload ('Mut s)) -> m ()
setIndex (Payload'newtype_ Struct ('Mut s)
elt) Int
i (Payload'List_ l) = (Struct ('Mut s) -> Int -> ListOf ('Mut s) (Struct ('Mut s)) -> m ()
forall (m :: * -> *) s a.
RWCtx m s =>
a -> Int -> ListOf ('Mut s) a -> m ()
Untyped.setIndex Struct ('Mut s)
elt Int
i ListOf ('Mut s) (Struct ('Mut s))
l)
    newList :: Message ('Mut s) -> Int -> m (List ('Mut s) (Payload ('Mut s)))
newList Message ('Mut s)
msg Int
len = (ListOf ('Mut s) (Struct ('Mut s))
-> List ('Mut s) (Payload ('Mut s))
forall (mut :: Mutability).
ListOf mut (Struct mut) -> List mut (Payload mut)
Payload'List_ (ListOf ('Mut s) (Struct ('Mut s))
 -> List ('Mut s) (Payload ('Mut s)))
-> m (ListOf ('Mut s) (Struct ('Mut s)))
-> m (List ('Mut s) (Payload ('Mut s)))
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (Message ('Mut s)
-> Word16 -> Word16 -> Int -> m (ListOf ('Mut s) (Struct ('Mut s)))
forall (m :: * -> *) s.
WriteCtx m s =>
Message ('Mut s)
-> Word16 -> Word16 -> Int -> m (ListOf ('Mut s) (Struct ('Mut s)))
Untyped.allocCompositeList Message ('Mut s)
msg Word16
0 Word16
2 Int
len))
get_Payload'content :: ((Untyped.ReadCtx m msg)
                       ,(Classes.FromPtr msg (Std_.Maybe (Untyped.Ptr msg)))) => (Payload msg) -> (m (Std_.Maybe (Untyped.Ptr msg)))
get_Payload'content :: Payload msg -> m (Maybe (Ptr msg))
get_Payload'content (Payload'newtype_ Struct msg
struct) = (do
    Maybe (Ptr msg)
ptr <- (Int -> Struct msg -> m (Maybe (Ptr msg))
forall (m :: * -> *) (msg :: Mutability).
ReadCtx m msg =>
Int -> Struct msg -> m (Maybe (Ptr msg))
Untyped.getPtr Int
0 Struct msg
struct)
    (Message msg -> Maybe (Ptr msg) -> m (Maybe (Ptr msg))
forall (mut :: Mutability) a (m :: * -> *).
(FromPtr mut a, ReadCtx m mut) =>
Message mut -> Maybe (Ptr mut) -> m a
Classes.fromPtr (Struct msg -> Message msg
forall a (mut :: Mutability). HasMessage a mut => a -> Message mut
Untyped.message Struct msg
struct) Maybe (Ptr msg)
ptr)
    )
set_Payload'content :: ((Untyped.RWCtx m s)
                       ,(Classes.ToPtr s (Std_.Maybe (Untyped.Ptr (Message.Mut s))))) => (Payload (Message.Mut s)) -> (Std_.Maybe (Untyped.Ptr (Message.Mut s))) -> (m ())
set_Payload'content :: Payload ('Mut s) -> Maybe (Ptr ('Mut s)) -> m ()
set_Payload'content (Payload'newtype_ Struct ('Mut s)
struct) Maybe (Ptr ('Mut s))
value = (do
    Maybe (Ptr ('Mut s))
ptr <- (Message ('Mut s)
-> Maybe (Ptr ('Mut s)) -> m (Maybe (Ptr ('Mut s)))
forall s a (m :: * -> *).
(ToPtr s a, WriteCtx m s) =>
Message ('Mut s) -> a -> m (Maybe (Ptr ('Mut s)))
Classes.toPtr (Struct ('Mut s) -> Message ('Mut s)
forall a (mut :: Mutability). HasMessage a mut => a -> Message mut
Untyped.message Struct ('Mut s)
struct) Maybe (Ptr ('Mut s))
value)
    (Maybe (Ptr ('Mut s)) -> Int -> Struct ('Mut s) -> m ()
forall (m :: * -> *) s.
(ReadCtx m ('Mut s), WriteCtx m s) =>
Maybe (Ptr ('Mut s)) -> Int -> Struct ('Mut s) -> m ()
Untyped.setPtr Maybe (Ptr ('Mut s))
ptr Int
0 Struct ('Mut s)
struct)
    )
has_Payload'content :: ((Untyped.ReadCtx m msg)) => (Payload msg) -> (m Std_.Bool)
has_Payload'content :: Payload msg -> m Bool
has_Payload'content (Payload'newtype_ Struct msg
struct) = (Maybe (Ptr msg) -> Bool
forall a. Maybe a -> Bool
Std_.isJust (Maybe (Ptr msg) -> Bool) -> m (Maybe (Ptr msg)) -> m Bool
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (Int -> Struct msg -> m (Maybe (Ptr msg))
forall (m :: * -> *) (msg :: Mutability).
ReadCtx m msg =>
Int -> Struct msg -> m (Maybe (Ptr msg))
Untyped.getPtr Int
0 Struct msg
struct))
get_Payload'capTable :: ((Untyped.ReadCtx m msg)
                        ,(Classes.FromPtr msg (Basics.List msg (CapDescriptor msg)))) => (Payload msg) -> (m (Basics.List msg (CapDescriptor msg)))
get_Payload'capTable :: Payload msg -> m (List msg (CapDescriptor msg))
get_Payload'capTable (Payload'newtype_ Struct msg
struct) = (do
    Maybe (Ptr msg)
ptr <- (Int -> Struct msg -> m (Maybe (Ptr msg))
forall (m :: * -> *) (msg :: Mutability).
ReadCtx m msg =>
Int -> Struct msg -> m (Maybe (Ptr msg))
Untyped.getPtr Int
1 Struct msg
struct)
    (Message msg -> Maybe (Ptr msg) -> m (List msg (CapDescriptor msg))
forall (mut :: Mutability) a (m :: * -> *).
(FromPtr mut a, ReadCtx m mut) =>
Message mut -> Maybe (Ptr mut) -> m a
Classes.fromPtr (Struct msg -> Message msg
forall a (mut :: Mutability). HasMessage a mut => a -> Message mut
Untyped.message Struct msg
struct) Maybe (Ptr msg)
ptr)
    )
set_Payload'capTable :: ((Untyped.RWCtx m s)
                        ,(Classes.ToPtr s (Basics.List (Message.Mut s) (CapDescriptor (Message.Mut s))))) => (Payload (Message.Mut s)) -> (Basics.List (Message.Mut s) (CapDescriptor (Message.Mut s))) -> (m ())
set_Payload'capTable :: Payload ('Mut s) -> List ('Mut s) (CapDescriptor ('Mut s)) -> m ()
set_Payload'capTable (Payload'newtype_ Struct ('Mut s)
struct) List ('Mut s) (CapDescriptor ('Mut s))
value = (do
    Maybe (Ptr ('Mut s))
ptr <- (Message ('Mut s)
-> List ('Mut s) (CapDescriptor ('Mut s))
-> m (Maybe (Ptr ('Mut s)))
forall s a (m :: * -> *).
(ToPtr s a, WriteCtx m s) =>
Message ('Mut s) -> a -> m (Maybe (Ptr ('Mut s)))
Classes.toPtr (Struct ('Mut s) -> Message ('Mut s)
forall a (mut :: Mutability). HasMessage a mut => a -> Message mut
Untyped.message Struct ('Mut s)
struct) List ('Mut s) (CapDescriptor ('Mut s))
value)
    (Maybe (Ptr ('Mut s)) -> Int -> Struct ('Mut s) -> m ()
forall (m :: * -> *) s.
(ReadCtx m ('Mut s), WriteCtx m s) =>
Maybe (Ptr ('Mut s)) -> Int -> Struct ('Mut s) -> m ()
Untyped.setPtr Maybe (Ptr ('Mut s))
ptr Int
1 Struct ('Mut s)
struct)
    )
has_Payload'capTable :: ((Untyped.ReadCtx m msg)) => (Payload msg) -> (m Std_.Bool)
has_Payload'capTable :: Payload msg -> m Bool
has_Payload'capTable (Payload'newtype_ Struct msg
struct) = (Maybe (Ptr msg) -> Bool
forall a. Maybe a -> Bool
Std_.isJust (Maybe (Ptr msg) -> Bool) -> m (Maybe (Ptr msg)) -> m Bool
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (Int -> Struct msg -> m (Maybe (Ptr msg))
forall (m :: * -> *) (msg :: Mutability).
ReadCtx m msg =>
Int -> Struct msg -> m (Maybe (Ptr msg))
Untyped.getPtr Int
1 Struct msg
struct))
new_Payload'capTable :: ((Untyped.RWCtx m s)) => Std_.Int -> (Payload (Message.Mut s)) -> (m (Basics.List (Message.Mut s) (CapDescriptor (Message.Mut s))))
new_Payload'capTable :: Int
-> Payload ('Mut s) -> m (List ('Mut s) (CapDescriptor ('Mut s)))
new_Payload'capTable Int
len Payload ('Mut s)
struct = (do
    List ('Mut s) (CapDescriptor ('Mut s))
result <- (Message ('Mut s)
-> Int -> m (List ('Mut s) (CapDescriptor ('Mut s)))
forall s e (m :: * -> *).
(MutListElem s e, WriteCtx m s) =>
Message ('Mut s) -> Int -> m (List ('Mut s) e)
Classes.newList (Payload ('Mut s) -> Message ('Mut s)
forall a (mut :: Mutability). HasMessage a mut => a -> Message mut
Untyped.message Payload ('Mut s)
struct) Int
len)
    (Payload ('Mut s) -> List ('Mut s) (CapDescriptor ('Mut s)) -> m ()
forall (m :: * -> *) s.
(RWCtx m s, ToPtr s (List ('Mut s) (CapDescriptor ('Mut s)))) =>
Payload ('Mut s) -> List ('Mut s) (CapDescriptor ('Mut s)) -> m ()
set_Payload'capTable Payload ('Mut s)
struct List ('Mut s) (CapDescriptor ('Mut s))
result)
    (List ('Mut s) (CapDescriptor ('Mut s))
-> m (List ('Mut s) (CapDescriptor ('Mut s)))
forall (f :: * -> *) a. Applicative f => a -> f a
Std_.pure List ('Mut s) (CapDescriptor ('Mut s))
result)
    )
newtype CapDescriptor msg
    = CapDescriptor'newtype_ (Untyped.Struct msg)
instance (Classes.FromStruct msg (CapDescriptor msg)) where
    fromStruct :: Struct msg -> m (CapDescriptor msg)
fromStruct Struct msg
struct = (CapDescriptor msg -> m (CapDescriptor msg)
forall (f :: * -> *) a. Applicative f => a -> f a
Std_.pure (Struct msg -> CapDescriptor msg
forall (msg :: Mutability). Struct msg -> CapDescriptor msg
CapDescriptor'newtype_ Struct msg
struct))
instance (Classes.ToStruct msg (CapDescriptor msg)) where
    toStruct :: CapDescriptor msg -> Struct msg
toStruct (CapDescriptor'newtype_ Struct msg
struct) = Struct msg
struct
instance (Untyped.HasMessage (CapDescriptor mut) mut) where
    message :: CapDescriptor mut -> Message mut
message (CapDescriptor'newtype_ Struct mut
struct) = (Struct mut -> Message mut
forall a (mut :: Mutability). HasMessage a mut => a -> Message mut
Untyped.message Struct mut
struct)
instance (Untyped.MessageDefault (CapDescriptor mut) mut) where
    messageDefault :: Message mut -> m (CapDescriptor mut)
messageDefault Message mut
msg = (Struct mut -> CapDescriptor mut
forall (msg :: Mutability). Struct msg -> CapDescriptor msg
CapDescriptor'newtype_ (Struct mut -> CapDescriptor mut)
-> m (Struct mut) -> m (CapDescriptor mut)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (Message mut -> m (Struct mut)
forall a (mut :: Mutability) (m :: * -> *).
(MessageDefault a mut, ReadCtx m mut) =>
Message mut -> m a
Untyped.messageDefault Message mut
msg))
instance (Classes.FromPtr msg (CapDescriptor msg)) where
    fromPtr :: Message msg -> Maybe (Ptr msg) -> m (CapDescriptor msg)
fromPtr Message msg
msg Maybe (Ptr msg)
ptr = (Struct msg -> CapDescriptor msg
forall (msg :: Mutability). Struct msg -> CapDescriptor msg
CapDescriptor'newtype_ (Struct msg -> CapDescriptor msg)
-> m (Struct msg) -> m (CapDescriptor msg)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (Message msg -> Maybe (Ptr msg) -> m (Struct msg)
forall (mut :: Mutability) a (m :: * -> *).
(FromPtr mut a, ReadCtx m mut) =>
Message mut -> Maybe (Ptr mut) -> m a
Classes.fromPtr Message msg
msg Maybe (Ptr msg)
ptr))
instance (Classes.ToPtr s (CapDescriptor (Message.Mut s))) where
    toPtr :: Message ('Mut s)
-> CapDescriptor ('Mut s) -> m (Maybe (Ptr ('Mut s)))
toPtr Message ('Mut s)
msg (CapDescriptor'newtype_ Struct ('Mut s)
struct) = (Message ('Mut s) -> Struct ('Mut s) -> m (Maybe (Ptr ('Mut s)))
forall s a (m :: * -> *).
(ToPtr s a, WriteCtx m s) =>
Message ('Mut s) -> a -> m (Maybe (Ptr ('Mut s)))
Classes.toPtr Message ('Mut s)
msg Struct ('Mut s)
struct)
instance (Classes.Allocate s (CapDescriptor (Message.Mut s))) where
    new :: Message ('Mut s) -> m (CapDescriptor ('Mut s))
new Message ('Mut s)
msg = (Struct ('Mut s) -> CapDescriptor ('Mut s)
forall (msg :: Mutability). Struct msg -> CapDescriptor msg
CapDescriptor'newtype_ (Struct ('Mut s) -> CapDescriptor ('Mut s))
-> m (Struct ('Mut s)) -> m (CapDescriptor ('Mut s))
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (Message ('Mut s) -> Word16 -> Word16 -> m (Struct ('Mut s))
forall (m :: * -> *) s.
WriteCtx m s =>
Message ('Mut s) -> Word16 -> Word16 -> m (Struct ('Mut s))
Untyped.allocStruct Message ('Mut s)
msg Word16
1 Word16
1))
instance (Basics.ListElem mut (CapDescriptor mut)) where
    newtype List mut (CapDescriptor mut)
        = CapDescriptor'List_ (Untyped.ListOf mut (Untyped.Struct mut))
    listFromPtr :: Message mut -> Maybe (Ptr mut) -> m (List mut (CapDescriptor mut))
listFromPtr Message mut
msg Maybe (Ptr mut)
ptr = (ListOf mut (Struct mut) -> List mut (CapDescriptor mut)
forall (mut :: Mutability).
ListOf mut (Struct mut) -> List mut (CapDescriptor mut)
CapDescriptor'List_ (ListOf mut (Struct mut) -> List mut (CapDescriptor mut))
-> m (ListOf mut (Struct mut)) -> m (List mut (CapDescriptor mut))
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (Message mut -> Maybe (Ptr mut) -> m (ListOf mut (Struct mut))
forall (mut :: Mutability) a (m :: * -> *).
(FromPtr mut a, ReadCtx m mut) =>
Message mut -> Maybe (Ptr mut) -> m a
Classes.fromPtr Message mut
msg Maybe (Ptr mut)
ptr))
    toUntypedList :: List mut (CapDescriptor mut) -> List mut
toUntypedList (CapDescriptor'List_ l) = (ListOf mut (Struct mut) -> List mut
forall (mut :: Mutability). ListOf mut (Struct mut) -> List mut
Untyped.ListStruct ListOf mut (Struct mut)
l)
    length :: List mut (CapDescriptor mut) -> Int
length (CapDescriptor'List_ l) = (ListOf mut (Struct mut) -> Int
forall (msg :: Mutability) a. ListOf msg a -> Int
Untyped.length ListOf mut (Struct mut)
l)
    index :: Int -> List mut (CapDescriptor mut) -> m (CapDescriptor mut)
index Int
i (CapDescriptor'List_ l) = (do
        Struct mut
elt <- (Int -> ListOf mut (Struct mut) -> m (Struct mut)
forall (m :: * -> *) (mut :: Mutability) a.
ReadCtx m mut =>
Int -> ListOf mut a -> m a
Untyped.index Int
i ListOf mut (Struct mut)
l)
        (Struct mut -> m (CapDescriptor mut)
forall (mut :: Mutability) a (m :: * -> *).
(FromStruct mut a, ReadCtx m mut) =>
Struct mut -> m a
Classes.fromStruct Struct mut
elt)
        )
instance (Basics.MutListElem s (CapDescriptor (Message.Mut s))) where
    setIndex :: CapDescriptor ('Mut s)
-> Int -> List ('Mut s) (CapDescriptor ('Mut s)) -> m ()
setIndex (CapDescriptor'newtype_ Struct ('Mut s)
elt) Int
i (CapDescriptor'List_ l) = (Struct ('Mut s) -> Int -> ListOf ('Mut s) (Struct ('Mut s)) -> m ()
forall (m :: * -> *) s a.
RWCtx m s =>
a -> Int -> ListOf ('Mut s) a -> m ()
Untyped.setIndex Struct ('Mut s)
elt Int
i ListOf ('Mut s) (Struct ('Mut s))
l)
    newList :: Message ('Mut s)
-> Int -> m (List ('Mut s) (CapDescriptor ('Mut s)))
newList Message ('Mut s)
msg Int
len = (ListOf ('Mut s) (Struct ('Mut s))
-> List ('Mut s) (CapDescriptor ('Mut s))
forall (mut :: Mutability).
ListOf mut (Struct mut) -> List mut (CapDescriptor mut)
CapDescriptor'List_ (ListOf ('Mut s) (Struct ('Mut s))
 -> List ('Mut s) (CapDescriptor ('Mut s)))
-> m (ListOf ('Mut s) (Struct ('Mut s)))
-> m (List ('Mut s) (CapDescriptor ('Mut s)))
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (Message ('Mut s)
-> Word16 -> Word16 -> Int -> m (ListOf ('Mut s) (Struct ('Mut s)))
forall (m :: * -> *) s.
WriteCtx m s =>
Message ('Mut s)
-> Word16 -> Word16 -> Int -> m (ListOf ('Mut s) (Struct ('Mut s)))
Untyped.allocCompositeList Message ('Mut s)
msg Word16
1 Word16
1 Int
len))
get_CapDescriptor'attachedFd :: ((Untyped.ReadCtx m msg)) => (CapDescriptor msg) -> (m Std_.Word8)
get_CapDescriptor'attachedFd :: CapDescriptor msg -> m Word8
get_CapDescriptor'attachedFd (CapDescriptor'newtype_ Struct msg
struct) = (Struct msg -> Int -> Int -> Word64 -> m Word8
forall (m :: * -> *) (mut :: Mutability) a.
(ReadCtx m mut, IsWord a) =>
Struct mut -> Int -> Int -> Word64 -> m a
GenHelpers.getWordField Struct msg
struct Int
0 Int
16 Word64
255)
set_CapDescriptor'attachedFd :: ((Untyped.RWCtx m s)) => (CapDescriptor (Message.Mut s)) -> Std_.Word8 -> (m ())
set_CapDescriptor'attachedFd :: CapDescriptor ('Mut s) -> Word8 -> m ()
set_CapDescriptor'attachedFd (CapDescriptor'newtype_ Struct ('Mut s)
struct) Word8
value = (Struct ('Mut s) -> Word8 -> Int -> Int -> Word64 -> m ()
forall (m :: * -> *) s a.
(RWCtx m s, Bounded a, Integral a, IsWord a, Bits a) =>
Struct ('Mut s) -> a -> Int -> Int -> Word64 -> m ()
GenHelpers.setWordField Struct ('Mut s)
struct ((Word64 -> Word8
forall a b. (Integral a, Num b) => a -> b
Std_.fromIntegral (Word8 -> Word64
forall a. IsWord a => a -> Word64
Classes.toWord Word8
value)) :: Std_.Word8) Int
0 Int
16 Word64
255)
data CapDescriptor' (mut :: Message.Mutability)
    = CapDescriptor'none 
    | CapDescriptor'senderHosted Std_.Word32
    | CapDescriptor'senderPromise Std_.Word32
    | CapDescriptor'receiverHosted Std_.Word32
    | CapDescriptor'receiverAnswer (PromisedAnswer mut)
    | CapDescriptor'thirdPartyHosted (ThirdPartyCapDescriptor mut)
    | CapDescriptor'unknown' Std_.Word16
instance (Classes.FromStruct mut (CapDescriptor' mut)) where
    fromStruct :: Struct mut -> m (CapDescriptor' mut)
fromStruct Struct mut
struct = (do
        Word16
tag <- (Struct mut -> Int -> m Word16
forall (m :: * -> *) (mut :: Mutability).
ReadCtx m mut =>
Struct mut -> Int -> m Word16
GenHelpers.getTag Struct mut
struct Int
0)
        case Word16
tag of
            Word16
0 ->
                (CapDescriptor' mut -> m (CapDescriptor' mut)
forall (f :: * -> *) a. Applicative f => a -> f a
Std_.pure CapDescriptor' mut
forall (mut :: Mutability). CapDescriptor' mut
CapDescriptor'none)
            Word16
1 ->
                (Word32 -> CapDescriptor' mut
forall (mut :: Mutability). Word32 -> CapDescriptor' mut
CapDescriptor'senderHosted (Word32 -> CapDescriptor' mut)
-> m Word32 -> m (CapDescriptor' mut)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (Struct mut -> Int -> Int -> Word64 -> m Word32
forall (m :: * -> *) (mut :: Mutability) a.
(ReadCtx m mut, IsWord a) =>
Struct mut -> Int -> Int -> Word64 -> m a
GenHelpers.getWordField Struct mut
struct Int
0 Int
32 Word64
0))
            Word16
2 ->
                (Word32 -> CapDescriptor' mut
forall (mut :: Mutability). Word32 -> CapDescriptor' mut
CapDescriptor'senderPromise (Word32 -> CapDescriptor' mut)
-> m Word32 -> m (CapDescriptor' mut)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (Struct mut -> Int -> Int -> Word64 -> m Word32
forall (m :: * -> *) (mut :: Mutability) a.
(ReadCtx m mut, IsWord a) =>
Struct mut -> Int -> Int -> Word64 -> m a
GenHelpers.getWordField Struct mut
struct Int
0 Int
32 Word64
0))
            Word16
3 ->
                (Word32 -> CapDescriptor' mut
forall (mut :: Mutability). Word32 -> CapDescriptor' mut
CapDescriptor'receiverHosted (Word32 -> CapDescriptor' mut)
-> m Word32 -> m (CapDescriptor' mut)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (Struct mut -> Int -> Int -> Word64 -> m Word32
forall (m :: * -> *) (mut :: Mutability) a.
(ReadCtx m mut, IsWord a) =>
Struct mut -> Int -> Int -> Word64 -> m a
GenHelpers.getWordField Struct mut
struct Int
0 Int
32 Word64
0))
            Word16
4 ->
                (PromisedAnswer mut -> CapDescriptor' mut
forall (mut :: Mutability).
PromisedAnswer mut -> CapDescriptor' mut
CapDescriptor'receiverAnswer (PromisedAnswer mut -> CapDescriptor' mut)
-> m (PromisedAnswer mut) -> m (CapDescriptor' mut)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (do
                    Maybe (Ptr mut)
ptr <- (Int -> Struct mut -> m (Maybe (Ptr mut))
forall (m :: * -> *) (msg :: Mutability).
ReadCtx m msg =>
Int -> Struct msg -> m (Maybe (Ptr msg))
Untyped.getPtr Int
0 Struct mut
struct)
                    (Message mut -> Maybe (Ptr mut) -> m (PromisedAnswer mut)
forall (mut :: Mutability) a (m :: * -> *).
(FromPtr mut a, ReadCtx m mut) =>
Message mut -> Maybe (Ptr mut) -> m a
Classes.fromPtr (Struct mut -> Message mut
forall a (mut :: Mutability). HasMessage a mut => a -> Message mut
Untyped.message Struct mut
struct) Maybe (Ptr mut)
ptr)
                    ))
            Word16
5 ->
                (ThirdPartyCapDescriptor mut -> CapDescriptor' mut
forall (mut :: Mutability).
ThirdPartyCapDescriptor mut -> CapDescriptor' mut
CapDescriptor'thirdPartyHosted (ThirdPartyCapDescriptor mut -> CapDescriptor' mut)
-> m (ThirdPartyCapDescriptor mut) -> m (CapDescriptor' mut)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (do
                    Maybe (Ptr mut)
ptr <- (Int -> Struct mut -> m (Maybe (Ptr mut))
forall (m :: * -> *) (msg :: Mutability).
ReadCtx m msg =>
Int -> Struct msg -> m (Maybe (Ptr msg))
Untyped.getPtr Int
0 Struct mut
struct)
                    (Message mut -> Maybe (Ptr mut) -> m (ThirdPartyCapDescriptor mut)
forall (mut :: Mutability) a (m :: * -> *).
(FromPtr mut a, ReadCtx m mut) =>
Message mut -> Maybe (Ptr mut) -> m a
Classes.fromPtr (Struct mut -> Message mut
forall a (mut :: Mutability). HasMessage a mut => a -> Message mut
Untyped.message Struct mut
struct) Maybe (Ptr mut)
ptr)
                    ))
            Word16
_ ->
                (CapDescriptor' mut -> m (CapDescriptor' mut)
forall (f :: * -> *) a. Applicative f => a -> f a
Std_.pure (Word16 -> CapDescriptor' mut
forall (mut :: Mutability). Word16 -> CapDescriptor' mut
CapDescriptor'unknown' (Word16 -> Word16
forall a b. (Integral a, Num b) => a -> b
Std_.fromIntegral Word16
tag)))
        )
get_CapDescriptor' :: ((Untyped.ReadCtx m msg)
                      ,(Classes.FromStruct msg (CapDescriptor' msg))) => (CapDescriptor msg) -> (m (CapDescriptor' msg))
get_CapDescriptor' :: CapDescriptor msg -> m (CapDescriptor' msg)
get_CapDescriptor' (CapDescriptor'newtype_ Struct msg
struct) = (Struct msg -> m (CapDescriptor' msg)
forall (mut :: Mutability) a (m :: * -> *).
(FromStruct mut a, ReadCtx m mut) =>
Struct mut -> m a
Classes.fromStruct Struct msg
struct)
set_CapDescriptor'none :: ((Untyped.RWCtx m s)) => (CapDescriptor (Message.Mut s)) -> (m ())
set_CapDescriptor'none :: CapDescriptor ('Mut s) -> m ()
set_CapDescriptor'none (CapDescriptor'newtype_ Struct ('Mut s)
struct) = (do
    (Struct ('Mut s) -> Word16 -> Int -> Int -> Word64 -> m ()
forall (m :: * -> *) s a.
(RWCtx m s, Bounded a, Integral a, IsWord a, Bits a) =>
Struct ('Mut s) -> a -> Int -> Int -> Word64 -> m ()
GenHelpers.setWordField Struct ('Mut s)
struct (Word16
0 :: Std_.Word16) Int
0 Int
0 Word64
0)
    (() -> m ()
forall (f :: * -> *) a. Applicative f => a -> f a
Std_.pure ())
    )
set_CapDescriptor'senderHosted :: ((Untyped.RWCtx m s)) => (CapDescriptor (Message.Mut s)) -> Std_.Word32 -> (m ())
set_CapDescriptor'senderHosted :: CapDescriptor ('Mut s) -> Word32 -> m ()
set_CapDescriptor'senderHosted (CapDescriptor'newtype_ Struct ('Mut s)
struct) Word32
value = (do
    (Struct ('Mut s) -> Word16 -> Int -> Int -> Word64 -> m ()
forall (m :: * -> *) s a.
(RWCtx m s, Bounded a, Integral a, IsWord a, Bits a) =>
Struct ('Mut s) -> a -> Int -> Int -> Word64 -> m ()
GenHelpers.setWordField Struct ('Mut s)
struct (Word16
1 :: Std_.Word16) Int
0 Int
0 Word64
0)
    (Struct ('Mut s) -> Word32 -> Int -> Int -> Word64 -> m ()
forall (m :: * -> *) s a.
(RWCtx m s, Bounded a, Integral a, IsWord a, Bits a) =>
Struct ('Mut s) -> a -> Int -> Int -> Word64 -> m ()
GenHelpers.setWordField Struct ('Mut s)
struct ((Word64 -> Word32
forall a b. (Integral a, Num b) => a -> b
Std_.fromIntegral (Word32 -> Word64
forall a. IsWord a => a -> Word64
Classes.toWord Word32
value)) :: Std_.Word32) Int
0 Int
32 Word64
0)
    )
set_CapDescriptor'senderPromise :: ((Untyped.RWCtx m s)) => (CapDescriptor (Message.Mut s)) -> Std_.Word32 -> (m ())
set_CapDescriptor'senderPromise :: CapDescriptor ('Mut s) -> Word32 -> m ()
set_CapDescriptor'senderPromise (CapDescriptor'newtype_ Struct ('Mut s)
struct) Word32
value = (do
    (Struct ('Mut s) -> Word16 -> Int -> Int -> Word64 -> m ()
forall (m :: * -> *) s a.
(RWCtx m s, Bounded a, Integral a, IsWord a, Bits a) =>
Struct ('Mut s) -> a -> Int -> Int -> Word64 -> m ()
GenHelpers.setWordField Struct ('Mut s)
struct (Word16
2 :: Std_.Word16) Int
0 Int
0 Word64
0)
    (Struct ('Mut s) -> Word32 -> Int -> Int -> Word64 -> m ()
forall (m :: * -> *) s a.
(RWCtx m s, Bounded a, Integral a, IsWord a, Bits a) =>
Struct ('Mut s) -> a -> Int -> Int -> Word64 -> m ()
GenHelpers.setWordField Struct ('Mut s)
struct ((Word64 -> Word32
forall a b. (Integral a, Num b) => a -> b
Std_.fromIntegral (Word32 -> Word64
forall a. IsWord a => a -> Word64
Classes.toWord Word32
value)) :: Std_.Word32) Int
0 Int
32 Word64
0)
    )
set_CapDescriptor'receiverHosted :: ((Untyped.RWCtx m s)) => (CapDescriptor (Message.Mut s)) -> Std_.Word32 -> (m ())
set_CapDescriptor'receiverHosted :: CapDescriptor ('Mut s) -> Word32 -> m ()
set_CapDescriptor'receiverHosted (CapDescriptor'newtype_ Struct ('Mut s)
struct) Word32
value = (do
    (Struct ('Mut s) -> Word16 -> Int -> Int -> Word64 -> m ()
forall (m :: * -> *) s a.
(RWCtx m s, Bounded a, Integral a, IsWord a, Bits a) =>
Struct ('Mut s) -> a -> Int -> Int -> Word64 -> m ()
GenHelpers.setWordField Struct ('Mut s)
struct (Word16
3 :: Std_.Word16) Int
0 Int
0 Word64
0)
    (Struct ('Mut s) -> Word32 -> Int -> Int -> Word64 -> m ()
forall (m :: * -> *) s a.
(RWCtx m s, Bounded a, Integral a, IsWord a, Bits a) =>
Struct ('Mut s) -> a -> Int -> Int -> Word64 -> m ()
GenHelpers.setWordField Struct ('Mut s)
struct ((Word64 -> Word32
forall a b. (Integral a, Num b) => a -> b
Std_.fromIntegral (Word32 -> Word64
forall a. IsWord a => a -> Word64
Classes.toWord Word32
value)) :: Std_.Word32) Int
0 Int
32 Word64
0)
    )
set_CapDescriptor'receiverAnswer :: ((Untyped.RWCtx m s)
                                    ,(Classes.ToPtr s (PromisedAnswer (Message.Mut s)))) => (CapDescriptor (Message.Mut s)) -> (PromisedAnswer (Message.Mut s)) -> (m ())
set_CapDescriptor'receiverAnswer :: CapDescriptor ('Mut s) -> PromisedAnswer ('Mut s) -> m ()
set_CapDescriptor'receiverAnswer (CapDescriptor'newtype_ Struct ('Mut s)
struct) PromisedAnswer ('Mut s)
value = (do
    (Struct ('Mut s) -> Word16 -> Int -> Int -> Word64 -> m ()
forall (m :: * -> *) s a.
(RWCtx m s, Bounded a, Integral a, IsWord a, Bits a) =>
Struct ('Mut s) -> a -> Int -> Int -> Word64 -> m ()
GenHelpers.setWordField Struct ('Mut s)
struct (Word16
4 :: Std_.Word16) Int
0 Int
0 Word64
0)
    (do
        Maybe (Ptr ('Mut s))
ptr <- (Message ('Mut s)
-> PromisedAnswer ('Mut s) -> m (Maybe (Ptr ('Mut s)))
forall s a (m :: * -> *).
(ToPtr s a, WriteCtx m s) =>
Message ('Mut s) -> a -> m (Maybe (Ptr ('Mut s)))
Classes.toPtr (Struct ('Mut s) -> Message ('Mut s)
forall a (mut :: Mutability). HasMessage a mut => a -> Message mut
Untyped.message Struct ('Mut s)
struct) PromisedAnswer ('Mut s)
value)
        (Maybe (Ptr ('Mut s)) -> Int -> Struct ('Mut s) -> m ()
forall (m :: * -> *) s.
(ReadCtx m ('Mut s), WriteCtx m s) =>
Maybe (Ptr ('Mut s)) -> Int -> Struct ('Mut s) -> m ()
Untyped.setPtr Maybe (Ptr ('Mut s))
ptr Int
0 Struct ('Mut s)
struct)
        )
    )
set_CapDescriptor'thirdPartyHosted :: ((Untyped.RWCtx m s)
                                      ,(Classes.ToPtr s (ThirdPartyCapDescriptor (Message.Mut s)))) => (CapDescriptor (Message.Mut s)) -> (ThirdPartyCapDescriptor (Message.Mut s)) -> (m ())
set_CapDescriptor'thirdPartyHosted :: CapDescriptor ('Mut s) -> ThirdPartyCapDescriptor ('Mut s) -> m ()
set_CapDescriptor'thirdPartyHosted (CapDescriptor'newtype_ Struct ('Mut s)
struct) ThirdPartyCapDescriptor ('Mut s)
value = (do
    (Struct ('Mut s) -> Word16 -> Int -> Int -> Word64 -> m ()
forall (m :: * -> *) s a.
(RWCtx m s, Bounded a, Integral a, IsWord a, Bits a) =>
Struct ('Mut s) -> a -> Int -> Int -> Word64 -> m ()
GenHelpers.setWordField Struct ('Mut s)
struct (Word16
5 :: Std_.Word16) Int
0 Int
0 Word64
0)
    (do
        Maybe (Ptr ('Mut s))
ptr <- (Message ('Mut s)
-> ThirdPartyCapDescriptor ('Mut s) -> m (Maybe (Ptr ('Mut s)))
forall s a (m :: * -> *).
(ToPtr s a, WriteCtx m s) =>
Message ('Mut s) -> a -> m (Maybe (Ptr ('Mut s)))
Classes.toPtr (Struct ('Mut s) -> Message ('Mut s)
forall a (mut :: Mutability). HasMessage a mut => a -> Message mut
Untyped.message Struct ('Mut s)
struct) ThirdPartyCapDescriptor ('Mut s)
value)
        (Maybe (Ptr ('Mut s)) -> Int -> Struct ('Mut s) -> m ()
forall (m :: * -> *) s.
(ReadCtx m ('Mut s), WriteCtx m s) =>
Maybe (Ptr ('Mut s)) -> Int -> Struct ('Mut s) -> m ()
Untyped.setPtr Maybe (Ptr ('Mut s))
ptr Int
0 Struct ('Mut s)
struct)
        )
    )
set_CapDescriptor'unknown' :: ((Untyped.RWCtx m s)) => (CapDescriptor (Message.Mut s)) -> Std_.Word16 -> (m ())
set_CapDescriptor'unknown' :: CapDescriptor ('Mut s) -> Word16 -> m ()
set_CapDescriptor'unknown' (CapDescriptor'newtype_ Struct ('Mut s)
struct) Word16
value = (Struct ('Mut s) -> Word16 -> Int -> Int -> Word64 -> m ()
forall (m :: * -> *) s a.
(RWCtx m s, Bounded a, Integral a, IsWord a, Bits a) =>
Struct ('Mut s) -> a -> Int -> Int -> Word64 -> m ()
GenHelpers.setWordField Struct ('Mut s)
struct ((Word64 -> Word16
forall a b. (Integral a, Num b) => a -> b
Std_.fromIntegral (Word16 -> Word64
forall a. IsWord a => a -> Word64
Classes.toWord Word16
value)) :: Std_.Word16) Int
0 Int
0 Word64
0)
newtype PromisedAnswer msg
    = PromisedAnswer'newtype_ (Untyped.Struct msg)
instance (Classes.FromStruct msg (PromisedAnswer msg)) where
    fromStruct :: Struct msg -> m (PromisedAnswer msg)
fromStruct Struct msg
struct = (PromisedAnswer msg -> m (PromisedAnswer msg)
forall (f :: * -> *) a. Applicative f => a -> f a
Std_.pure (Struct msg -> PromisedAnswer msg
forall (msg :: Mutability). Struct msg -> PromisedAnswer msg
PromisedAnswer'newtype_ Struct msg
struct))
instance (Classes.ToStruct msg (PromisedAnswer msg)) where
    toStruct :: PromisedAnswer msg -> Struct msg
toStruct (PromisedAnswer'newtype_ Struct msg
struct) = Struct msg
struct
instance (Untyped.HasMessage (PromisedAnswer mut) mut) where
    message :: PromisedAnswer mut -> Message mut
message (PromisedAnswer'newtype_ Struct mut
struct) = (Struct mut -> Message mut
forall a (mut :: Mutability). HasMessage a mut => a -> Message mut
Untyped.message Struct mut
struct)
instance (Untyped.MessageDefault (PromisedAnswer mut) mut) where
    messageDefault :: Message mut -> m (PromisedAnswer mut)
messageDefault Message mut
msg = (Struct mut -> PromisedAnswer mut
forall (msg :: Mutability). Struct msg -> PromisedAnswer msg
PromisedAnswer'newtype_ (Struct mut -> PromisedAnswer mut)
-> m (Struct mut) -> m (PromisedAnswer mut)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (Message mut -> m (Struct mut)
forall a (mut :: Mutability) (m :: * -> *).
(MessageDefault a mut, ReadCtx m mut) =>
Message mut -> m a
Untyped.messageDefault Message mut
msg))
instance (Classes.FromPtr msg (PromisedAnswer msg)) where
    fromPtr :: Message msg -> Maybe (Ptr msg) -> m (PromisedAnswer msg)
fromPtr Message msg
msg Maybe (Ptr msg)
ptr = (Struct msg -> PromisedAnswer msg
forall (msg :: Mutability). Struct msg -> PromisedAnswer msg
PromisedAnswer'newtype_ (Struct msg -> PromisedAnswer msg)
-> m (Struct msg) -> m (PromisedAnswer msg)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (Message msg -> Maybe (Ptr msg) -> m (Struct msg)
forall (mut :: Mutability) a (m :: * -> *).
(FromPtr mut a, ReadCtx m mut) =>
Message mut -> Maybe (Ptr mut) -> m a
Classes.fromPtr Message msg
msg Maybe (Ptr msg)
ptr))
instance (Classes.ToPtr s (PromisedAnswer (Message.Mut s))) where
    toPtr :: Message ('Mut s)
-> PromisedAnswer ('Mut s) -> m (Maybe (Ptr ('Mut s)))
toPtr Message ('Mut s)
msg (PromisedAnswer'newtype_ Struct ('Mut s)
struct) = (Message ('Mut s) -> Struct ('Mut s) -> m (Maybe (Ptr ('Mut s)))
forall s a (m :: * -> *).
(ToPtr s a, WriteCtx m s) =>
Message ('Mut s) -> a -> m (Maybe (Ptr ('Mut s)))
Classes.toPtr Message ('Mut s)
msg Struct ('Mut s)
struct)
instance (Classes.Allocate s (PromisedAnswer (Message.Mut s))) where
    new :: Message ('Mut s) -> m (PromisedAnswer ('Mut s))
new Message ('Mut s)
msg = (Struct ('Mut s) -> PromisedAnswer ('Mut s)
forall (msg :: Mutability). Struct msg -> PromisedAnswer msg
PromisedAnswer'newtype_ (Struct ('Mut s) -> PromisedAnswer ('Mut s))
-> m (Struct ('Mut s)) -> m (PromisedAnswer ('Mut s))
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (Message ('Mut s) -> Word16 -> Word16 -> m (Struct ('Mut s))
forall (m :: * -> *) s.
WriteCtx m s =>
Message ('Mut s) -> Word16 -> Word16 -> m (Struct ('Mut s))
Untyped.allocStruct Message ('Mut s)
msg Word16
1 Word16
1))
instance (Basics.ListElem mut (PromisedAnswer mut)) where
    newtype List mut (PromisedAnswer mut)
        = PromisedAnswer'List_ (Untyped.ListOf mut (Untyped.Struct mut))
    listFromPtr :: Message mut -> Maybe (Ptr mut) -> m (List mut (PromisedAnswer mut))
listFromPtr Message mut
msg Maybe (Ptr mut)
ptr = (ListOf mut (Struct mut) -> List mut (PromisedAnswer mut)
forall (mut :: Mutability).
ListOf mut (Struct mut) -> List mut (PromisedAnswer mut)
PromisedAnswer'List_ (ListOf mut (Struct mut) -> List mut (PromisedAnswer mut))
-> m (ListOf mut (Struct mut)) -> m (List mut (PromisedAnswer mut))
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (Message mut -> Maybe (Ptr mut) -> m (ListOf mut (Struct mut))
forall (mut :: Mutability) a (m :: * -> *).
(FromPtr mut a, ReadCtx m mut) =>
Message mut -> Maybe (Ptr mut) -> m a
Classes.fromPtr Message mut
msg Maybe (Ptr mut)
ptr))
    toUntypedList :: List mut (PromisedAnswer mut) -> List mut
toUntypedList (PromisedAnswer'List_ l) = (ListOf mut (Struct mut) -> List mut
forall (mut :: Mutability). ListOf mut (Struct mut) -> List mut
Untyped.ListStruct ListOf mut (Struct mut)
l)
    length :: List mut (PromisedAnswer mut) -> Int
length (PromisedAnswer'List_ l) = (ListOf mut (Struct mut) -> Int
forall (msg :: Mutability) a. ListOf msg a -> Int
Untyped.length ListOf mut (Struct mut)
l)
    index :: Int -> List mut (PromisedAnswer mut) -> m (PromisedAnswer mut)
index Int
i (PromisedAnswer'List_ l) = (do
        Struct mut
elt <- (Int -> ListOf mut (Struct mut) -> m (Struct mut)
forall (m :: * -> *) (mut :: Mutability) a.
ReadCtx m mut =>
Int -> ListOf mut a -> m a
Untyped.index Int
i ListOf mut (Struct mut)
l)
        (Struct mut -> m (PromisedAnswer mut)
forall (mut :: Mutability) a (m :: * -> *).
(FromStruct mut a, ReadCtx m mut) =>
Struct mut -> m a
Classes.fromStruct Struct mut
elt)
        )
instance (Basics.MutListElem s (PromisedAnswer (Message.Mut s))) where
    setIndex :: PromisedAnswer ('Mut s)
-> Int -> List ('Mut s) (PromisedAnswer ('Mut s)) -> m ()
setIndex (PromisedAnswer'newtype_ Struct ('Mut s)
elt) Int
i (PromisedAnswer'List_ l) = (Struct ('Mut s) -> Int -> ListOf ('Mut s) (Struct ('Mut s)) -> m ()
forall (m :: * -> *) s a.
RWCtx m s =>
a -> Int -> ListOf ('Mut s) a -> m ()
Untyped.setIndex Struct ('Mut s)
elt Int
i ListOf ('Mut s) (Struct ('Mut s))
l)
    newList :: Message ('Mut s)
-> Int -> m (List ('Mut s) (PromisedAnswer ('Mut s)))
newList Message ('Mut s)
msg Int
len = (ListOf ('Mut s) (Struct ('Mut s))
-> List ('Mut s) (PromisedAnswer ('Mut s))
forall (mut :: Mutability).
ListOf mut (Struct mut) -> List mut (PromisedAnswer mut)
PromisedAnswer'List_ (ListOf ('Mut s) (Struct ('Mut s))
 -> List ('Mut s) (PromisedAnswer ('Mut s)))
-> m (ListOf ('Mut s) (Struct ('Mut s)))
-> m (List ('Mut s) (PromisedAnswer ('Mut s)))
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (Message ('Mut s)
-> Word16 -> Word16 -> Int -> m (ListOf ('Mut s) (Struct ('Mut s)))
forall (m :: * -> *) s.
WriteCtx m s =>
Message ('Mut s)
-> Word16 -> Word16 -> Int -> m (ListOf ('Mut s) (Struct ('Mut s)))
Untyped.allocCompositeList Message ('Mut s)
msg Word16
1 Word16
1 Int
len))
get_PromisedAnswer'questionId :: ((Untyped.ReadCtx m msg)) => (PromisedAnswer msg) -> (m Std_.Word32)
get_PromisedAnswer'questionId :: PromisedAnswer msg -> m Word32
get_PromisedAnswer'questionId (PromisedAnswer'newtype_ Struct msg
struct) = (Struct msg -> Int -> Int -> Word64 -> m Word32
forall (m :: * -> *) (mut :: Mutability) a.
(ReadCtx m mut, IsWord a) =>
Struct mut -> Int -> Int -> Word64 -> m a
GenHelpers.getWordField Struct msg
struct Int
0 Int
0 Word64
0)
set_PromisedAnswer'questionId :: ((Untyped.RWCtx m s)) => (PromisedAnswer (Message.Mut s)) -> Std_.Word32 -> (m ())
set_PromisedAnswer'questionId :: PromisedAnswer ('Mut s) -> Word32 -> m ()
set_PromisedAnswer'questionId (PromisedAnswer'newtype_ Struct ('Mut s)
struct) Word32
value = (Struct ('Mut s) -> Word32 -> Int -> Int -> Word64 -> m ()
forall (m :: * -> *) s a.
(RWCtx m s, Bounded a, Integral a, IsWord a, Bits a) =>
Struct ('Mut s) -> a -> Int -> Int -> Word64 -> m ()
GenHelpers.setWordField Struct ('Mut s)
struct ((Word64 -> Word32
forall a b. (Integral a, Num b) => a -> b
Std_.fromIntegral (Word32 -> Word64
forall a. IsWord a => a -> Word64
Classes.toWord Word32
value)) :: Std_.Word32) Int
0 Int
0 Word64
0)
get_PromisedAnswer'transform :: ((Untyped.ReadCtx m msg)
                                ,(Classes.FromPtr msg (Basics.List msg (PromisedAnswer'Op msg)))) => (PromisedAnswer msg) -> (m (Basics.List msg (PromisedAnswer'Op msg)))
get_PromisedAnswer'transform :: PromisedAnswer msg -> m (List msg (PromisedAnswer'Op msg))
get_PromisedAnswer'transform (PromisedAnswer'newtype_ Struct msg
struct) = (do
    Maybe (Ptr msg)
ptr <- (Int -> Struct msg -> m (Maybe (Ptr msg))
forall (m :: * -> *) (msg :: Mutability).
ReadCtx m msg =>
Int -> Struct msg -> m (Maybe (Ptr msg))
Untyped.getPtr Int
0 Struct msg
struct)
    (Message msg
-> Maybe (Ptr msg) -> m (List msg (PromisedAnswer'Op msg))
forall (mut :: Mutability) a (m :: * -> *).
(FromPtr mut a, ReadCtx m mut) =>
Message mut -> Maybe (Ptr mut) -> m a
Classes.fromPtr (Struct msg -> Message msg
forall a (mut :: Mutability). HasMessage a mut => a -> Message mut
Untyped.message Struct msg
struct) Maybe (Ptr msg)
ptr)
    )
set_PromisedAnswer'transform :: ((Untyped.RWCtx m s)
                                ,(Classes.ToPtr s (Basics.List (Message.Mut s) (PromisedAnswer'Op (Message.Mut s))))) => (PromisedAnswer (Message.Mut s)) -> (Basics.List (Message.Mut s) (PromisedAnswer'Op (Message.Mut s))) -> (m ())
set_PromisedAnswer'transform :: PromisedAnswer ('Mut s)
-> List ('Mut s) (PromisedAnswer'Op ('Mut s)) -> m ()
set_PromisedAnswer'transform (PromisedAnswer'newtype_ Struct ('Mut s)
struct) List ('Mut s) (PromisedAnswer'Op ('Mut s))
value = (do
    Maybe (Ptr ('Mut s))
ptr <- (Message ('Mut s)
-> List ('Mut s) (PromisedAnswer'Op ('Mut s))
-> m (Maybe (Ptr ('Mut s)))
forall s a (m :: * -> *).
(ToPtr s a, WriteCtx m s) =>
Message ('Mut s) -> a -> m (Maybe (Ptr ('Mut s)))
Classes.toPtr (Struct ('Mut s) -> Message ('Mut s)
forall a (mut :: Mutability). HasMessage a mut => a -> Message mut
Untyped.message Struct ('Mut s)
struct) List ('Mut s) (PromisedAnswer'Op ('Mut s))
value)
    (Maybe (Ptr ('Mut s)) -> Int -> Struct ('Mut s) -> m ()
forall (m :: * -> *) s.
(ReadCtx m ('Mut s), WriteCtx m s) =>
Maybe (Ptr ('Mut s)) -> Int -> Struct ('Mut s) -> m ()
Untyped.setPtr Maybe (Ptr ('Mut s))
ptr Int
0 Struct ('Mut s)
struct)
    )
has_PromisedAnswer'transform :: ((Untyped.ReadCtx m msg)) => (PromisedAnswer msg) -> (m Std_.Bool)
has_PromisedAnswer'transform :: PromisedAnswer msg -> m Bool
has_PromisedAnswer'transform (PromisedAnswer'newtype_ Struct msg
struct) = (Maybe (Ptr msg) -> Bool
forall a. Maybe a -> Bool
Std_.isJust (Maybe (Ptr msg) -> Bool) -> m (Maybe (Ptr msg)) -> m Bool
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (Int -> Struct msg -> m (Maybe (Ptr msg))
forall (m :: * -> *) (msg :: Mutability).
ReadCtx m msg =>
Int -> Struct msg -> m (Maybe (Ptr msg))
Untyped.getPtr Int
0 Struct msg
struct))
new_PromisedAnswer'transform :: ((Untyped.RWCtx m s)) => Std_.Int -> (PromisedAnswer (Message.Mut s)) -> (m (Basics.List (Message.Mut s) (PromisedAnswer'Op (Message.Mut s))))
new_PromisedAnswer'transform :: Int
-> PromisedAnswer ('Mut s)
-> m (List ('Mut s) (PromisedAnswer'Op ('Mut s)))
new_PromisedAnswer'transform Int
len PromisedAnswer ('Mut s)
struct = (do
    List ('Mut s) (PromisedAnswer'Op ('Mut s))
result <- (Message ('Mut s)
-> Int -> m (List ('Mut s) (PromisedAnswer'Op ('Mut s)))
forall s e (m :: * -> *).
(MutListElem s e, WriteCtx m s) =>
Message ('Mut s) -> Int -> m (List ('Mut s) e)
Classes.newList (PromisedAnswer ('Mut s) -> Message ('Mut s)
forall a (mut :: Mutability). HasMessage a mut => a -> Message mut
Untyped.message PromisedAnswer ('Mut s)
struct) Int
len)
    (PromisedAnswer ('Mut s)
-> List ('Mut s) (PromisedAnswer'Op ('Mut s)) -> m ()
forall (m :: * -> *) s.
(RWCtx m s,
 ToPtr s (List ('Mut s) (PromisedAnswer'Op ('Mut s)))) =>
PromisedAnswer ('Mut s)
-> List ('Mut s) (PromisedAnswer'Op ('Mut s)) -> m ()
set_PromisedAnswer'transform PromisedAnswer ('Mut s)
struct List ('Mut s) (PromisedAnswer'Op ('Mut s))
result)
    (List ('Mut s) (PromisedAnswer'Op ('Mut s))
-> m (List ('Mut s) (PromisedAnswer'Op ('Mut s)))
forall (f :: * -> *) a. Applicative f => a -> f a
Std_.pure List ('Mut s) (PromisedAnswer'Op ('Mut s))
result)
    )
newtype PromisedAnswer'Op msg
    = PromisedAnswer'Op'newtype_ (Untyped.Struct msg)
instance (Classes.FromStruct msg (PromisedAnswer'Op msg)) where
    fromStruct :: Struct msg -> m (PromisedAnswer'Op msg)
fromStruct Struct msg
struct = (PromisedAnswer'Op msg -> m (PromisedAnswer'Op msg)
forall (f :: * -> *) a. Applicative f => a -> f a
Std_.pure (Struct msg -> PromisedAnswer'Op msg
forall (msg :: Mutability). Struct msg -> PromisedAnswer'Op msg
PromisedAnswer'Op'newtype_ Struct msg
struct))
instance (Classes.ToStruct msg (PromisedAnswer'Op msg)) where
    toStruct :: PromisedAnswer'Op msg -> Struct msg
toStruct (PromisedAnswer'Op'newtype_ Struct msg
struct) = Struct msg
struct
instance (Untyped.HasMessage (PromisedAnswer'Op mut) mut) where
    message :: PromisedAnswer'Op mut -> Message mut
message (PromisedAnswer'Op'newtype_ Struct mut
struct) = (Struct mut -> Message mut
forall a (mut :: Mutability). HasMessage a mut => a -> Message mut
Untyped.message Struct mut
struct)
instance (Untyped.MessageDefault (PromisedAnswer'Op mut) mut) where
    messageDefault :: Message mut -> m (PromisedAnswer'Op mut)
messageDefault Message mut
msg = (Struct mut -> PromisedAnswer'Op mut
forall (msg :: Mutability). Struct msg -> PromisedAnswer'Op msg
PromisedAnswer'Op'newtype_ (Struct mut -> PromisedAnswer'Op mut)
-> m (Struct mut) -> m (PromisedAnswer'Op mut)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (Message mut -> m (Struct mut)
forall a (mut :: Mutability) (m :: * -> *).
(MessageDefault a mut, ReadCtx m mut) =>
Message mut -> m a
Untyped.messageDefault Message mut
msg))
instance (Classes.FromPtr msg (PromisedAnswer'Op msg)) where
    fromPtr :: Message msg -> Maybe (Ptr msg) -> m (PromisedAnswer'Op msg)
fromPtr Message msg
msg Maybe (Ptr msg)
ptr = (Struct msg -> PromisedAnswer'Op msg
forall (msg :: Mutability). Struct msg -> PromisedAnswer'Op msg
PromisedAnswer'Op'newtype_ (Struct msg -> PromisedAnswer'Op msg)
-> m (Struct msg) -> m (PromisedAnswer'Op msg)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (Message msg -> Maybe (Ptr msg) -> m (Struct msg)
forall (mut :: Mutability) a (m :: * -> *).
(FromPtr mut a, ReadCtx m mut) =>
Message mut -> Maybe (Ptr mut) -> m a
Classes.fromPtr Message msg
msg Maybe (Ptr msg)
ptr))
instance (Classes.ToPtr s (PromisedAnswer'Op (Message.Mut s))) where
    toPtr :: Message ('Mut s)
-> PromisedAnswer'Op ('Mut s) -> m (Maybe (Ptr ('Mut s)))
toPtr Message ('Mut s)
msg (PromisedAnswer'Op'newtype_ Struct ('Mut s)
struct) = (Message ('Mut s) -> Struct ('Mut s) -> m (Maybe (Ptr ('Mut s)))
forall s a (m :: * -> *).
(ToPtr s a, WriteCtx m s) =>
Message ('Mut s) -> a -> m (Maybe (Ptr ('Mut s)))
Classes.toPtr Message ('Mut s)
msg Struct ('Mut s)
struct)
instance (Classes.Allocate s (PromisedAnswer'Op (Message.Mut s))) where
    new :: Message ('Mut s) -> m (PromisedAnswer'Op ('Mut s))
new Message ('Mut s)
msg = (Struct ('Mut s) -> PromisedAnswer'Op ('Mut s)
forall (msg :: Mutability). Struct msg -> PromisedAnswer'Op msg
PromisedAnswer'Op'newtype_ (Struct ('Mut s) -> PromisedAnswer'Op ('Mut s))
-> m (Struct ('Mut s)) -> m (PromisedAnswer'Op ('Mut s))
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (Message ('Mut s) -> Word16 -> Word16 -> m (Struct ('Mut s))
forall (m :: * -> *) s.
WriteCtx m s =>
Message ('Mut s) -> Word16 -> Word16 -> m (Struct ('Mut s))
Untyped.allocStruct Message ('Mut s)
msg Word16
1 Word16
0))
instance (Basics.ListElem mut (PromisedAnswer'Op mut)) where
    newtype List mut (PromisedAnswer'Op mut)
        = PromisedAnswer'Op'List_ (Untyped.ListOf mut (Untyped.Struct mut))
    listFromPtr :: Message mut
-> Maybe (Ptr mut) -> m (List mut (PromisedAnswer'Op mut))
listFromPtr Message mut
msg Maybe (Ptr mut)
ptr = (ListOf mut (Struct mut) -> List mut (PromisedAnswer'Op mut)
forall (mut :: Mutability).
ListOf mut (Struct mut) -> List mut (PromisedAnswer'Op mut)
PromisedAnswer'Op'List_ (ListOf mut (Struct mut) -> List mut (PromisedAnswer'Op mut))
-> m (ListOf mut (Struct mut))
-> m (List mut (PromisedAnswer'Op mut))
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (Message mut -> Maybe (Ptr mut) -> m (ListOf mut (Struct mut))
forall (mut :: Mutability) a (m :: * -> *).
(FromPtr mut a, ReadCtx m mut) =>
Message mut -> Maybe (Ptr mut) -> m a
Classes.fromPtr Message mut
msg Maybe (Ptr mut)
ptr))
    toUntypedList :: List mut (PromisedAnswer'Op mut) -> List mut
toUntypedList (PromisedAnswer'Op'List_ l) = (ListOf mut (Struct mut) -> List mut
forall (mut :: Mutability). ListOf mut (Struct mut) -> List mut
Untyped.ListStruct ListOf mut (Struct mut)
l)
    length :: List mut (PromisedAnswer'Op mut) -> Int
length (PromisedAnswer'Op'List_ l) = (ListOf mut (Struct mut) -> Int
forall (msg :: Mutability) a. ListOf msg a -> Int
Untyped.length ListOf mut (Struct mut)
l)
    index :: Int
-> List mut (PromisedAnswer'Op mut) -> m (PromisedAnswer'Op mut)
index Int
i (PromisedAnswer'Op'List_ l) = (do
        Struct mut
elt <- (Int -> ListOf mut (Struct mut) -> m (Struct mut)
forall (m :: * -> *) (mut :: Mutability) a.
ReadCtx m mut =>
Int -> ListOf mut a -> m a
Untyped.index Int
i ListOf mut (Struct mut)
l)
        (Struct mut -> m (PromisedAnswer'Op mut)
forall (mut :: Mutability) a (m :: * -> *).
(FromStruct mut a, ReadCtx m mut) =>
Struct mut -> m a
Classes.fromStruct Struct mut
elt)
        )
instance (Basics.MutListElem s (PromisedAnswer'Op (Message.Mut s))) where
    setIndex :: PromisedAnswer'Op ('Mut s)
-> Int -> List ('Mut s) (PromisedAnswer'Op ('Mut s)) -> m ()
setIndex (PromisedAnswer'Op'newtype_ Struct ('Mut s)
elt) Int
i (PromisedAnswer'Op'List_ l) = (Struct ('Mut s) -> Int -> ListOf ('Mut s) (Struct ('Mut s)) -> m ()
forall (m :: * -> *) s a.
RWCtx m s =>
a -> Int -> ListOf ('Mut s) a -> m ()
Untyped.setIndex Struct ('Mut s)
elt Int
i ListOf ('Mut s) (Struct ('Mut s))
l)
    newList :: Message ('Mut s)
-> Int -> m (List ('Mut s) (PromisedAnswer'Op ('Mut s)))
newList Message ('Mut s)
msg Int
len = (ListOf ('Mut s) (Struct ('Mut s))
-> List ('Mut s) (PromisedAnswer'Op ('Mut s))
forall (mut :: Mutability).
ListOf mut (Struct mut) -> List mut (PromisedAnswer'Op mut)
PromisedAnswer'Op'List_ (ListOf ('Mut s) (Struct ('Mut s))
 -> List ('Mut s) (PromisedAnswer'Op ('Mut s)))
-> m (ListOf ('Mut s) (Struct ('Mut s)))
-> m (List ('Mut s) (PromisedAnswer'Op ('Mut s)))
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (Message ('Mut s)
-> Word16 -> Word16 -> Int -> m (ListOf ('Mut s) (Struct ('Mut s)))
forall (m :: * -> *) s.
WriteCtx m s =>
Message ('Mut s)
-> Word16 -> Word16 -> Int -> m (ListOf ('Mut s) (Struct ('Mut s)))
Untyped.allocCompositeList Message ('Mut s)
msg Word16
1 Word16
0 Int
len))
data PromisedAnswer'Op' (mut :: Message.Mutability)
    = PromisedAnswer'Op'noop 
    | PromisedAnswer'Op'getPointerField Std_.Word16
    | PromisedAnswer'Op'unknown' Std_.Word16
instance (Classes.FromStruct mut (PromisedAnswer'Op' mut)) where
    fromStruct :: Struct mut -> m (PromisedAnswer'Op' mut)
fromStruct Struct mut
struct = (do
        Word16
tag <- (Struct mut -> Int -> m Word16
forall (m :: * -> *) (mut :: Mutability).
ReadCtx m mut =>
Struct mut -> Int -> m Word16
GenHelpers.getTag Struct mut
struct Int
0)
        case Word16
tag of
            Word16
0 ->
                (PromisedAnswer'Op' mut -> m (PromisedAnswer'Op' mut)
forall (f :: * -> *) a. Applicative f => a -> f a
Std_.pure PromisedAnswer'Op' mut
forall (mut :: Mutability). PromisedAnswer'Op' mut
PromisedAnswer'Op'noop)
            Word16
1 ->
                (Word16 -> PromisedAnswer'Op' mut
forall (mut :: Mutability). Word16 -> PromisedAnswer'Op' mut
PromisedAnswer'Op'getPointerField (Word16 -> PromisedAnswer'Op' mut)
-> m Word16 -> m (PromisedAnswer'Op' mut)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (Struct mut -> Int -> Int -> Word64 -> m Word16
forall (m :: * -> *) (mut :: Mutability) a.
(ReadCtx m mut, IsWord a) =>
Struct mut -> Int -> Int -> Word64 -> m a
GenHelpers.getWordField Struct mut
struct Int
0 Int
16 Word64
0))
            Word16
_ ->
                (PromisedAnswer'Op' mut -> m (PromisedAnswer'Op' mut)
forall (f :: * -> *) a. Applicative f => a -> f a
Std_.pure (Word16 -> PromisedAnswer'Op' mut
forall (mut :: Mutability). Word16 -> PromisedAnswer'Op' mut
PromisedAnswer'Op'unknown' (Word16 -> Word16
forall a b. (Integral a, Num b) => a -> b
Std_.fromIntegral Word16
tag)))
        )
get_PromisedAnswer'Op' :: ((Untyped.ReadCtx m msg)
                          ,(Classes.FromStruct msg (PromisedAnswer'Op' msg))) => (PromisedAnswer'Op msg) -> (m (PromisedAnswer'Op' msg))
get_PromisedAnswer'Op' :: PromisedAnswer'Op msg -> m (PromisedAnswer'Op' msg)
get_PromisedAnswer'Op' (PromisedAnswer'Op'newtype_ Struct msg
struct) = (Struct msg -> m (PromisedAnswer'Op' msg)
forall (mut :: Mutability) a (m :: * -> *).
(FromStruct mut a, ReadCtx m mut) =>
Struct mut -> m a
Classes.fromStruct Struct msg
struct)
set_PromisedAnswer'Op'noop :: ((Untyped.RWCtx m s)) => (PromisedAnswer'Op (Message.Mut s)) -> (m ())
set_PromisedAnswer'Op'noop :: PromisedAnswer'Op ('Mut s) -> m ()
set_PromisedAnswer'Op'noop (PromisedAnswer'Op'newtype_ Struct ('Mut s)
struct) = (do
    (Struct ('Mut s) -> Word16 -> Int -> Int -> Word64 -> m ()
forall (m :: * -> *) s a.
(RWCtx m s, Bounded a, Integral a, IsWord a, Bits a) =>
Struct ('Mut s) -> a -> Int -> Int -> Word64 -> m ()
GenHelpers.setWordField Struct ('Mut s)
struct (Word16
0 :: Std_.Word16) Int
0 Int
0 Word64
0)
    (() -> m ()
forall (f :: * -> *) a. Applicative f => a -> f a
Std_.pure ())
    )
set_PromisedAnswer'Op'getPointerField :: ((Untyped.RWCtx m s)) => (PromisedAnswer'Op (Message.Mut s)) -> Std_.Word16 -> (m ())
set_PromisedAnswer'Op'getPointerField :: PromisedAnswer'Op ('Mut s) -> Word16 -> m ()
set_PromisedAnswer'Op'getPointerField (PromisedAnswer'Op'newtype_ Struct ('Mut s)
struct) Word16
value = (do
    (Struct ('Mut s) -> Word16 -> Int -> Int -> Word64 -> m ()
forall (m :: * -> *) s a.
(RWCtx m s, Bounded a, Integral a, IsWord a, Bits a) =>
Struct ('Mut s) -> a -> Int -> Int -> Word64 -> m ()
GenHelpers.setWordField Struct ('Mut s)
struct (Word16
1 :: Std_.Word16) Int
0 Int
0 Word64
0)
    (Struct ('Mut s) -> Word16 -> Int -> Int -> Word64 -> m ()
forall (m :: * -> *) s a.
(RWCtx m s, Bounded a, Integral a, IsWord a, Bits a) =>
Struct ('Mut s) -> a -> Int -> Int -> Word64 -> m ()
GenHelpers.setWordField Struct ('Mut s)
struct ((Word64 -> Word16
forall a b. (Integral a, Num b) => a -> b
Std_.fromIntegral (Word16 -> Word64
forall a. IsWord a => a -> Word64
Classes.toWord Word16
value)) :: Std_.Word16) Int
0 Int
16 Word64
0)
    )
set_PromisedAnswer'Op'unknown' :: ((Untyped.RWCtx m s)) => (PromisedAnswer'Op (Message.Mut s)) -> Std_.Word16 -> (m ())
set_PromisedAnswer'Op'unknown' :: PromisedAnswer'Op ('Mut s) -> Word16 -> m ()
set_PromisedAnswer'Op'unknown' (PromisedAnswer'Op'newtype_ Struct ('Mut s)
struct) Word16
value = (Struct ('Mut s) -> Word16 -> Int -> Int -> Word64 -> m ()
forall (m :: * -> *) s a.
(RWCtx m s, Bounded a, Integral a, IsWord a, Bits a) =>
Struct ('Mut s) -> a -> Int -> Int -> Word64 -> m ()
GenHelpers.setWordField Struct ('Mut s)
struct ((Word64 -> Word16
forall a b. (Integral a, Num b) => a -> b
Std_.fromIntegral (Word16 -> Word64
forall a. IsWord a => a -> Word64
Classes.toWord Word16
value)) :: Std_.Word16) Int
0 Int
0 Word64
0)
newtype ThirdPartyCapDescriptor msg
    = ThirdPartyCapDescriptor'newtype_ (Untyped.Struct msg)
instance (Classes.FromStruct msg (ThirdPartyCapDescriptor msg)) where
    fromStruct :: Struct msg -> m (ThirdPartyCapDescriptor msg)
fromStruct Struct msg
struct = (ThirdPartyCapDescriptor msg -> m (ThirdPartyCapDescriptor msg)
forall (f :: * -> *) a. Applicative f => a -> f a
Std_.pure (Struct msg -> ThirdPartyCapDescriptor msg
forall (msg :: Mutability).
Struct msg -> ThirdPartyCapDescriptor msg
ThirdPartyCapDescriptor'newtype_ Struct msg
struct))
instance (Classes.ToStruct msg (ThirdPartyCapDescriptor msg)) where
    toStruct :: ThirdPartyCapDescriptor msg -> Struct msg
toStruct (ThirdPartyCapDescriptor'newtype_ Struct msg
struct) = Struct msg
struct
instance (Untyped.HasMessage (ThirdPartyCapDescriptor mut) mut) where
    message :: ThirdPartyCapDescriptor mut -> Message mut
message (ThirdPartyCapDescriptor'newtype_ Struct mut
struct) = (Struct mut -> Message mut
forall a (mut :: Mutability). HasMessage a mut => a -> Message mut
Untyped.message Struct mut
struct)
instance (Untyped.MessageDefault (ThirdPartyCapDescriptor mut) mut) where
    messageDefault :: Message mut -> m (ThirdPartyCapDescriptor mut)
messageDefault Message mut
msg = (Struct mut -> ThirdPartyCapDescriptor mut
forall (msg :: Mutability).
Struct msg -> ThirdPartyCapDescriptor msg
ThirdPartyCapDescriptor'newtype_ (Struct mut -> ThirdPartyCapDescriptor mut)
-> m (Struct mut) -> m (ThirdPartyCapDescriptor mut)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (Message mut -> m (Struct mut)
forall a (mut :: Mutability) (m :: * -> *).
(MessageDefault a mut, ReadCtx m mut) =>
Message mut -> m a
Untyped.messageDefault Message mut
msg))
instance (Classes.FromPtr msg (ThirdPartyCapDescriptor msg)) where
    fromPtr :: Message msg -> Maybe (Ptr msg) -> m (ThirdPartyCapDescriptor msg)
fromPtr Message msg
msg Maybe (Ptr msg)
ptr = (Struct msg -> ThirdPartyCapDescriptor msg
forall (msg :: Mutability).
Struct msg -> ThirdPartyCapDescriptor msg
ThirdPartyCapDescriptor'newtype_ (Struct msg -> ThirdPartyCapDescriptor msg)
-> m (Struct msg) -> m (ThirdPartyCapDescriptor msg)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (Message msg -> Maybe (Ptr msg) -> m (Struct msg)
forall (mut :: Mutability) a (m :: * -> *).
(FromPtr mut a, ReadCtx m mut) =>
Message mut -> Maybe (Ptr mut) -> m a
Classes.fromPtr Message msg
msg Maybe (Ptr msg)
ptr))
instance (Classes.ToPtr s (ThirdPartyCapDescriptor (Message.Mut s))) where
    toPtr :: Message ('Mut s)
-> ThirdPartyCapDescriptor ('Mut s) -> m (Maybe (Ptr ('Mut s)))
toPtr Message ('Mut s)
msg (ThirdPartyCapDescriptor'newtype_ Struct ('Mut s)
struct) = (Message ('Mut s) -> Struct ('Mut s) -> m (Maybe (Ptr ('Mut s)))
forall s a (m :: * -> *).
(ToPtr s a, WriteCtx m s) =>
Message ('Mut s) -> a -> m (Maybe (Ptr ('Mut s)))
Classes.toPtr Message ('Mut s)
msg Struct ('Mut s)
struct)
instance (Classes.Allocate s (ThirdPartyCapDescriptor (Message.Mut s))) where
    new :: Message ('Mut s) -> m (ThirdPartyCapDescriptor ('Mut s))
new Message ('Mut s)
msg = (Struct ('Mut s) -> ThirdPartyCapDescriptor ('Mut s)
forall (msg :: Mutability).
Struct msg -> ThirdPartyCapDescriptor msg
ThirdPartyCapDescriptor'newtype_ (Struct ('Mut s) -> ThirdPartyCapDescriptor ('Mut s))
-> m (Struct ('Mut s)) -> m (ThirdPartyCapDescriptor ('Mut s))
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (Message ('Mut s) -> Word16 -> Word16 -> m (Struct ('Mut s))
forall (m :: * -> *) s.
WriteCtx m s =>
Message ('Mut s) -> Word16 -> Word16 -> m (Struct ('Mut s))
Untyped.allocStruct Message ('Mut s)
msg Word16
1 Word16
1))
instance (Basics.ListElem mut (ThirdPartyCapDescriptor mut)) where
    newtype List mut (ThirdPartyCapDescriptor mut)
        = ThirdPartyCapDescriptor'List_ (Untyped.ListOf mut (Untyped.Struct mut))
    listFromPtr :: Message mut
-> Maybe (Ptr mut) -> m (List mut (ThirdPartyCapDescriptor mut))
listFromPtr Message mut
msg Maybe (Ptr mut)
ptr = (ListOf mut (Struct mut) -> List mut (ThirdPartyCapDescriptor mut)
forall (mut :: Mutability).
ListOf mut (Struct mut) -> List mut (ThirdPartyCapDescriptor mut)
ThirdPartyCapDescriptor'List_ (ListOf mut (Struct mut) -> List mut (ThirdPartyCapDescriptor mut))
-> m (ListOf mut (Struct mut))
-> m (List mut (ThirdPartyCapDescriptor mut))
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (Message mut -> Maybe (Ptr mut) -> m (ListOf mut (Struct mut))
forall (mut :: Mutability) a (m :: * -> *).
(FromPtr mut a, ReadCtx m mut) =>
Message mut -> Maybe (Ptr mut) -> m a
Classes.fromPtr Message mut
msg Maybe (Ptr mut)
ptr))
    toUntypedList :: List mut (ThirdPartyCapDescriptor mut) -> List mut
toUntypedList (ThirdPartyCapDescriptor'List_ l) = (ListOf mut (Struct mut) -> List mut
forall (mut :: Mutability). ListOf mut (Struct mut) -> List mut
Untyped.ListStruct ListOf mut (Struct mut)
l)
    length :: List mut (ThirdPartyCapDescriptor mut) -> Int
length (ThirdPartyCapDescriptor'List_ l) = (ListOf mut (Struct mut) -> Int
forall (msg :: Mutability) a. ListOf msg a -> Int
Untyped.length ListOf mut (Struct mut)
l)
    index :: Int
-> List mut (ThirdPartyCapDescriptor mut)
-> m (ThirdPartyCapDescriptor mut)
index Int
i (ThirdPartyCapDescriptor'List_ l) = (do
        Struct mut
elt <- (Int -> ListOf mut (Struct mut) -> m (Struct mut)
forall (m :: * -> *) (mut :: Mutability) a.
ReadCtx m mut =>
Int -> ListOf mut a -> m a
Untyped.index Int
i ListOf mut (Struct mut)
l)
        (Struct mut -> m (ThirdPartyCapDescriptor mut)
forall (mut :: Mutability) a (m :: * -> *).
(FromStruct mut a, ReadCtx m mut) =>
Struct mut -> m a
Classes.fromStruct Struct mut
elt)
        )
instance (Basics.MutListElem s (ThirdPartyCapDescriptor (Message.Mut s))) where
    setIndex :: ThirdPartyCapDescriptor ('Mut s)
-> Int -> List ('Mut s) (ThirdPartyCapDescriptor ('Mut s)) -> m ()
setIndex (ThirdPartyCapDescriptor'newtype_ Struct ('Mut s)
elt) Int
i (ThirdPartyCapDescriptor'List_ l) = (Struct ('Mut s) -> Int -> ListOf ('Mut s) (Struct ('Mut s)) -> m ()
forall (m :: * -> *) s a.
RWCtx m s =>
a -> Int -> ListOf ('Mut s) a -> m ()
Untyped.setIndex Struct ('Mut s)
elt Int
i ListOf ('Mut s) (Struct ('Mut s))
l)
    newList :: Message ('Mut s)
-> Int -> m (List ('Mut s) (ThirdPartyCapDescriptor ('Mut s)))
newList Message ('Mut s)
msg Int
len = (ListOf ('Mut s) (Struct ('Mut s))
-> List ('Mut s) (ThirdPartyCapDescriptor ('Mut s))
forall (mut :: Mutability).
ListOf mut (Struct mut) -> List mut (ThirdPartyCapDescriptor mut)
ThirdPartyCapDescriptor'List_ (ListOf ('Mut s) (Struct ('Mut s))
 -> List ('Mut s) (ThirdPartyCapDescriptor ('Mut s)))
-> m (ListOf ('Mut s) (Struct ('Mut s)))
-> m (List ('Mut s) (ThirdPartyCapDescriptor ('Mut s)))
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (Message ('Mut s)
-> Word16 -> Word16 -> Int -> m (ListOf ('Mut s) (Struct ('Mut s)))
forall (m :: * -> *) s.
WriteCtx m s =>
Message ('Mut s)
-> Word16 -> Word16 -> Int -> m (ListOf ('Mut s) (Struct ('Mut s)))
Untyped.allocCompositeList Message ('Mut s)
msg Word16
1 Word16
1 Int
len))
get_ThirdPartyCapDescriptor'id :: ((Untyped.ReadCtx m msg)
                                  ,(Classes.FromPtr msg (Std_.Maybe (Untyped.Ptr msg)))) => (ThirdPartyCapDescriptor msg) -> (m (Std_.Maybe (Untyped.Ptr msg)))
get_ThirdPartyCapDescriptor'id :: ThirdPartyCapDescriptor msg -> m (Maybe (Ptr msg))
get_ThirdPartyCapDescriptor'id (ThirdPartyCapDescriptor'newtype_ Struct msg
struct) = (do
    Maybe (Ptr msg)
ptr <- (Int -> Struct msg -> m (Maybe (Ptr msg))
forall (m :: * -> *) (msg :: Mutability).
ReadCtx m msg =>
Int -> Struct msg -> m (Maybe (Ptr msg))
Untyped.getPtr Int
0 Struct msg
struct)
    (Message msg -> Maybe (Ptr msg) -> m (Maybe (Ptr msg))
forall (mut :: Mutability) a (m :: * -> *).
(FromPtr mut a, ReadCtx m mut) =>
Message mut -> Maybe (Ptr mut) -> m a
Classes.fromPtr (Struct msg -> Message msg
forall a (mut :: Mutability). HasMessage a mut => a -> Message mut
Untyped.message Struct msg
struct) Maybe (Ptr msg)
ptr)
    )
set_ThirdPartyCapDescriptor'id :: ((Untyped.RWCtx m s)
                                  ,(Classes.ToPtr s (Std_.Maybe (Untyped.Ptr (Message.Mut s))))) => (ThirdPartyCapDescriptor (Message.Mut s)) -> (Std_.Maybe (Untyped.Ptr (Message.Mut s))) -> (m ())
set_ThirdPartyCapDescriptor'id :: ThirdPartyCapDescriptor ('Mut s) -> Maybe (Ptr ('Mut s)) -> m ()
set_ThirdPartyCapDescriptor'id (ThirdPartyCapDescriptor'newtype_ Struct ('Mut s)
struct) Maybe (Ptr ('Mut s))
value = (do
    Maybe (Ptr ('Mut s))
ptr <- (Message ('Mut s)
-> Maybe (Ptr ('Mut s)) -> m (Maybe (Ptr ('Mut s)))
forall s a (m :: * -> *).
(ToPtr s a, WriteCtx m s) =>
Message ('Mut s) -> a -> m (Maybe (Ptr ('Mut s)))
Classes.toPtr (Struct ('Mut s) -> Message ('Mut s)
forall a (mut :: Mutability). HasMessage a mut => a -> Message mut
Untyped.message Struct ('Mut s)
struct) Maybe (Ptr ('Mut s))
value)
    (Maybe (Ptr ('Mut s)) -> Int -> Struct ('Mut s) -> m ()
forall (m :: * -> *) s.
(ReadCtx m ('Mut s), WriteCtx m s) =>
Maybe (Ptr ('Mut s)) -> Int -> Struct ('Mut s) -> m ()
Untyped.setPtr Maybe (Ptr ('Mut s))
ptr Int
0 Struct ('Mut s)
struct)
    )
has_ThirdPartyCapDescriptor'id :: ((Untyped.ReadCtx m msg)) => (ThirdPartyCapDescriptor msg) -> (m Std_.Bool)
has_ThirdPartyCapDescriptor'id :: ThirdPartyCapDescriptor msg -> m Bool
has_ThirdPartyCapDescriptor'id (ThirdPartyCapDescriptor'newtype_ Struct msg
struct) = (Maybe (Ptr msg) -> Bool
forall a. Maybe a -> Bool
Std_.isJust (Maybe (Ptr msg) -> Bool) -> m (Maybe (Ptr msg)) -> m Bool
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (Int -> Struct msg -> m (Maybe (Ptr msg))
forall (m :: * -> *) (msg :: Mutability).
ReadCtx m msg =>
Int -> Struct msg -> m (Maybe (Ptr msg))
Untyped.getPtr Int
0 Struct msg
struct))
get_ThirdPartyCapDescriptor'vineId :: ((Untyped.ReadCtx m msg)) => (ThirdPartyCapDescriptor msg) -> (m Std_.Word32)
get_ThirdPartyCapDescriptor'vineId :: ThirdPartyCapDescriptor msg -> m Word32
get_ThirdPartyCapDescriptor'vineId (ThirdPartyCapDescriptor'newtype_ Struct msg
struct) = (Struct msg -> Int -> Int -> Word64 -> m Word32
forall (m :: * -> *) (mut :: Mutability) a.
(ReadCtx m mut, IsWord a) =>
Struct mut -> Int -> Int -> Word64 -> m a
GenHelpers.getWordField Struct msg
struct Int
0 Int
0 Word64
0)
set_ThirdPartyCapDescriptor'vineId :: ((Untyped.RWCtx m s)) => (ThirdPartyCapDescriptor (Message.Mut s)) -> Std_.Word32 -> (m ())
set_ThirdPartyCapDescriptor'vineId :: ThirdPartyCapDescriptor ('Mut s) -> Word32 -> m ()
set_ThirdPartyCapDescriptor'vineId (ThirdPartyCapDescriptor'newtype_ Struct ('Mut s)
struct) Word32
value = (Struct ('Mut s) -> Word32 -> Int -> Int -> Word64 -> m ()
forall (m :: * -> *) s a.
(RWCtx m s, Bounded a, Integral a, IsWord a, Bits a) =>
Struct ('Mut s) -> a -> Int -> Int -> Word64 -> m ()
GenHelpers.setWordField Struct ('Mut s)
struct ((Word64 -> Word32
forall a b. (Integral a, Num b) => a -> b
Std_.fromIntegral (Word32 -> Word64
forall a. IsWord a => a -> Word64
Classes.toWord Word32
value)) :: Std_.Word32) Int
0 Int
0 Word64
0)
newtype Exception msg
    = Exception'newtype_ (Untyped.Struct msg)
instance (Classes.FromStruct msg (Exception msg)) where
    fromStruct :: Struct msg -> m (Exception msg)
fromStruct Struct msg
struct = (Exception msg -> m (Exception msg)
forall (f :: * -> *) a. Applicative f => a -> f a
Std_.pure (Struct msg -> Exception msg
forall (msg :: Mutability). Struct msg -> Exception msg
Exception'newtype_ Struct msg
struct))
instance (Classes.ToStruct msg (Exception msg)) where
    toStruct :: Exception msg -> Struct msg
toStruct (Exception'newtype_ Struct msg
struct) = Struct msg
struct
instance (Untyped.HasMessage (Exception mut) mut) where
    message :: Exception mut -> Message mut
message (Exception'newtype_ Struct mut
struct) = (Struct mut -> Message mut
forall a (mut :: Mutability). HasMessage a mut => a -> Message mut
Untyped.message Struct mut
struct)
instance (Untyped.MessageDefault (Exception mut) mut) where
    messageDefault :: Message mut -> m (Exception mut)
messageDefault Message mut
msg = (Struct mut -> Exception mut
forall (msg :: Mutability). Struct msg -> Exception msg
Exception'newtype_ (Struct mut -> Exception mut)
-> m (Struct mut) -> m (Exception mut)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (Message mut -> m (Struct mut)
forall a (mut :: Mutability) (m :: * -> *).
(MessageDefault a mut, ReadCtx m mut) =>
Message mut -> m a
Untyped.messageDefault Message mut
msg))
instance (Classes.FromPtr msg (Exception msg)) where
    fromPtr :: Message msg -> Maybe (Ptr msg) -> m (Exception msg)
fromPtr Message msg
msg Maybe (Ptr msg)
ptr = (Struct msg -> Exception msg
forall (msg :: Mutability). Struct msg -> Exception msg
Exception'newtype_ (Struct msg -> Exception msg)
-> m (Struct msg) -> m (Exception msg)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (Message msg -> Maybe (Ptr msg) -> m (Struct msg)
forall (mut :: Mutability) a (m :: * -> *).
(FromPtr mut a, ReadCtx m mut) =>
Message mut -> Maybe (Ptr mut) -> m a
Classes.fromPtr Message msg
msg Maybe (Ptr msg)
ptr))
instance (Classes.ToPtr s (Exception (Message.Mut s))) where
    toPtr :: Message ('Mut s) -> Exception ('Mut s) -> m (Maybe (Ptr ('Mut s)))
toPtr Message ('Mut s)
msg (Exception'newtype_ Struct ('Mut s)
struct) = (Message ('Mut s) -> Struct ('Mut s) -> m (Maybe (Ptr ('Mut s)))
forall s a (m :: * -> *).
(ToPtr s a, WriteCtx m s) =>
Message ('Mut s) -> a -> m (Maybe (Ptr ('Mut s)))
Classes.toPtr Message ('Mut s)
msg Struct ('Mut s)
struct)
instance (Classes.Allocate s (Exception (Message.Mut s))) where
    new :: Message ('Mut s) -> m (Exception ('Mut s))
new Message ('Mut s)
msg = (Struct ('Mut s) -> Exception ('Mut s)
forall (msg :: Mutability). Struct msg -> Exception msg
Exception'newtype_ (Struct ('Mut s) -> Exception ('Mut s))
-> m (Struct ('Mut s)) -> m (Exception ('Mut s))
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (Message ('Mut s) -> Word16 -> Word16 -> m (Struct ('Mut s))
forall (m :: * -> *) s.
WriteCtx m s =>
Message ('Mut s) -> Word16 -> Word16 -> m (Struct ('Mut s))
Untyped.allocStruct Message ('Mut s)
msg Word16
1 Word16
1))
instance (Basics.ListElem mut (Exception mut)) where
    newtype List mut (Exception mut)
        = Exception'List_ (Untyped.ListOf mut (Untyped.Struct mut))
    listFromPtr :: Message mut -> Maybe (Ptr mut) -> m (List mut (Exception mut))
listFromPtr Message mut
msg Maybe (Ptr mut)
ptr = (ListOf mut (Struct mut) -> List mut (Exception mut)
forall (mut :: Mutability).
ListOf mut (Struct mut) -> List mut (Exception mut)
Exception'List_ (ListOf mut (Struct mut) -> List mut (Exception mut))
-> m (ListOf mut (Struct mut)) -> m (List mut (Exception mut))
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (Message mut -> Maybe (Ptr mut) -> m (ListOf mut (Struct mut))
forall (mut :: Mutability) a (m :: * -> *).
(FromPtr mut a, ReadCtx m mut) =>
Message mut -> Maybe (Ptr mut) -> m a
Classes.fromPtr Message mut
msg Maybe (Ptr mut)
ptr))
    toUntypedList :: List mut (Exception mut) -> List mut
toUntypedList (Exception'List_ l) = (ListOf mut (Struct mut) -> List mut
forall (mut :: Mutability). ListOf mut (Struct mut) -> List mut
Untyped.ListStruct ListOf mut (Struct mut)
l)
    length :: List mut (Exception mut) -> Int
length (Exception'List_ l) = (ListOf mut (Struct mut) -> Int
forall (msg :: Mutability) a. ListOf msg a -> Int
Untyped.length ListOf mut (Struct mut)
l)
    index :: Int -> List mut (Exception mut) -> m (Exception mut)
index Int
i (Exception'List_ l) = (do
        Struct mut
elt <- (Int -> ListOf mut (Struct mut) -> m (Struct mut)
forall (m :: * -> *) (mut :: Mutability) a.
ReadCtx m mut =>
Int -> ListOf mut a -> m a
Untyped.index Int
i ListOf mut (Struct mut)
l)
        (Struct mut -> m (Exception mut)
forall (mut :: Mutability) a (m :: * -> *).
(FromStruct mut a, ReadCtx m mut) =>
Struct mut -> m a
Classes.fromStruct Struct mut
elt)
        )
instance (Basics.MutListElem s (Exception (Message.Mut s))) where
    setIndex :: Exception ('Mut s)
-> Int -> List ('Mut s) (Exception ('Mut s)) -> m ()
setIndex (Exception'newtype_ Struct ('Mut s)
elt) Int
i (Exception'List_ l) = (Struct ('Mut s) -> Int -> ListOf ('Mut s) (Struct ('Mut s)) -> m ()
forall (m :: * -> *) s a.
RWCtx m s =>
a -> Int -> ListOf ('Mut s) a -> m ()
Untyped.setIndex Struct ('Mut s)
elt Int
i ListOf ('Mut s) (Struct ('Mut s))
l)
    newList :: Message ('Mut s) -> Int -> m (List ('Mut s) (Exception ('Mut s)))
newList Message ('Mut s)
msg Int
len = (ListOf ('Mut s) (Struct ('Mut s))
-> List ('Mut s) (Exception ('Mut s))
forall (mut :: Mutability).
ListOf mut (Struct mut) -> List mut (Exception mut)
Exception'List_ (ListOf ('Mut s) (Struct ('Mut s))
 -> List ('Mut s) (Exception ('Mut s)))
-> m (ListOf ('Mut s) (Struct ('Mut s)))
-> m (List ('Mut s) (Exception ('Mut s)))
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (Message ('Mut s)
-> Word16 -> Word16 -> Int -> m (ListOf ('Mut s) (Struct ('Mut s)))
forall (m :: * -> *) s.
WriteCtx m s =>
Message ('Mut s)
-> Word16 -> Word16 -> Int -> m (ListOf ('Mut s) (Struct ('Mut s)))
Untyped.allocCompositeList Message ('Mut s)
msg Word16
1 Word16
1 Int
len))
get_Exception'reason :: ((Untyped.ReadCtx m msg)
                        ,(Classes.FromPtr msg (Basics.Text msg))) => (Exception msg) -> (m (Basics.Text msg))
get_Exception'reason :: Exception msg -> m (Text msg)
get_Exception'reason (Exception'newtype_ Struct msg
struct) = (do
    Maybe (Ptr msg)
ptr <- (Int -> Struct msg -> m (Maybe (Ptr msg))
forall (m :: * -> *) (msg :: Mutability).
ReadCtx m msg =>
Int -> Struct msg -> m (Maybe (Ptr msg))
Untyped.getPtr Int
0 Struct msg
struct)
    (Message msg -> Maybe (Ptr msg) -> m (Text msg)
forall (mut :: Mutability) a (m :: * -> *).
(FromPtr mut a, ReadCtx m mut) =>
Message mut -> Maybe (Ptr mut) -> m a
Classes.fromPtr (Struct msg -> Message msg
forall a (mut :: Mutability). HasMessage a mut => a -> Message mut
Untyped.message Struct msg
struct) Maybe (Ptr msg)
ptr)
    )
set_Exception'reason :: ((Untyped.RWCtx m s)
                        ,(Classes.ToPtr s (Basics.Text (Message.Mut s)))) => (Exception (Message.Mut s)) -> (Basics.Text (Message.Mut s)) -> (m ())
set_Exception'reason :: Exception ('Mut s) -> Text ('Mut s) -> m ()
set_Exception'reason (Exception'newtype_ Struct ('Mut s)
struct) Text ('Mut s)
value = (do
    Maybe (Ptr ('Mut s))
ptr <- (Message ('Mut s) -> Text ('Mut s) -> m (Maybe (Ptr ('Mut s)))
forall s a (m :: * -> *).
(ToPtr s a, WriteCtx m s) =>
Message ('Mut s) -> a -> m (Maybe (Ptr ('Mut s)))
Classes.toPtr (Struct ('Mut s) -> Message ('Mut s)
forall a (mut :: Mutability). HasMessage a mut => a -> Message mut
Untyped.message Struct ('Mut s)
struct) Text ('Mut s)
value)
    (Maybe (Ptr ('Mut s)) -> Int -> Struct ('Mut s) -> m ()
forall (m :: * -> *) s.
(ReadCtx m ('Mut s), WriteCtx m s) =>
Maybe (Ptr ('Mut s)) -> Int -> Struct ('Mut s) -> m ()
Untyped.setPtr Maybe (Ptr ('Mut s))
ptr Int
0 Struct ('Mut s)
struct)
    )
has_Exception'reason :: ((Untyped.ReadCtx m msg)) => (Exception msg) -> (m Std_.Bool)
has_Exception'reason :: Exception msg -> m Bool
has_Exception'reason (Exception'newtype_ Struct msg
struct) = (Maybe (Ptr msg) -> Bool
forall a. Maybe a -> Bool
Std_.isJust (Maybe (Ptr msg) -> Bool) -> m (Maybe (Ptr msg)) -> m Bool
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (Int -> Struct msg -> m (Maybe (Ptr msg))
forall (m :: * -> *) (msg :: Mutability).
ReadCtx m msg =>
Int -> Struct msg -> m (Maybe (Ptr msg))
Untyped.getPtr Int
0 Struct msg
struct))
new_Exception'reason :: ((Untyped.RWCtx m s)) => Std_.Int -> (Exception (Message.Mut s)) -> (m (Basics.Text (Message.Mut s)))
new_Exception'reason :: Int -> Exception ('Mut s) -> m (Text ('Mut s))
new_Exception'reason Int
len Exception ('Mut s)
struct = (do
    Text ('Mut s)
result <- (Message ('Mut s) -> Int -> m (Text ('Mut s))
forall (m :: * -> *) s.
WriteCtx m s =>
Message ('Mut s) -> Int -> m (Text ('Mut s))
Basics.newText (Exception ('Mut s) -> Message ('Mut s)
forall a (mut :: Mutability). HasMessage a mut => a -> Message mut
Untyped.message Exception ('Mut s)
struct) Int
len)
    (Exception ('Mut s) -> Text ('Mut s) -> m ()
forall (m :: * -> *) s.
(RWCtx m s, ToPtr s (Text ('Mut s))) =>
Exception ('Mut s) -> Text ('Mut s) -> m ()
set_Exception'reason Exception ('Mut s)
struct Text ('Mut s)
result)
    (Text ('Mut s) -> m (Text ('Mut s))
forall (f :: * -> *) a. Applicative f => a -> f a
Std_.pure Text ('Mut s)
result)
    )
get_Exception'obsoleteIsCallersFault :: ((Untyped.ReadCtx m msg)) => (Exception msg) -> (m Std_.Bool)
get_Exception'obsoleteIsCallersFault :: Exception msg -> m Bool
get_Exception'obsoleteIsCallersFault (Exception'newtype_ Struct msg
struct) = (Struct msg -> Int -> Int -> Word64 -> m Bool
forall (m :: * -> *) (mut :: Mutability) a.
(ReadCtx m mut, IsWord a) =>
Struct mut -> Int -> Int -> Word64 -> m a
GenHelpers.getWordField Struct msg
struct Int
0 Int
0 Word64
0)
set_Exception'obsoleteIsCallersFault :: ((Untyped.RWCtx m s)) => (Exception (Message.Mut s)) -> Std_.Bool -> (m ())
set_Exception'obsoleteIsCallersFault :: Exception ('Mut s) -> Bool -> m ()
set_Exception'obsoleteIsCallersFault (Exception'newtype_ Struct ('Mut s)
struct) Bool
value = (Struct ('Mut s) -> Word1 -> Int -> Int -> Word64 -> m ()
forall (m :: * -> *) s a.
(RWCtx m s, Bounded a, Integral a, IsWord a, Bits a) =>
Struct ('Mut s) -> a -> Int -> Int -> Word64 -> m ()
GenHelpers.setWordField Struct ('Mut s)
struct ((Word64 -> Word1
forall a b. (Integral a, Num b) => a -> b
Std_.fromIntegral (Bool -> Word64
forall a. IsWord a => a -> Word64
Classes.toWord Bool
value)) :: Std_.Word1) Int
0 Int
0 Word64
0)
get_Exception'obsoleteDurability :: ((Untyped.ReadCtx m msg)) => (Exception msg) -> (m Std_.Word16)
get_Exception'obsoleteDurability :: Exception msg -> m Word16
get_Exception'obsoleteDurability (Exception'newtype_ Struct msg
struct) = (Struct msg -> Int -> Int -> Word64 -> m Word16
forall (m :: * -> *) (mut :: Mutability) a.
(ReadCtx m mut, IsWord a) =>
Struct mut -> Int -> Int -> Word64 -> m a
GenHelpers.getWordField Struct msg
struct Int
0 Int
16 Word64
0)
set_Exception'obsoleteDurability :: ((Untyped.RWCtx m s)) => (Exception (Message.Mut s)) -> Std_.Word16 -> (m ())
set_Exception'obsoleteDurability :: Exception ('Mut s) -> Word16 -> m ()
set_Exception'obsoleteDurability (Exception'newtype_ Struct ('Mut s)
struct) Word16
value = (Struct ('Mut s) -> Word16 -> Int -> Int -> Word64 -> m ()
forall (m :: * -> *) s a.
(RWCtx m s, Bounded a, Integral a, IsWord a, Bits a) =>
Struct ('Mut s) -> a -> Int -> Int -> Word64 -> m ()
GenHelpers.setWordField Struct ('Mut s)
struct ((Word64 -> Word16
forall a b. (Integral a, Num b) => a -> b
Std_.fromIntegral (Word16 -> Word64
forall a. IsWord a => a -> Word64
Classes.toWord Word16
value)) :: Std_.Word16) Int
0 Int
16 Word64
0)
get_Exception'type_ :: ((Untyped.ReadCtx m msg)) => (Exception msg) -> (m Exception'Type)
get_Exception'type_ :: Exception msg -> m Exception'Type
get_Exception'type_ (Exception'newtype_ Struct msg
struct) = (Struct msg -> Int -> Int -> Word64 -> m Exception'Type
forall (m :: * -> *) (mut :: Mutability) a.
(ReadCtx m mut, IsWord a) =>
Struct mut -> Int -> Int -> Word64 -> m a
GenHelpers.getWordField Struct msg
struct Int
0 Int
32 Word64
0)
set_Exception'type_ :: ((Untyped.RWCtx m s)) => (Exception (Message.Mut s)) -> Exception'Type -> (m ())
set_Exception'type_ :: Exception ('Mut s) -> Exception'Type -> m ()
set_Exception'type_ (Exception'newtype_ Struct ('Mut s)
struct) Exception'Type
value = (Struct ('Mut s) -> Word16 -> Int -> Int -> Word64 -> m ()
forall (m :: * -> *) s a.
(RWCtx m s, Bounded a, Integral a, IsWord a, Bits a) =>
Struct ('Mut s) -> a -> Int -> Int -> Word64 -> m ()
GenHelpers.setWordField Struct ('Mut s)
struct ((Word64 -> Word16
forall a b. (Integral a, Num b) => a -> b
Std_.fromIntegral (Exception'Type -> Word64
forall a. IsWord a => a -> Word64
Classes.toWord Exception'Type
value)) :: Std_.Word16) Int
0 Int
32 Word64
0)
data Exception'Type 
    = Exception'Type'failed 
    | Exception'Type'overloaded 
    | Exception'Type'disconnected 
    | Exception'Type'unimplemented 
    | Exception'Type'unknown' Std_.Word16
    deriving(Int -> Exception'Type -> ShowS
[Exception'Type] -> ShowS
Exception'Type -> String
(Int -> Exception'Type -> ShowS)
-> (Exception'Type -> String)
-> ([Exception'Type] -> ShowS)
-> Show Exception'Type
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Exception'Type] -> ShowS
$cshowList :: [Exception'Type] -> ShowS
show :: Exception'Type -> String
$cshow :: Exception'Type -> String
showsPrec :: Int -> Exception'Type -> ShowS
$cshowsPrec :: Int -> Exception'Type -> ShowS
Std_.Show
            ,ReadPrec [Exception'Type]
ReadPrec Exception'Type
Int -> ReadS Exception'Type
ReadS [Exception'Type]
(Int -> ReadS Exception'Type)
-> ReadS [Exception'Type]
-> ReadPrec Exception'Type
-> ReadPrec [Exception'Type]
-> Read Exception'Type
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [Exception'Type]
$creadListPrec :: ReadPrec [Exception'Type]
readPrec :: ReadPrec Exception'Type
$creadPrec :: ReadPrec Exception'Type
readList :: ReadS [Exception'Type]
$creadList :: ReadS [Exception'Type]
readsPrec :: Int -> ReadS Exception'Type
$creadsPrec :: Int -> ReadS Exception'Type
Std_.Read
            ,Exception'Type -> Exception'Type -> Bool
(Exception'Type -> Exception'Type -> Bool)
-> (Exception'Type -> Exception'Type -> Bool) -> Eq Exception'Type
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Exception'Type -> Exception'Type -> Bool
$c/= :: Exception'Type -> Exception'Type -> Bool
== :: Exception'Type -> Exception'Type -> Bool
$c== :: Exception'Type -> Exception'Type -> Bool
Std_.Eq
            ,(forall x. Exception'Type -> Rep Exception'Type x)
-> (forall x. Rep Exception'Type x -> Exception'Type)
-> Generic Exception'Type
forall x. Rep Exception'Type x -> Exception'Type
forall x. Exception'Type -> Rep Exception'Type x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Exception'Type x -> Exception'Type
$cfrom :: forall x. Exception'Type -> Rep Exception'Type x
Generics.Generic)
instance (Classes.IsWord Exception'Type) where
    fromWord :: Word64 -> Exception'Type
fromWord Word64
n = case ((Word64 -> Word16
forall a b. (Integral a, Num b) => a -> b
Std_.fromIntegral Word64
n) :: Std_.Word16) of
        Word16
0 ->
            Exception'Type
Exception'Type'failed
        Word16
1 ->
            Exception'Type
Exception'Type'overloaded
        Word16
2 ->
            Exception'Type
Exception'Type'disconnected
        Word16
3 ->
            Exception'Type
Exception'Type'unimplemented
        Word16
tag ->
            (Word16 -> Exception'Type
Exception'Type'unknown' Word16
tag)
    toWord :: Exception'Type -> Word64
toWord (Exception'Type
Exception'Type'failed) = Word64
0
    toWord (Exception'Type
Exception'Type'overloaded) = Word64
1
    toWord (Exception'Type
Exception'Type'disconnected) = Word64
2
    toWord (Exception'Type
Exception'Type'unimplemented) = Word64
3
    toWord (Exception'Type'unknown' Word16
tag) = (Word16 -> Word64
forall a b. (Integral a, Num b) => a -> b
Std_.fromIntegral Word16
tag)
instance (Std_.Enum Exception'Type) where
    fromEnum :: Exception'Type -> Int
fromEnum Exception'Type
x = (Word64 -> Int
forall a b. (Integral a, Num b) => a -> b
Std_.fromIntegral (Exception'Type -> Word64
forall a. IsWord a => a -> Word64
Classes.toWord Exception'Type
x))
    toEnum :: Int -> Exception'Type
toEnum Int
x = (Word64 -> Exception'Type
forall a. IsWord a => Word64 -> a
Classes.fromWord (Int -> Word64
forall a b. (Integral a, Num b) => a -> b
Std_.fromIntegral Int
x))
instance (Basics.ListElem mut Exception'Type) where
    newtype List mut Exception'Type
        = Exception'Type'List_ (Untyped.ListOf mut Std_.Word16)
    index :: Int -> List mut Exception'Type -> m Exception'Type
index Int
i (Exception'Type'List_ l) = (Word64 -> Exception'Type
forall a. IsWord a => Word64 -> a
Classes.fromWord (Word64 -> Exception'Type) -> m Word64 -> m Exception'Type
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (Word16 -> Word64
forall a b. (Integral a, Num b) => a -> b
Std_.fromIntegral (Word16 -> Word64) -> m Word16 -> m Word64
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (Int -> ListOf mut Word16 -> m Word16
forall (m :: * -> *) (mut :: Mutability) a.
ReadCtx m mut =>
Int -> ListOf mut a -> m a
Untyped.index Int
i ListOf mut Word16
l)))
    listFromPtr :: Message mut -> Maybe (Ptr mut) -> m (List mut Exception'Type)
listFromPtr Message mut
msg Maybe (Ptr mut)
ptr = (ListOf mut Word16 -> List mut Exception'Type
forall (mut :: Mutability).
ListOf mut Word16 -> List mut Exception'Type
Exception'Type'List_ (ListOf mut Word16 -> List mut Exception'Type)
-> m (ListOf mut Word16) -> m (List mut Exception'Type)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (Message mut -> Maybe (Ptr mut) -> m (ListOf mut Word16)
forall (mut :: Mutability) a (m :: * -> *).
(FromPtr mut a, ReadCtx m mut) =>
Message mut -> Maybe (Ptr mut) -> m a
Classes.fromPtr Message mut
msg Maybe (Ptr mut)
ptr))
    toUntypedList :: List mut Exception'Type -> List mut
toUntypedList (Exception'Type'List_ l) = (ListOf mut Word16 -> List mut
forall (mut :: Mutability). ListOf mut Word16 -> List mut
Untyped.List16 ListOf mut Word16
l)
    length :: List mut Exception'Type -> Int
length (Exception'Type'List_ l) = (ListOf mut Word16 -> Int
forall (msg :: Mutability) a. ListOf msg a -> Int
Untyped.length ListOf mut Word16
l)
instance (Classes.MutListElem s Exception'Type) where
    setIndex :: Exception'Type -> Int -> List ('Mut s) Exception'Type -> m ()
setIndex Exception'Type
elt Int
i (Exception'Type'List_ l) = (Word16 -> Int -> ListOf ('Mut s) Word16 -> m ()
forall (m :: * -> *) s a.
RWCtx m s =>
a -> Int -> ListOf ('Mut s) a -> m ()
Untyped.setIndex (Word64 -> Word16
forall a b. (Integral a, Num b) => a -> b
Std_.fromIntegral (Exception'Type -> Word64
forall a. IsWord a => a -> Word64
Classes.toWord Exception'Type
elt)) Int
i ListOf ('Mut s) Word16
l)
    newList :: Message ('Mut s) -> Int -> m (List ('Mut s) Exception'Type)
newList Message ('Mut s)
msg Int
size = (ListOf ('Mut s) Word16 -> List ('Mut s) Exception'Type
forall (mut :: Mutability).
ListOf mut Word16 -> List mut Exception'Type
Exception'Type'List_ (ListOf ('Mut s) Word16 -> List ('Mut s) Exception'Type)
-> m (ListOf ('Mut s) Word16) -> m (List ('Mut s) Exception'Type)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (Message ('Mut s) -> Int -> m (ListOf ('Mut s) Word16)
forall (m :: * -> *) s.
WriteCtx m s =>
Message ('Mut s) -> Int -> m (ListOf ('Mut s) Word16)
Untyped.allocList16 Message ('Mut s)
msg Int
size))