{-# 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.RpcTwoparty 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 ((<$>), (<*>), (>>=))
data Side 
    = Side'server 
    | Side'client 
    | Side'unknown' Std_.Word16
    deriving(Int -> Side -> ShowS
[Side] -> ShowS
Side -> String
(Int -> Side -> ShowS)
-> (Side -> String) -> ([Side] -> ShowS) -> Show Side
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Side] -> ShowS
$cshowList :: [Side] -> ShowS
show :: Side -> String
$cshow :: Side -> String
showsPrec :: Int -> Side -> ShowS
$cshowsPrec :: Int -> Side -> ShowS
Std_.Show
            ,ReadPrec [Side]
ReadPrec Side
Int -> ReadS Side
ReadS [Side]
(Int -> ReadS Side)
-> ReadS [Side] -> ReadPrec Side -> ReadPrec [Side] -> Read Side
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [Side]
$creadListPrec :: ReadPrec [Side]
readPrec :: ReadPrec Side
$creadPrec :: ReadPrec Side
readList :: ReadS [Side]
$creadList :: ReadS [Side]
readsPrec :: Int -> ReadS Side
$creadsPrec :: Int -> ReadS Side
Std_.Read
            ,Side -> Side -> Bool
(Side -> Side -> Bool) -> (Side -> Side -> Bool) -> Eq Side
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Side -> Side -> Bool
$c/= :: Side -> Side -> Bool
== :: Side -> Side -> Bool
$c== :: Side -> Side -> Bool
Std_.Eq
            ,(forall x. Side -> Rep Side x)
-> (forall x. Rep Side x -> Side) -> Generic Side
forall x. Rep Side x -> Side
forall x. Side -> Rep Side x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Side x -> Side
$cfrom :: forall x. Side -> Rep Side x
Generics.Generic)
instance (Classes.IsWord Side) where
    fromWord :: Word64 -> Side
fromWord Word64
n = case ((Word64 -> Word16
forall a b. (Integral a, Num b) => a -> b
Std_.fromIntegral Word64
n) :: Std_.Word16) of
        Word16
0 ->
            Side
Side'server
        Word16
1 ->
            Side
Side'client
        Word16
tag ->
            (Word16 -> Side
Side'unknown' Word16
tag)
    toWord :: Side -> Word64
toWord (Side
Side'server) = Word64
0
    toWord (Side
Side'client) = Word64
1
    toWord (Side'unknown' Word16
tag) = (Word16 -> Word64
forall a b. (Integral a, Num b) => a -> b
Std_.fromIntegral Word16
tag)
instance (Std_.Enum Side) where
    fromEnum :: Side -> Int
fromEnum Side
x = (Word64 -> Int
forall a b. (Integral a, Num b) => a -> b
Std_.fromIntegral (Side -> Word64
forall a. IsWord a => a -> Word64
Classes.toWord Side
x))
    toEnum :: Int -> Side
toEnum Int
x = (Word64 -> Side
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 Side) where
    newtype List mut Side
        = Side'List_ (Untyped.ListOf mut Std_.Word16)
    index :: Int -> List mut Side -> m Side
index Int
i (Side'List_ l) = (Word64 -> Side
forall a. IsWord a => Word64 -> a
Classes.fromWord (Word64 -> Side) -> m Word64 -> m Side
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 Side)
listFromPtr Message mut
msg Maybe (Ptr mut)
ptr = (ListOf mut Word16 -> List mut Side
forall (mut :: Mutability). ListOf mut Word16 -> List mut Side
Side'List_ (ListOf mut Word16 -> List mut Side)
-> m (ListOf mut Word16) -> m (List mut Side)
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 Side -> List mut
toUntypedList (Side'List_ l) = (ListOf mut Word16 -> List mut
forall (mut :: Mutability). ListOf mut Word16 -> List mut
Untyped.List16 ListOf mut Word16
l)
    length :: List mut Side -> Int
length (Side'List_ l) = (ListOf mut Word16 -> Int
forall (msg :: Mutability) a. ListOf msg a -> Int
Untyped.length ListOf mut Word16
l)
instance (Classes.MutListElem s Side) where
    setIndex :: Side -> Int -> List ('Mut s) Side -> m ()
setIndex Side
elt Int
i (Side'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 (Side -> Word64
forall a. IsWord a => a -> Word64
Classes.toWord Side
elt)) Int
i ListOf ('Mut s) Word16
l)
    newList :: Message ('Mut s) -> Int -> m (List ('Mut s) Side)
newList Message ('Mut s)
msg Int
size = (ListOf ('Mut s) Word16 -> List ('Mut s) Side
forall (mut :: Mutability). ListOf mut Word16 -> List mut Side
Side'List_ (ListOf ('Mut s) Word16 -> List ('Mut s) Side)
-> m (ListOf ('Mut s) Word16) -> m (List ('Mut s) Side)
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))
newtype VatId msg
    = VatId'newtype_ (Untyped.Struct msg)
instance (Classes.FromStruct msg (VatId msg)) where
    fromStruct :: Struct msg -> m (VatId msg)
fromStruct Struct msg
struct = (VatId msg -> m (VatId msg)
forall (f :: * -> *) a. Applicative f => a -> f a
Std_.pure (Struct msg -> VatId msg
forall (msg :: Mutability). Struct msg -> VatId msg
VatId'newtype_ Struct msg
struct))
instance (Classes.ToStruct msg (VatId msg)) where
    toStruct :: VatId msg -> Struct msg
toStruct (VatId'newtype_ Struct msg
struct) = Struct msg
struct
instance (Untyped.HasMessage (VatId mut) mut) where
    message :: VatId mut -> Message mut
message (VatId'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 (VatId mut) mut) where
    messageDefault :: Message mut -> m (VatId mut)
messageDefault Message mut
msg = (Struct mut -> VatId mut
forall (msg :: Mutability). Struct msg -> VatId msg
VatId'newtype_ (Struct mut -> VatId mut) -> m (Struct mut) -> m (VatId 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 (VatId msg)) where
    fromPtr :: Message msg -> Maybe (Ptr msg) -> m (VatId msg)
fromPtr Message msg
msg Maybe (Ptr msg)
ptr = (Struct msg -> VatId msg
forall (msg :: Mutability). Struct msg -> VatId msg
VatId'newtype_ (Struct msg -> VatId msg) -> m (Struct msg) -> m (VatId 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 (VatId (Message.Mut s))) where
    toPtr :: Message ('Mut s) -> VatId ('Mut s) -> m (Maybe (Ptr ('Mut s)))
toPtr Message ('Mut s)
msg (VatId'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 (VatId (Message.Mut s))) where
    new :: Message ('Mut s) -> m (VatId ('Mut s))
new Message ('Mut s)
msg = (Struct ('Mut s) -> VatId ('Mut s)
forall (msg :: Mutability). Struct msg -> VatId msg
VatId'newtype_ (Struct ('Mut s) -> VatId ('Mut s))
-> m (Struct ('Mut s)) -> m (VatId ('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 (VatId mut)) where
    newtype List mut (VatId mut)
        = VatId'List_ (Untyped.ListOf mut (Untyped.Struct mut))
    listFromPtr :: Message mut -> Maybe (Ptr mut) -> m (List mut (VatId mut))
listFromPtr Message mut
msg Maybe (Ptr mut)
ptr = (ListOf mut (Struct mut) -> List mut (VatId mut)
forall (mut :: Mutability).
ListOf mut (Struct mut) -> List mut (VatId mut)
VatId'List_ (ListOf mut (Struct mut) -> List mut (VatId mut))
-> m (ListOf mut (Struct mut)) -> m (List mut (VatId 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 (VatId mut) -> List mut
toUntypedList (VatId'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 (VatId mut) -> Int
length (VatId'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 (VatId mut) -> m (VatId mut)
index Int
i (VatId'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 (VatId 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 (VatId (Message.Mut s))) where
    setIndex :: VatId ('Mut s) -> Int -> List ('Mut s) (VatId ('Mut s)) -> m ()
setIndex (VatId'newtype_ Struct ('Mut s)
elt) Int
i (VatId'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) (VatId ('Mut s)))
newList Message ('Mut s)
msg Int
len = (ListOf ('Mut s) (Struct ('Mut s)) -> List ('Mut s) (VatId ('Mut s))
forall (mut :: Mutability).
ListOf mut (Struct mut) -> List mut (VatId mut)
VatId'List_ (ListOf ('Mut s) (Struct ('Mut s))
 -> List ('Mut s) (VatId ('Mut s)))
-> m (ListOf ('Mut s) (Struct ('Mut s)))
-> m (List ('Mut s) (VatId ('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_VatId'side :: ((Untyped.ReadCtx m msg)) => (VatId msg) -> (m Side)
get_VatId'side :: VatId msg -> m Side
get_VatId'side (VatId'newtype_ Struct msg
struct) = (Struct msg -> Int -> Int -> Word64 -> m Side
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_VatId'side :: ((Untyped.RWCtx m s)) => (VatId (Message.Mut s)) -> Side -> (m ())
set_VatId'side :: VatId ('Mut s) -> Side -> m ()
set_VatId'side (VatId'newtype_ Struct ('Mut s)
struct) Side
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 (Side -> Word64
forall a. IsWord a => a -> Word64
Classes.toWord Side
value)) :: Std_.Word16) Int
0 Int
0 Word64
0)
newtype ProvisionId msg
    = ProvisionId'newtype_ (Untyped.Struct msg)
instance (Classes.FromStruct msg (ProvisionId msg)) where
    fromStruct :: Struct msg -> m (ProvisionId msg)
fromStruct Struct msg
struct = (ProvisionId msg -> m (ProvisionId msg)
forall (f :: * -> *) a. Applicative f => a -> f a
Std_.pure (Struct msg -> ProvisionId msg
forall (msg :: Mutability). Struct msg -> ProvisionId msg
ProvisionId'newtype_ Struct msg
struct))
instance (Classes.ToStruct msg (ProvisionId msg)) where
    toStruct :: ProvisionId msg -> Struct msg
toStruct (ProvisionId'newtype_ Struct msg
struct) = Struct msg
struct
instance (Untyped.HasMessage (ProvisionId mut) mut) where
    message :: ProvisionId mut -> Message mut
message (ProvisionId'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 (ProvisionId mut) mut) where
    messageDefault :: Message mut -> m (ProvisionId mut)
messageDefault Message mut
msg = (Struct mut -> ProvisionId mut
forall (msg :: Mutability). Struct msg -> ProvisionId msg
ProvisionId'newtype_ (Struct mut -> ProvisionId mut)
-> m (Struct mut) -> m (ProvisionId 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 (ProvisionId msg)) where
    fromPtr :: Message msg -> Maybe (Ptr msg) -> m (ProvisionId msg)
fromPtr Message msg
msg Maybe (Ptr msg)
ptr = (Struct msg -> ProvisionId msg
forall (msg :: Mutability). Struct msg -> ProvisionId msg
ProvisionId'newtype_ (Struct msg -> ProvisionId msg)
-> m (Struct msg) -> m (ProvisionId 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 (ProvisionId (Message.Mut s))) where
    toPtr :: Message ('Mut s)
-> ProvisionId ('Mut s) -> m (Maybe (Ptr ('Mut s)))
toPtr Message ('Mut s)
msg (ProvisionId'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 (ProvisionId (Message.Mut s))) where
    new :: Message ('Mut s) -> m (ProvisionId ('Mut s))
new Message ('Mut s)
msg = (Struct ('Mut s) -> ProvisionId ('Mut s)
forall (msg :: Mutability). Struct msg -> ProvisionId msg
ProvisionId'newtype_ (Struct ('Mut s) -> ProvisionId ('Mut s))
-> m (Struct ('Mut s)) -> m (ProvisionId ('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 (ProvisionId mut)) where
    newtype List mut (ProvisionId mut)
        = ProvisionId'List_ (Untyped.ListOf mut (Untyped.Struct mut))
    listFromPtr :: Message mut -> Maybe (Ptr mut) -> m (List mut (ProvisionId mut))
listFromPtr Message mut
msg Maybe (Ptr mut)
ptr = (ListOf mut (Struct mut) -> List mut (ProvisionId mut)
forall (mut :: Mutability).
ListOf mut (Struct mut) -> List mut (ProvisionId mut)
ProvisionId'List_ (ListOf mut (Struct mut) -> List mut (ProvisionId mut))
-> m (ListOf mut (Struct mut)) -> m (List mut (ProvisionId 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 (ProvisionId mut) -> List mut
toUntypedList (ProvisionId'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 (ProvisionId mut) -> Int
length (ProvisionId'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 (ProvisionId mut) -> m (ProvisionId mut)
index Int
i (ProvisionId'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 (ProvisionId 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 (ProvisionId (Message.Mut s))) where
    setIndex :: ProvisionId ('Mut s)
-> Int -> List ('Mut s) (ProvisionId ('Mut s)) -> m ()
setIndex (ProvisionId'newtype_ Struct ('Mut s)
elt) Int
i (ProvisionId'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) (ProvisionId ('Mut s)))
newList Message ('Mut s)
msg Int
len = (ListOf ('Mut s) (Struct ('Mut s))
-> List ('Mut s) (ProvisionId ('Mut s))
forall (mut :: Mutability).
ListOf mut (Struct mut) -> List mut (ProvisionId mut)
ProvisionId'List_ (ListOf ('Mut s) (Struct ('Mut s))
 -> List ('Mut s) (ProvisionId ('Mut s)))
-> m (ListOf ('Mut s) (Struct ('Mut s)))
-> m (List ('Mut s) (ProvisionId ('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_ProvisionId'joinId :: ((Untyped.ReadCtx m msg)) => (ProvisionId msg) -> (m Std_.Word32)
get_ProvisionId'joinId :: ProvisionId msg -> m Word32
get_ProvisionId'joinId (ProvisionId'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_ProvisionId'joinId :: ((Untyped.RWCtx m s)) => (ProvisionId (Message.Mut s)) -> Std_.Word32 -> (m ())
set_ProvisionId'joinId :: ProvisionId ('Mut s) -> Word32 -> m ()
set_ProvisionId'joinId (ProvisionId'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 RecipientId msg
    = RecipientId'newtype_ (Untyped.Struct msg)
instance (Classes.FromStruct msg (RecipientId msg)) where
    fromStruct :: Struct msg -> m (RecipientId msg)
fromStruct Struct msg
struct = (RecipientId msg -> m (RecipientId msg)
forall (f :: * -> *) a. Applicative f => a -> f a
Std_.pure (Struct msg -> RecipientId msg
forall (msg :: Mutability). Struct msg -> RecipientId msg
RecipientId'newtype_ Struct msg
struct))
instance (Classes.ToStruct msg (RecipientId msg)) where
    toStruct :: RecipientId msg -> Struct msg
toStruct (RecipientId'newtype_ Struct msg
struct) = Struct msg
struct
instance (Untyped.HasMessage (RecipientId mut) mut) where
    message :: RecipientId mut -> Message mut
message (RecipientId'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 (RecipientId mut) mut) where
    messageDefault :: Message mut -> m (RecipientId mut)
messageDefault Message mut
msg = (Struct mut -> RecipientId mut
forall (msg :: Mutability). Struct msg -> RecipientId msg
RecipientId'newtype_ (Struct mut -> RecipientId mut)
-> m (Struct mut) -> m (RecipientId 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 (RecipientId msg)) where
    fromPtr :: Message msg -> Maybe (Ptr msg) -> m (RecipientId msg)
fromPtr Message msg
msg Maybe (Ptr msg)
ptr = (Struct msg -> RecipientId msg
forall (msg :: Mutability). Struct msg -> RecipientId msg
RecipientId'newtype_ (Struct msg -> RecipientId msg)
-> m (Struct msg) -> m (RecipientId 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 (RecipientId (Message.Mut s))) where
    toPtr :: Message ('Mut s)
-> RecipientId ('Mut s) -> m (Maybe (Ptr ('Mut s)))
toPtr Message ('Mut s)
msg (RecipientId'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 (RecipientId (Message.Mut s))) where
    new :: Message ('Mut s) -> m (RecipientId ('Mut s))
new Message ('Mut s)
msg = (Struct ('Mut s) -> RecipientId ('Mut s)
forall (msg :: Mutability). Struct msg -> RecipientId msg
RecipientId'newtype_ (Struct ('Mut s) -> RecipientId ('Mut s))
-> m (Struct ('Mut s)) -> m (RecipientId ('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
0))
instance (Basics.ListElem mut (RecipientId mut)) where
    newtype List mut (RecipientId mut)
        = RecipientId'List_ (Untyped.ListOf mut (Untyped.Struct mut))
    listFromPtr :: Message mut -> Maybe (Ptr mut) -> m (List mut (RecipientId mut))
listFromPtr Message mut
msg Maybe (Ptr mut)
ptr = (ListOf mut (Struct mut) -> List mut (RecipientId mut)
forall (mut :: Mutability).
ListOf mut (Struct mut) -> List mut (RecipientId mut)
RecipientId'List_ (ListOf mut (Struct mut) -> List mut (RecipientId mut))
-> m (ListOf mut (Struct mut)) -> m (List mut (RecipientId 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 (RecipientId mut) -> List mut
toUntypedList (RecipientId'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 (RecipientId mut) -> Int
length (RecipientId'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 (RecipientId mut) -> m (RecipientId mut)
index Int
i (RecipientId'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 (RecipientId 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 (RecipientId (Message.Mut s))) where
    setIndex :: RecipientId ('Mut s)
-> Int -> List ('Mut s) (RecipientId ('Mut s)) -> m ()
setIndex (RecipientId'newtype_ Struct ('Mut s)
elt) Int
i (RecipientId'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) (RecipientId ('Mut s)))
newList Message ('Mut s)
msg Int
len = (ListOf ('Mut s) (Struct ('Mut s))
-> List ('Mut s) (RecipientId ('Mut s))
forall (mut :: Mutability).
ListOf mut (Struct mut) -> List mut (RecipientId mut)
RecipientId'List_ (ListOf ('Mut s) (Struct ('Mut s))
 -> List ('Mut s) (RecipientId ('Mut s)))
-> m (ListOf ('Mut s) (Struct ('Mut s)))
-> m (List ('Mut s) (RecipientId ('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
0 Int
len))
newtype ThirdPartyCapId msg
    = ThirdPartyCapId'newtype_ (Untyped.Struct msg)
instance (Classes.FromStruct msg (ThirdPartyCapId msg)) where
    fromStruct :: Struct msg -> m (ThirdPartyCapId msg)
fromStruct Struct msg
struct = (ThirdPartyCapId msg -> m (ThirdPartyCapId msg)
forall (f :: * -> *) a. Applicative f => a -> f a
Std_.pure (Struct msg -> ThirdPartyCapId msg
forall (msg :: Mutability). Struct msg -> ThirdPartyCapId msg
ThirdPartyCapId'newtype_ Struct msg
struct))
instance (Classes.ToStruct msg (ThirdPartyCapId msg)) where
    toStruct :: ThirdPartyCapId msg -> Struct msg
toStruct (ThirdPartyCapId'newtype_ Struct msg
struct) = Struct msg
struct
instance (Untyped.HasMessage (ThirdPartyCapId mut) mut) where
    message :: ThirdPartyCapId mut -> Message mut
message (ThirdPartyCapId'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 (ThirdPartyCapId mut) mut) where
    messageDefault :: Message mut -> m (ThirdPartyCapId mut)
messageDefault Message mut
msg = (Struct mut -> ThirdPartyCapId mut
forall (msg :: Mutability). Struct msg -> ThirdPartyCapId msg
ThirdPartyCapId'newtype_ (Struct mut -> ThirdPartyCapId mut)
-> m (Struct mut) -> m (ThirdPartyCapId 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 (ThirdPartyCapId msg)) where
    fromPtr :: Message msg -> Maybe (Ptr msg) -> m (ThirdPartyCapId msg)
fromPtr Message msg
msg Maybe (Ptr msg)
ptr = (Struct msg -> ThirdPartyCapId msg
forall (msg :: Mutability). Struct msg -> ThirdPartyCapId msg
ThirdPartyCapId'newtype_ (Struct msg -> ThirdPartyCapId msg)
-> m (Struct msg) -> m (ThirdPartyCapId 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 (ThirdPartyCapId (Message.Mut s))) where
    toPtr :: Message ('Mut s)
-> ThirdPartyCapId ('Mut s) -> m (Maybe (Ptr ('Mut s)))
toPtr Message ('Mut s)
msg (ThirdPartyCapId'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 (ThirdPartyCapId (Message.Mut s))) where
    new :: Message ('Mut s) -> m (ThirdPartyCapId ('Mut s))
new Message ('Mut s)
msg = (Struct ('Mut s) -> ThirdPartyCapId ('Mut s)
forall (msg :: Mutability). Struct msg -> ThirdPartyCapId msg
ThirdPartyCapId'newtype_ (Struct ('Mut s) -> ThirdPartyCapId ('Mut s))
-> m (Struct ('Mut s)) -> m (ThirdPartyCapId ('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
0))
instance (Basics.ListElem mut (ThirdPartyCapId mut)) where
    newtype List mut (ThirdPartyCapId mut)
        = ThirdPartyCapId'List_ (Untyped.ListOf mut (Untyped.Struct mut))
    listFromPtr :: Message mut
-> Maybe (Ptr mut) -> m (List mut (ThirdPartyCapId mut))
listFromPtr Message mut
msg Maybe (Ptr mut)
ptr = (ListOf mut (Struct mut) -> List mut (ThirdPartyCapId mut)
forall (mut :: Mutability).
ListOf mut (Struct mut) -> List mut (ThirdPartyCapId mut)
ThirdPartyCapId'List_ (ListOf mut (Struct mut) -> List mut (ThirdPartyCapId mut))
-> m (ListOf mut (Struct mut))
-> m (List mut (ThirdPartyCapId 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 (ThirdPartyCapId mut) -> List mut
toUntypedList (ThirdPartyCapId'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 (ThirdPartyCapId mut) -> Int
length (ThirdPartyCapId'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 (ThirdPartyCapId mut) -> m (ThirdPartyCapId mut)
index Int
i (ThirdPartyCapId'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 (ThirdPartyCapId 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 (ThirdPartyCapId (Message.Mut s))) where
    setIndex :: ThirdPartyCapId ('Mut s)
-> Int -> List ('Mut s) (ThirdPartyCapId ('Mut s)) -> m ()
setIndex (ThirdPartyCapId'newtype_ Struct ('Mut s)
elt) Int
i (ThirdPartyCapId'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) (ThirdPartyCapId ('Mut s)))
newList Message ('Mut s)
msg Int
len = (ListOf ('Mut s) (Struct ('Mut s))
-> List ('Mut s) (ThirdPartyCapId ('Mut s))
forall (mut :: Mutability).
ListOf mut (Struct mut) -> List mut (ThirdPartyCapId mut)
ThirdPartyCapId'List_ (ListOf ('Mut s) (Struct ('Mut s))
 -> List ('Mut s) (ThirdPartyCapId ('Mut s)))
-> m (ListOf ('Mut s) (Struct ('Mut s)))
-> m (List ('Mut s) (ThirdPartyCapId ('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
0 Int
len))
newtype JoinKeyPart msg
    = JoinKeyPart'newtype_ (Untyped.Struct msg)
instance (Classes.FromStruct msg (JoinKeyPart msg)) where
    fromStruct :: Struct msg -> m (JoinKeyPart msg)
fromStruct Struct msg
struct = (JoinKeyPart msg -> m (JoinKeyPart msg)
forall (f :: * -> *) a. Applicative f => a -> f a
Std_.pure (Struct msg -> JoinKeyPart msg
forall (msg :: Mutability). Struct msg -> JoinKeyPart msg
JoinKeyPart'newtype_ Struct msg
struct))
instance (Classes.ToStruct msg (JoinKeyPart msg)) where
    toStruct :: JoinKeyPart msg -> Struct msg
toStruct (JoinKeyPart'newtype_ Struct msg
struct) = Struct msg
struct
instance (Untyped.HasMessage (JoinKeyPart mut) mut) where
    message :: JoinKeyPart mut -> Message mut
message (JoinKeyPart'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 (JoinKeyPart mut) mut) where
    messageDefault :: Message mut -> m (JoinKeyPart mut)
messageDefault Message mut
msg = (Struct mut -> JoinKeyPart mut
forall (msg :: Mutability). Struct msg -> JoinKeyPart msg
JoinKeyPart'newtype_ (Struct mut -> JoinKeyPart mut)
-> m (Struct mut) -> m (JoinKeyPart 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 (JoinKeyPart msg)) where
    fromPtr :: Message msg -> Maybe (Ptr msg) -> m (JoinKeyPart msg)
fromPtr Message msg
msg Maybe (Ptr msg)
ptr = (Struct msg -> JoinKeyPart msg
forall (msg :: Mutability). Struct msg -> JoinKeyPart msg
JoinKeyPart'newtype_ (Struct msg -> JoinKeyPart msg)
-> m (Struct msg) -> m (JoinKeyPart 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 (JoinKeyPart (Message.Mut s))) where
    toPtr :: Message ('Mut s)
-> JoinKeyPart ('Mut s) -> m (Maybe (Ptr ('Mut s)))
toPtr Message ('Mut s)
msg (JoinKeyPart'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 (JoinKeyPart (Message.Mut s))) where
    new :: Message ('Mut s) -> m (JoinKeyPart ('Mut s))
new Message ('Mut s)
msg = (Struct ('Mut s) -> JoinKeyPart ('Mut s)
forall (msg :: Mutability). Struct msg -> JoinKeyPart msg
JoinKeyPart'newtype_ (Struct ('Mut s) -> JoinKeyPart ('Mut s))
-> m (Struct ('Mut s)) -> m (JoinKeyPart ('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 (JoinKeyPart mut)) where
    newtype List mut (JoinKeyPart mut)
        = JoinKeyPart'List_ (Untyped.ListOf mut (Untyped.Struct mut))
    listFromPtr :: Message mut -> Maybe (Ptr mut) -> m (List mut (JoinKeyPart mut))
listFromPtr Message mut
msg Maybe (Ptr mut)
ptr = (ListOf mut (Struct mut) -> List mut (JoinKeyPart mut)
forall (mut :: Mutability).
ListOf mut (Struct mut) -> List mut (JoinKeyPart mut)
JoinKeyPart'List_ (ListOf mut (Struct mut) -> List mut (JoinKeyPart mut))
-> m (ListOf mut (Struct mut)) -> m (List mut (JoinKeyPart 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 (JoinKeyPart mut) -> List mut
toUntypedList (JoinKeyPart'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 (JoinKeyPart mut) -> Int
length (JoinKeyPart'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 (JoinKeyPart mut) -> m (JoinKeyPart mut)
index Int
i (JoinKeyPart'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 (JoinKeyPart 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 (JoinKeyPart (Message.Mut s))) where
    setIndex :: JoinKeyPart ('Mut s)
-> Int -> List ('Mut s) (JoinKeyPart ('Mut s)) -> m ()
setIndex (JoinKeyPart'newtype_ Struct ('Mut s)
elt) Int
i (JoinKeyPart'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) (JoinKeyPart ('Mut s)))
newList Message ('Mut s)
msg Int
len = (ListOf ('Mut s) (Struct ('Mut s))
-> List ('Mut s) (JoinKeyPart ('Mut s))
forall (mut :: Mutability).
ListOf mut (Struct mut) -> List mut (JoinKeyPart mut)
JoinKeyPart'List_ (ListOf ('Mut s) (Struct ('Mut s))
 -> List ('Mut s) (JoinKeyPart ('Mut s)))
-> m (ListOf ('Mut s) (Struct ('Mut s)))
-> m (List ('Mut s) (JoinKeyPart ('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_JoinKeyPart'joinId :: ((Untyped.ReadCtx m msg)) => (JoinKeyPart msg) -> (m Std_.Word32)
get_JoinKeyPart'joinId :: JoinKeyPart msg -> m Word32
get_JoinKeyPart'joinId (JoinKeyPart'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_JoinKeyPart'joinId :: ((Untyped.RWCtx m s)) => (JoinKeyPart (Message.Mut s)) -> Std_.Word32 -> (m ())
set_JoinKeyPart'joinId :: JoinKeyPart ('Mut s) -> Word32 -> m ()
set_JoinKeyPart'joinId (JoinKeyPart'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_JoinKeyPart'partCount :: ((Untyped.ReadCtx m msg)) => (JoinKeyPart msg) -> (m Std_.Word16)
get_JoinKeyPart'partCount :: JoinKeyPart msg -> m Word16
get_JoinKeyPart'partCount (JoinKeyPart'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_JoinKeyPart'partCount :: ((Untyped.RWCtx m s)) => (JoinKeyPart (Message.Mut s)) -> Std_.Word16 -> (m ())
set_JoinKeyPart'partCount :: JoinKeyPart ('Mut s) -> Word16 -> m ()
set_JoinKeyPart'partCount (JoinKeyPart'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_JoinKeyPart'partNum :: ((Untyped.ReadCtx m msg)) => (JoinKeyPart msg) -> (m Std_.Word16)
get_JoinKeyPart'partNum :: JoinKeyPart msg -> m Word16
get_JoinKeyPart'partNum (JoinKeyPart'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
48 Word64
0)
set_JoinKeyPart'partNum :: ((Untyped.RWCtx m s)) => (JoinKeyPart (Message.Mut s)) -> Std_.Word16 -> (m ())
set_JoinKeyPart'partNum :: JoinKeyPart ('Mut s) -> Word16 -> m ()
set_JoinKeyPart'partNum (JoinKeyPart'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 JoinResult msg
    = JoinResult'newtype_ (Untyped.Struct msg)
instance (Classes.FromStruct msg (JoinResult msg)) where
    fromStruct :: Struct msg -> m (JoinResult msg)
fromStruct Struct msg
struct = (JoinResult msg -> m (JoinResult msg)
forall (f :: * -> *) a. Applicative f => a -> f a
Std_.pure (Struct msg -> JoinResult msg
forall (msg :: Mutability). Struct msg -> JoinResult msg
JoinResult'newtype_ Struct msg
struct))
instance (Classes.ToStruct msg (JoinResult msg)) where
    toStruct :: JoinResult msg -> Struct msg
toStruct (JoinResult'newtype_ Struct msg
struct) = Struct msg
struct
instance (Untyped.HasMessage (JoinResult mut) mut) where
    message :: JoinResult mut -> Message mut
message (JoinResult'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 (JoinResult mut) mut) where
    messageDefault :: Message mut -> m (JoinResult mut)
messageDefault Message mut
msg = (Struct mut -> JoinResult mut
forall (msg :: Mutability). Struct msg -> JoinResult msg
JoinResult'newtype_ (Struct mut -> JoinResult mut)
-> m (Struct mut) -> m (JoinResult 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 (JoinResult msg)) where
    fromPtr :: Message msg -> Maybe (Ptr msg) -> m (JoinResult msg)
fromPtr Message msg
msg Maybe (Ptr msg)
ptr = (Struct msg -> JoinResult msg
forall (msg :: Mutability). Struct msg -> JoinResult msg
JoinResult'newtype_ (Struct msg -> JoinResult msg)
-> m (Struct msg) -> m (JoinResult 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 (JoinResult (Message.Mut s))) where
    toPtr :: Message ('Mut s) -> JoinResult ('Mut s) -> m (Maybe (Ptr ('Mut s)))
toPtr Message ('Mut s)
msg (JoinResult'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 (JoinResult (Message.Mut s))) where
    new :: Message ('Mut s) -> m (JoinResult ('Mut s))
new Message ('Mut s)
msg = (Struct ('Mut s) -> JoinResult ('Mut s)
forall (msg :: Mutability). Struct msg -> JoinResult msg
JoinResult'newtype_ (Struct ('Mut s) -> JoinResult ('Mut s))
-> m (Struct ('Mut s)) -> m (JoinResult ('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 (JoinResult mut)) where
    newtype List mut (JoinResult mut)
        = JoinResult'List_ (Untyped.ListOf mut (Untyped.Struct mut))
    listFromPtr :: Message mut -> Maybe (Ptr mut) -> m (List mut (JoinResult mut))
listFromPtr Message mut
msg Maybe (Ptr mut)
ptr = (ListOf mut (Struct mut) -> List mut (JoinResult mut)
forall (mut :: Mutability).
ListOf mut (Struct mut) -> List mut (JoinResult mut)
JoinResult'List_ (ListOf mut (Struct mut) -> List mut (JoinResult mut))
-> m (ListOf mut (Struct mut)) -> m (List mut (JoinResult 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 (JoinResult mut) -> List mut
toUntypedList (JoinResult'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 (JoinResult mut) -> Int
length (JoinResult'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 (JoinResult mut) -> m (JoinResult mut)
index Int
i (JoinResult'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 (JoinResult 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 (JoinResult (Message.Mut s))) where
    setIndex :: JoinResult ('Mut s)
-> Int -> List ('Mut s) (JoinResult ('Mut s)) -> m ()
setIndex (JoinResult'newtype_ Struct ('Mut s)
elt) Int
i (JoinResult'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) (JoinResult ('Mut s)))
newList Message ('Mut s)
msg Int
len = (ListOf ('Mut s) (Struct ('Mut s))
-> List ('Mut s) (JoinResult ('Mut s))
forall (mut :: Mutability).
ListOf mut (Struct mut) -> List mut (JoinResult mut)
JoinResult'List_ (ListOf ('Mut s) (Struct ('Mut s))
 -> List ('Mut s) (JoinResult ('Mut s)))
-> m (ListOf ('Mut s) (Struct ('Mut s)))
-> m (List ('Mut s) (JoinResult ('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_JoinResult'joinId :: ((Untyped.ReadCtx m msg)) => (JoinResult msg) -> (m Std_.Word32)
get_JoinResult'joinId :: JoinResult msg -> m Word32
get_JoinResult'joinId (JoinResult'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_JoinResult'joinId :: ((Untyped.RWCtx m s)) => (JoinResult (Message.Mut s)) -> Std_.Word32 -> (m ())
set_JoinResult'joinId :: JoinResult ('Mut s) -> Word32 -> m ()
set_JoinResult'joinId (JoinResult'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_JoinResult'succeeded :: ((Untyped.ReadCtx m msg)) => (JoinResult msg) -> (m Std_.Bool)
get_JoinResult'succeeded :: JoinResult msg -> m Bool
get_JoinResult'succeeded (JoinResult'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_JoinResult'succeeded :: ((Untyped.RWCtx m s)) => (JoinResult (Message.Mut s)) -> Std_.Bool -> (m ())
set_JoinResult'succeeded :: JoinResult ('Mut s) -> Bool -> m ()
set_JoinResult'succeeded (JoinResult'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)
get_JoinResult'cap :: ((Untyped.ReadCtx m msg)
                      ,(Classes.FromPtr msg (Std_.Maybe (Untyped.Ptr msg)))) => (JoinResult msg) -> (m (Std_.Maybe (Untyped.Ptr msg)))
get_JoinResult'cap :: JoinResult msg -> m (Maybe (Ptr msg))
get_JoinResult'cap (JoinResult'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_JoinResult'cap :: ((Untyped.RWCtx m s)
                      ,(Classes.ToPtr s (Std_.Maybe (Untyped.Ptr (Message.Mut s))))) => (JoinResult (Message.Mut s)) -> (Std_.Maybe (Untyped.Ptr (Message.Mut s))) -> (m ())
set_JoinResult'cap :: JoinResult ('Mut s) -> Maybe (Ptr ('Mut s)) -> m ()
set_JoinResult'cap (JoinResult'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_JoinResult'cap :: ((Untyped.ReadCtx m msg)) => (JoinResult msg) -> (m Std_.Bool)
has_JoinResult'cap :: JoinResult msg -> m Bool
has_JoinResult'cap (JoinResult'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))