Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- newtype MiniProtocolBundle (mode :: MuxMode) = MiniProtocolBundle [MiniProtocolInfo mode]
- data MiniProtocolInfo (mode :: MuxMode) = MiniProtocolInfo {}
- newtype MiniProtocolNum = MiniProtocolNum Word16
- data MiniProtocolDirection (mode :: MuxMode) where
- newtype MiniProtocolLimits = MiniProtocolLimits {}
- data MuxMode where
- type family HasInitiator (mode :: MuxMode) :: Bool where ...
- type family HasResponder (mode :: MuxMode) :: Bool where ...
- type IngressQueue (m :: Type -> Type) = StrictTVar m ByteString
- data MiniProtocolIx
- data MiniProtocolDir
- protocolDirEnum :: forall (mode :: MuxMode). MiniProtocolDirection mode -> MiniProtocolDir
- data MiniProtocolState (mode :: MuxMode) (m :: Type -> Type) = MiniProtocolState {}
- data MiniProtocolStatus
- data MuxBearer (m :: Type -> Type) = MuxBearer {}
- muxBearerAsChannel :: forall (m :: Type -> Type). Functor m => MuxBearer m -> MiniProtocolNum -> MiniProtocolDir -> Channel m
- data MuxSDU = MuxSDU {
- msHeader :: !MuxSDUHeader
- msBlob :: !ByteString
- data MuxSDUHeader = MuxSDUHeader {}
- newtype SDUSize = SDUSize {
- getSDUSize :: Word16
- msTimestamp :: MuxSDU -> RemoteClockModel
- setTimestamp :: MuxSDU -> RemoteClockModel -> MuxSDU
- msNum :: MuxSDU -> MiniProtocolNum
- msDir :: MuxSDU -> MiniProtocolDir
- msLength :: MuxSDU -> Word16
- newtype RemoteClockModel = RemoteClockModel {}
- remoteClockPrecision :: DiffTime
- data MuxRuntimeError
Documentation
newtype MiniProtocolBundle (mode :: MuxMode) Source #
Application run by mux layer.
- enumeration of client application, e.g. a wallet application communicating with a node using ChainSync and TxSubmission protocols; this only requires to run client side of each protocol.
- enumeration of server applications: this application type is mostly useful tests.
- enumeration of both client and server applications, e.g. a full node serving downstream peers using server side of each protocol and getting updates from upstream peers using client side of each of the protocols.
data MiniProtocolInfo (mode :: MuxMode) Source #
newtype MiniProtocolNum Source #
The wire format includes the protocol numbers, and it's vital that these
are stable. They are not necessarily dense however, as new ones are added
and some old ones retired. So we use a dedicated class for this rather than
reusing Enum
. This also covers unrecognised protocol numbers on the
decoding side.
Instances
data MiniProtocolDirection (mode :: MuxMode) where Source #
Instances
Eq (MiniProtocolDirection mode) Source # | |
Defined in Network.Mux.Types (==) :: MiniProtocolDirection mode -> MiniProtocolDirection mode -> Bool # (/=) :: MiniProtocolDirection mode -> MiniProtocolDirection mode -> Bool # | |
Ord (MiniProtocolDirection mode) Source # | |
Defined in Network.Mux.Types compare :: MiniProtocolDirection mode -> MiniProtocolDirection mode -> Ordering # (<) :: MiniProtocolDirection mode -> MiniProtocolDirection mode -> Bool # (<=) :: MiniProtocolDirection mode -> MiniProtocolDirection mode -> Bool # (>) :: MiniProtocolDirection mode -> MiniProtocolDirection mode -> Bool # (>=) :: MiniProtocolDirection mode -> MiniProtocolDirection mode -> Bool # max :: MiniProtocolDirection mode -> MiniProtocolDirection mode -> MiniProtocolDirection mode # min :: MiniProtocolDirection mode -> MiniProtocolDirection mode -> MiniProtocolDirection mode # |
newtype MiniProtocolLimits Source #
Per Miniprotocol limits
MiniProtocolLimits | |
|
type family HasInitiator (mode :: MuxMode) :: Bool where ... Source #
type family HasResponder (mode :: MuxMode) :: Bool where ... Source #
type IngressQueue (m :: Type -> Type) = StrictTVar m ByteString Source #
data MiniProtocolIx Source #
The index of a protocol in a MuxApplication, used for array indices
Instances
data MiniProtocolDir Source #
Instances
protocolDirEnum :: forall (mode :: MuxMode). MiniProtocolDirection mode -> MiniProtocolDir Source #
data MiniProtocolStatus Source #
Instances
Show MiniProtocolStatus Source # | |
Defined in Network.Mux.Types showsPrec :: Int -> MiniProtocolStatus -> ShowS # show :: MiniProtocolStatus -> String # showList :: [MiniProtocolStatus] -> ShowS # | |
Eq MiniProtocolStatus Source # | |
Defined in Network.Mux.Types (==) :: MiniProtocolStatus -> MiniProtocolStatus -> Bool # (/=) :: MiniProtocolStatus -> MiniProtocolStatus -> Bool # |
data MuxBearer (m :: Type -> Type) Source #
Low level access to underlying socket or pipe. There are three smart constructors:
socketAsMuxBearer
pipeAsMuxBearer
Test.Mux.queuesAsMuxBearer
muxBearerAsChannel :: forall (m :: Type -> Type). Functor m => MuxBearer m -> MiniProtocolNum -> MiniProtocolDir -> Channel m Source #
A channel which wraps each message as an MuxSDU
using giving
MiniProtocolNum
and MiniProtocolDir
.
MuxSDU | |
|
data MuxSDUHeader Source #
MuxSDUHeader | |
|
msTimestamp :: MuxSDU -> RemoteClockModel Source #
setTimestamp :: MuxSDU -> RemoteClockModel -> MuxSDU Source #
msNum :: MuxSDU -> MiniProtocolNum Source #
msDir :: MuxSDU -> MiniProtocolDir Source #
newtype RemoteClockModel Source #
Instances
Bounded RemoteClockModel Source # | |
Defined in Network.Mux.Types | |
Eq RemoteClockModel Source # | |
Defined in Network.Mux.Types (==) :: RemoteClockModel -> RemoteClockModel -> Bool # (/=) :: RemoteClockModel -> RemoteClockModel -> Bool # |
remoteClockPrecision :: DiffTime Source #
The DiffTime
represented by a tick in the RemoteClockModel
data MuxRuntimeError Source #
ProtocolAlreadyRunning !MiniProtocolNum !MiniProtocolDir !MiniProtocolStatus | |
UnknownProtocolInternalError !MiniProtocolNum !MiniProtocolDir | |
MuxBlockedOnCompletionVar !MiniProtocolNum |
Instances
Exception MuxRuntimeError Source # | |
Defined in Network.Mux.Types | |
Show MuxRuntimeError Source # | |
Defined in Network.Mux.Types showsPrec :: Int -> MuxRuntimeError -> ShowS # show :: MuxRuntimeError -> String # showList :: [MuxRuntimeError] -> ShowS # |