Crate mpstthree[−][src]
Expand description
[docs-rs]: https://img.shields.io/badge/docs.rs-66c2a5?style=for-the-badge&labelColor=555555&logoColor=white&logo=data: image/svg+xml;base64,PHN2ZyByb2xlPSJpbWciIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgdmlld0JveD0iMCAwIDUxMiA1MTIiPjxwYXRoIGZpbGw9IiNmNWY1ZjUiIGQ9Ik00ODguNiAyNTAuMkwzOTIgMjE0VjEwNS41YzAtMTUtOS4zLTI4LjQtMjMuNC0zMy43bC0xMDAtMzcuNWMtOC4xLTMuMS0xNy4xLTMuMS0yNS4zIDBsLTEwMCAzNy41Yy0xNC4xIDUuMy0yMy40IDE4LjctMjMuNCAzMy43VjIxNGwtOTYuNiAzNi4yQzkuMyAyNTUuNSAwIDI2OC45IDAgMjgzLjlWMzk0YzAgMTMuNiA3LjcgMjYuMSAxOS45IDMyLjJsMTAwIDUwYzEwLjEgNS4xIDIyLjEgNS4xIDMyLjIgMGwxMDMuOS01MiAxMDMuOSA1MmMxMC4xIDUuMSAyMi4xIDUuMSAzMi4yIDBsMTAwLTUwYzEyLjItNi4xIDE5LjktMTguNiAxOS45LTMyLjJWMjgzLjljMC0xNS05LjMtMjguNC0yMy40LTMzLjd6TTM1OCAyMTQuOGwtODUgMzEuOXYtNjguMmw4NS0zN3Y3My4zek0xNTQgMTA0LjFsMTAyLTM4LjIgMTAyIDM4LjJ2LjZsLTEwMiA0MS40LTEwMi00MS40di0uNnptODQgMjkxLjFsLTg1IDQyLjV2LTc5LjFsODUtMzguOHY3NS40em0wLTExMmwtMTAyIDQxLjQtMTAyLTQxLjR2LS42bDEwMi0zOC4yIDEwMiAzOC4ydi42em0yNDAgMTEybC04NSA0Mi41di03OS4xbDg1LTM4Ljh2NzUuNHptMC0xMTJsLTEwMiA0MS40LTEwMi00MS40di0uNmwxMDItMzguMiAxMDIgMzguMnYuNnoiPjwvcGF0aD48L3N2Zz4K
Mpstthree (also called Multi-Crusty) is a library to write and check communication protocols based on Multiparty Session Types.
Currently this library is geared toward use with Scribble and New Scribble for full checking of protocols.
Modules
The slightly modified binary session type library.
This module is a beta feature that only works with RoleA, RoleB and RoleC. It also has various prerequisites that are shown in tests 06.
This module contains the functions for forking the different endpoints.
This module contains all the functions that are used
for consuming [mpstthree::meshedchannels::MeshedChannels
].
This module contains all the macros that are used for the parametrisation on the name and number of participants.
The main structure used for representing a participant, also named a party, within a protocol.
The main trait used for representing an ordering or the name of a participant.
Macros
Broadcast a session from the first participant to others. Creates the function that will be direcly sent
Create a new SessionMST structuren, new roles and the baking environment.
Create a new SessionMST structuren, new roles and the baking environment. Also create the macros needed for choosing branches. Each macro is linked to a role X and are called as followed: choose_mpst_x_to_all!( s, # the current session enum_1::variant_1, # the first branch for the first passive role enum_2::variant_2, # the first branch for the second passive role … enum_n::variant_n, # the first branch for the n-th passive role )
Creates thestructure SessionMPST
mpstthree::create_meshedchannels
,
the mpstthree::close_mpst
and
mpstthree::fork_mpst_multi
.
Creates thestructure SessionMPST
mpstthree::create_meshedchannels
,
the mpstthree::close_mpst_cancel
and
mpstthree::fork_mpst_multi
functions to be used with more than 2 participants.
It checks the send sides of the channels along the recv sides.
Choose between many different sessions wrapped in an
enum
Choose, for A, among two different sessions
Choose, for B, among two different sessions
Choose, for C, among two different sessions
Create a macro that simplifies the usage of
mpstthree::choose_mpst_multi_to_all
Choose among different sessions that are provided, may fail because of a canceled session. Need to exclude the first participant
Choose among different sessions that are provided.
Choose among different sessions that are provided.
Choose among two different sessions.
Must be used with mpstthree::meshedchannels::MeshedChannels
.
Choose between many different sessions wrapped in an
enum
CLOSE Create the close function to be used with more than 3 participants.
Create the close function to be used with more than 3 participants. It is used for checking the send sides upon closing.
Create the close function to be used with more than 3 participants.
Create a new broadcast mpstthree::role::Role
and its dual.
A broadcast mpstthree::role::Role
is used for sending a
choice. Its dual is used for receving this choice.
Create a new broadcast mpstthree::role::Role
and its dual.
A broadcast mpstthree::role::Role
is used for sending a
choice. Its dual is used for receving this choice.
When a name X is given, the Roles created are
Call both
mpstthree::create_choose_right_from_1_to_2_and_3
and mpstthree::create_choose_left_from_1_to_2_and_3
.
Must be used with mpstthree::meshedchannels::MeshedChannels
.
Call both
mpstthree::create_choose_right_from_2_to_1_and_3
and mpstthree::create_choose_left_from_2_to_1_and_3
.
Must be used with mpstthree::meshedchannels::MeshedChannels
.
Call both
mpstthree::create_choose_right_from_3_to_1_and_2
and mpstthree::create_choose_left_from_3_to_1_and_2
.
Must be used with mpstthree::meshedchannels::MeshedChannels
.
Create the ChooseMpst function to send a Choose
left branch from the first role to the others. Must be
used with mpstthree::meshedchannels::MeshedChannels
.
Create the ChooseMpst function to send a Choose
left branch from the second role to the others. Must be
used with mpstthree::meshedchannels::MeshedChannels
.
Create the ChooseMpst function to send a Choose
left branch from the third role to the others. Must be
used with mpstthree::meshedchannels::MeshedChannels
.
Create the two ChooseMpst functions to send a Choose on each branch to be used with more than 3 participants. Only works when active role is the last one (TODO: adapt to any index role).
Create the ChooseMpst function to send a Choose left branch to be used with more than 3 participants. Only works when active role is the last one (TODO: adapt to any index role).
Create the ChooseMpst function to send a Choose right branch to be used with more than 3 participants. Only works when active role is the last one (TODO: adapt to any index role).
Create the ChooseMpst function to send a Choose
right branch from the first role to the others. Must be
used with mpstthree::meshedchannels::MeshedChannels
.
Create the ChooseMpst function to send a Choose
right branch from the second role to the others. Must
be used with mpstthree::meshedchannels::MeshedChannels
.
Create the ChooseMpst function to send a Choose
right branch from the third role to the others. Must be
used with mpstthree::meshedchannels::MeshedChannels
.
CHOICE Create the ChooseMpst type to be used with more than 3 participants.
Create choose fuunctions, to choose among different sessions that are provided.
Create choose fuunctions, to choose among different sessions that are provided.
MeshedChannels Creates a MeshedChannels for more than 3 participants.
Create multiple new broadcast mpstthree::role::Role
and its dual.
A broadcast mpstthree::role::Role
is used for
sending a choice. Its dual is used for receving this choice.
Create multiple new broadcast mpstthree::role::Role
and its dual.
A broadcast mpstthree::role::Role
is used for
sending a choice. Its dual is used for receving this choice.
When a name X is given, the Roles created are
Create multiple new mpstthree::role::Role
and its dual.
Create multiple new mpstthree::role::Role
and its dual.
When a name X is given, the Roles created are
Create a new mpstthree::role::Role
and its dual.
Create a new mpstthree::role::Role
and its dual.
When a name X is given, the Roles created are
OFFER
Create an offer function to recv on the first binary
session from any kind of role. Must be used with
mpstthree::meshedchannels::MeshedChannels
.
Create an offer function to recv on the second binary
session from any kind of role. Must be used with
mpstthree::meshedchannels::MeshedChannels
.
Creates an OfferMpst function to receive an offer on a given binary session type of a MeshedChannels.
OFFER Create the OfferMpst type to be used with more than 3 participants.
Creates a recv function to receive from a simple role on a given binary session type of a MeshedChannels.
Creates multiple recv functions to receive from a simple role on a given binary session type of a MeshedChannels.
Creates a recv function to receive from a broadcasting role on a given binary session type of a MeshedChannels.
Creates a recv function to receive from a simple role on a given binary session type of a MeshedChannels.
RECV
Create a recv function to recv on the first binary
session from any kind of role. Must be used with
mpstthree::meshedchannels::MeshedChannels
.
Create a recv function to recv on the second binary
session from any kind of role. Must be used with
mpstthree::meshedchannels::MeshedChannels
.
Creates multiple recv functions to receive from a simple role on a given binary session type of a MeshedChannels.
Creates a send function to send from a given binary session type of a MeshedChannels with more than 3 participants. Checks if the first binary session has a “cancel” signal and panic if yes. The send function will try to send and panic if not possible (canceled session).
Creates multiple send functions to send from a given binary session type of a MeshedChannels with more than 3 participants.
Creates a send function to send from a given binary session type of a MeshedChannels with more than 3 participants.
Creates a send function to send from a given binary session type of a MeshedChannels with more than 3 participants. The send function will try to send and panic if not possible (canceled session).
Creates multiple send functions to send from a given binary session type of a MeshedChannels with more than 3 participants.
Creates multiple send functions to send from a given binary session type of a MeshedChannels with more than 3 participants.
Creates a send function to send from a given binary session type of a MeshedChannels with more than 3 participants.
SEND
Create a send function to send on the first binary
session from any kind of role. Must be used with
mpstthree::meshedchannels::MeshedChannels
.
Create a send function to send on the second binary
session from any kind of role. Must be used with
mpstthree::meshedchannels::MeshedChannels
.
Creates multiple send functions to send from a given binary session type of a MeshedChannels with more than 3 participants.
FORK
Creates the fork function to be used with more than 3
participants. It must be used with
mpstthree::fork_simple
Offer a choice between many different sessions wrapped
in an enum
Offer a choice and send the session to the pawn
Offer a choice between many different sessions wrapped in an enum
. Used with http functions
Offer a choice between many different sessions wrapped in an enum
Offer a choice to A from B between many different
sessions wrapped in an enum
Offer a choice to A from C between many different
sessions wrapped in an enum
Offer a choice to B from A between many different
sessions wrapped in an enum
Offer a choice to B from C between many different
sessions wrapped in an enum
Offer a choice to C from A between many different
sessions wrapped in an enum
Offer a choice to C from B between many different
sessions wrapped in an enum
Offer a choice between many different sessions wrapped
in an enum
RECV Shorter way to call the code within the recv function instead of having to create the function itself.
CHOICE Cancels a session
SEND Shorter way to call the code within the send function instead of having to create the function itself.