Safe Haskell | None |
---|---|
Language | Haskell2010 |
Documentation
class Transport transport where Source #
data TransportConfig transport Source #
newTransport :: TransportConfig transport -> IO transport Source #
recvData :: transport -> Int -> IO ByteString Source #
sendData :: transport -> ByteString -> IO () Source #
closeTransport :: transport -> IO () Source #
Instances
Transport BSTransport Source # | |
Defined in Metro.TP.BS newTransport :: TransportConfig BSTransport -> IO BSTransport Source # recvData :: BSTransport -> Int -> IO ByteString Source # sendData :: BSTransport -> ByteString -> IO () Source # closeTransport :: BSTransport -> IO () Source # | |
Transport tp => Transport (Debug tp) Source # | |
Defined in Metro.TP.Debug data TransportConfig (Debug tp) Source # newTransport :: TransportConfig (Debug tp) -> IO (Debug tp) Source # recvData :: Debug tp -> Int -> IO ByteString Source # sendData :: Debug tp -> ByteString -> IO () Source # closeTransport :: Debug tp -> IO () Source # |
data TransportError Source #
Instances
Eq TransportError Source # | |
Defined in Metro.Class (==) :: TransportError -> TransportError -> Bool # (/=) :: TransportError -> TransportError -> Bool # | |
Ord TransportError Source # | |
Defined in Metro.Class compare :: TransportError -> TransportError -> Ordering # (<) :: TransportError -> TransportError -> Bool # (<=) :: TransportError -> TransportError -> Bool # (>) :: TransportError -> TransportError -> Bool # (>=) :: TransportError -> TransportError -> Bool # max :: TransportError -> TransportError -> TransportError # min :: TransportError -> TransportError -> TransportError # | |
Show TransportError Source # | |
Defined in Metro.Class showsPrec :: Int -> TransportError -> ShowS # show :: TransportError -> String # showList :: [TransportError] -> ShowS # | |
Exception TransportError Source # | |
Defined in Metro.Class |
class Servable serv where Source #
newServer :: MonadIO m => ServerConfig serv -> m serv Source #
servOnce :: MonadUnliftIO m => serv -> (Maybe (SID serv, TransportConfig (STP serv)) -> m ()) -> m () Source #
onConnEnter :: MonadIO m => serv -> SID serv -> m () Source #
onConnLeave :: MonadIO m => serv -> SID serv -> m () Source #
class RecvPacket rpkt where Source #
recvPacket :: MonadIO m => (Int -> m ByteString) -> m rpkt Source #
class SendPacket spkt where Source #
Nothing
sendPacket :: MonadIO m => spkt -> (ByteString -> m ()) -> m () Source #
default sendPacket :: (MonadIO m, Binary spkt) => spkt -> (ByteString -> m ()) -> m () Source #
sendBinary :: (MonadIO m, Binary spkt) => spkt -> (ByteString -> m ()) -> m () Source #
class SetPacketId k pkt where Source #
setPacketId :: k -> pkt -> pkt Source #
class GetPacketId k pkt where Source #
getPacketId :: pkt -> k Source #