diff --git a/Directory.Build.props b/Directory.Build.props index b6fc8cf18..fc7c5f0f7 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -28,11 +28,11 @@ - - - - - + + + + + diff --git a/Directory.Build.rsp b/Directory.Build.rsp new file mode 100644 index 000000000..9a833a034 --- /dev/null +++ b/Directory.Build.rsp @@ -0,0 +1,16 @@ +#------------------------------------------------------------------------------ +# This file contains command-line options that MSBuild will process as part of +# every build, unless the "/noautoresponse" switch is specified. +# +# MSBuild processes the options in this file first, before processing the +# options on the command line. As a result, options on the command line can +# override the options in this file. However, depending on the options being +# set, the overriding can also result in conflicts. +# +# NOTE: The "/noautoresponse" switch cannot be specified in this file, nor in +# any response file that is referenced by this file. +#------------------------------------------------------------------------------ +/nr:false +/m +/verbosity:minimal +/clp:Summary;ForceNoAlign diff --git a/MessagePack.sln b/MessagePack.sln index 6157da344..77d762b8a 100644 --- a/MessagePack.sln +++ b/MessagePack.sln @@ -34,8 +34,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MessagePack.ImmutableCollec EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MessagePackAnalyzer", "src\MessagePackAnalyzer\MessagePackAnalyzer.csproj", "{2F9A6E0C-DE95-4460-96B7-EB72BBEAEE9E}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MessagePackAnalyzer.Vsix", "src\MessagePackAnalyzer.Vsix\MessagePackAnalyzer.Vsix.csproj", "{09B87BEB-D9A3-4EEB-B56A-ED53D27DF1A3}" -EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "PerfNetFramework", "sandbox\PerfNetFramework\PerfNetFramework.csproj", "{014A3DCE-50A6-4774-A4C1-C66EEAB67133}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MessagePack.AspNetCoreMvcFormatter", "src\MessagePack.AspNetCoreMvcFormatter\MessagePack.AspNetCoreMvcFormatter.csproj", "{17831017-C29C-4A48-B159-849BCE5079FB}" @@ -88,228 +86,122 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MessagePack.Experimental", EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MessagePack.Experimental.Tests", "tests\MessagePack.Experimental.Tests\MessagePack.Experimental.Tests.csproj", "{8AB40D1C-1134-4D77-B39A-19AEDC729450}" EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MessagePack.GeneratedCode.Tests", "tests\MessagePack.GeneratedCode.Tests\MessagePack.GeneratedCode.Tests.csproj", "{D4CE7347-CEBE-46E5-BD12-1319573B6C5E}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU - Debug|NoVSIX = Debug|NoVSIX Release|Any CPU = Release|Any CPU - Release|NoVSIX = Release|NoVSIX EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution {7ABB33EE-A2F1-492B-8DAF-5DF89F0F0B79}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {7ABB33EE-A2F1-492B-8DAF-5DF89F0F0B79}.Debug|Any CPU.Build.0 = Debug|Any CPU - {7ABB33EE-A2F1-492B-8DAF-5DF89F0F0B79}.Debug|NoVSIX.ActiveCfg = Debug|Any CPU - {7ABB33EE-A2F1-492B-8DAF-5DF89F0F0B79}.Debug|NoVSIX.Build.0 = Debug|Any CPU {7ABB33EE-A2F1-492B-8DAF-5DF89F0F0B79}.Release|Any CPU.ActiveCfg = Release|Any CPU {7ABB33EE-A2F1-492B-8DAF-5DF89F0F0B79}.Release|Any CPU.Build.0 = Release|Any CPU - {7ABB33EE-A2F1-492B-8DAF-5DF89F0F0B79}.Release|NoVSIX.ActiveCfg = Release|Any CPU - {7ABB33EE-A2F1-492B-8DAF-5DF89F0F0B79}.Release|NoVSIX.Build.0 = Release|Any CPU {9E1A55CA-711D-4F58-A332-735960E3434C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {9E1A55CA-711D-4F58-A332-735960E3434C}.Debug|Any CPU.Build.0 = Debug|Any CPU - {9E1A55CA-711D-4F58-A332-735960E3434C}.Debug|NoVSIX.ActiveCfg = Debug|Any CPU - {9E1A55CA-711D-4F58-A332-735960E3434C}.Debug|NoVSIX.Build.0 = Debug|Any CPU {9E1A55CA-711D-4F58-A332-735960E3434C}.Release|Any CPU.ActiveCfg = Release|Any CPU {9E1A55CA-711D-4F58-A332-735960E3434C}.Release|Any CPU.Build.0 = Release|Any CPU - {9E1A55CA-711D-4F58-A332-735960E3434C}.Release|NoVSIX.ActiveCfg = Release|Any CPU - {9E1A55CA-711D-4F58-A332-735960E3434C}.Release|NoVSIX.Build.0 = Release|Any CPU {ED43BDA5-947C-4769-A47A-F07D3C6142AE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {ED43BDA5-947C-4769-A47A-F07D3C6142AE}.Debug|Any CPU.Build.0 = Debug|Any CPU - {ED43BDA5-947C-4769-A47A-F07D3C6142AE}.Debug|NoVSIX.ActiveCfg = Debug|Any CPU - {ED43BDA5-947C-4769-A47A-F07D3C6142AE}.Debug|NoVSIX.Build.0 = Debug|Any CPU {ED43BDA5-947C-4769-A47A-F07D3C6142AE}.Release|Any CPU.ActiveCfg = Release|Any CPU {ED43BDA5-947C-4769-A47A-F07D3C6142AE}.Release|Any CPU.Build.0 = Release|Any CPU - {ED43BDA5-947C-4769-A47A-F07D3C6142AE}.Release|NoVSIX.ActiveCfg = Release|Any CPU - {ED43BDA5-947C-4769-A47A-F07D3C6142AE}.Release|NoVSIX.Build.0 = Release|Any CPU {8E511130-F838-4B47-842B-0FB27AD175B5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {8E511130-F838-4B47-842B-0FB27AD175B5}.Debug|Any CPU.Build.0 = Debug|Any CPU - {8E511130-F838-4B47-842B-0FB27AD175B5}.Debug|NoVSIX.ActiveCfg = Debug|Any CPU - {8E511130-F838-4B47-842B-0FB27AD175B5}.Debug|NoVSIX.Build.0 = Debug|Any CPU {8E511130-F838-4B47-842B-0FB27AD175B5}.Release|Any CPU.ActiveCfg = Release|Any CPU {8E511130-F838-4B47-842B-0FB27AD175B5}.Release|Any CPU.Build.0 = Release|Any CPU - {8E511130-F838-4B47-842B-0FB27AD175B5}.Release|NoVSIX.ActiveCfg = Release|Any CPU - {8E511130-F838-4B47-842B-0FB27AD175B5}.Release|NoVSIX.Build.0 = Release|Any CPU {3ABC5C4C-2CE4-459E-8666-F2B181C3DEF3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {3ABC5C4C-2CE4-459E-8666-F2B181C3DEF3}.Debug|Any CPU.Build.0 = Debug|Any CPU - {3ABC5C4C-2CE4-459E-8666-F2B181C3DEF3}.Debug|NoVSIX.ActiveCfg = Debug|Any CPU - {3ABC5C4C-2CE4-459E-8666-F2B181C3DEF3}.Debug|NoVSIX.Build.0 = Debug|Any CPU {3ABC5C4C-2CE4-459E-8666-F2B181C3DEF3}.Release|Any CPU.ActiveCfg = Release|Any CPU {3ABC5C4C-2CE4-459E-8666-F2B181C3DEF3}.Release|Any CPU.Build.0 = Release|Any CPU - {3ABC5C4C-2CE4-459E-8666-F2B181C3DEF3}.Release|NoVSIX.ActiveCfg = Release|Any CPU - {3ABC5C4C-2CE4-459E-8666-F2B181C3DEF3}.Release|NoVSIX.Build.0 = Release|Any CPU {C01E1407-7FEC-4C1D-B0B4-74D95A317AA6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {C01E1407-7FEC-4C1D-B0B4-74D95A317AA6}.Debug|Any CPU.Build.0 = Debug|Any CPU - {C01E1407-7FEC-4C1D-B0B4-74D95A317AA6}.Debug|NoVSIX.ActiveCfg = Debug|Any CPU - {C01E1407-7FEC-4C1D-B0B4-74D95A317AA6}.Debug|NoVSIX.Build.0 = Debug|Any CPU {C01E1407-7FEC-4C1D-B0B4-74D95A317AA6}.Release|Any CPU.ActiveCfg = Release|Any CPU {C01E1407-7FEC-4C1D-B0B4-74D95A317AA6}.Release|Any CPU.Build.0 = Release|Any CPU - {C01E1407-7FEC-4C1D-B0B4-74D95A317AA6}.Release|NoVSIX.ActiveCfg = Release|Any CPU - {C01E1407-7FEC-4C1D-B0B4-74D95A317AA6}.Release|NoVSIX.Build.0 = Release|Any CPU {166A16C0-B89F-41AF-956A-235C6CA62C25}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {166A16C0-B89F-41AF-956A-235C6CA62C25}.Debug|Any CPU.Build.0 = Debug|Any CPU - {166A16C0-B89F-41AF-956A-235C6CA62C25}.Debug|NoVSIX.ActiveCfg = Debug|Any CPU - {166A16C0-B89F-41AF-956A-235C6CA62C25}.Debug|NoVSIX.Build.0 = Debug|Any CPU {166A16C0-B89F-41AF-956A-235C6CA62C25}.Release|Any CPU.ActiveCfg = Release|Any CPU {166A16C0-B89F-41AF-956A-235C6CA62C25}.Release|Any CPU.Build.0 = Release|Any CPU - {166A16C0-B89F-41AF-956A-235C6CA62C25}.Release|NoVSIX.ActiveCfg = Release|Any CPU - {166A16C0-B89F-41AF-956A-235C6CA62C25}.Release|NoVSIX.Build.0 = Release|Any CPU {E066F547-7261-4561-AEFC-E64DBFD874F8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {E066F547-7261-4561-AEFC-E64DBFD874F8}.Debug|Any CPU.Build.0 = Debug|Any CPU - {E066F547-7261-4561-AEFC-E64DBFD874F8}.Debug|NoVSIX.ActiveCfg = Debug|Any CPU - {E066F547-7261-4561-AEFC-E64DBFD874F8}.Debug|NoVSIX.Build.0 = Debug|Any CPU {E066F547-7261-4561-AEFC-E64DBFD874F8}.Release|Any CPU.ActiveCfg = Release|Any CPU {E066F547-7261-4561-AEFC-E64DBFD874F8}.Release|Any CPU.Build.0 = Release|Any CPU - {E066F547-7261-4561-AEFC-E64DBFD874F8}.Release|NoVSIX.ActiveCfg = Release|Any CPU - {E066F547-7261-4561-AEFC-E64DBFD874F8}.Release|NoVSIX.Build.0 = Release|Any CPU {2F9A6E0C-DE95-4460-96B7-EB72BBEAEE9E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {2F9A6E0C-DE95-4460-96B7-EB72BBEAEE9E}.Debug|Any CPU.Build.0 = Debug|Any CPU - {2F9A6E0C-DE95-4460-96B7-EB72BBEAEE9E}.Debug|NoVSIX.ActiveCfg = Debug|Any CPU - {2F9A6E0C-DE95-4460-96B7-EB72BBEAEE9E}.Debug|NoVSIX.Build.0 = Debug|Any CPU {2F9A6E0C-DE95-4460-96B7-EB72BBEAEE9E}.Release|Any CPU.ActiveCfg = Release|Any CPU {2F9A6E0C-DE95-4460-96B7-EB72BBEAEE9E}.Release|Any CPU.Build.0 = Release|Any CPU - {2F9A6E0C-DE95-4460-96B7-EB72BBEAEE9E}.Release|NoVSIX.ActiveCfg = Release|Any CPU - {2F9A6E0C-DE95-4460-96B7-EB72BBEAEE9E}.Release|NoVSIX.Build.0 = Release|Any CPU - {09B87BEB-D9A3-4EEB-B56A-ED53D27DF1A3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {09B87BEB-D9A3-4EEB-B56A-ED53D27DF1A3}.Debug|Any CPU.Build.0 = Debug|Any CPU - {09B87BEB-D9A3-4EEB-B56A-ED53D27DF1A3}.Debug|NoVSIX.ActiveCfg = Debug|Any CPU - {09B87BEB-D9A3-4EEB-B56A-ED53D27DF1A3}.Release|Any CPU.ActiveCfg = Release|Any CPU - {09B87BEB-D9A3-4EEB-B56A-ED53D27DF1A3}.Release|Any CPU.Build.0 = Release|Any CPU - {09B87BEB-D9A3-4EEB-B56A-ED53D27DF1A3}.Release|NoVSIX.ActiveCfg = Release|Any CPU {014A3DCE-50A6-4774-A4C1-C66EEAB67133}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {014A3DCE-50A6-4774-A4C1-C66EEAB67133}.Debug|Any CPU.Build.0 = Debug|Any CPU - {014A3DCE-50A6-4774-A4C1-C66EEAB67133}.Debug|NoVSIX.ActiveCfg = Debug|Any CPU - {014A3DCE-50A6-4774-A4C1-C66EEAB67133}.Debug|NoVSIX.Build.0 = Debug|Any CPU {014A3DCE-50A6-4774-A4C1-C66EEAB67133}.Release|Any CPU.ActiveCfg = Release|Any CPU {014A3DCE-50A6-4774-A4C1-C66EEAB67133}.Release|Any CPU.Build.0 = Release|Any CPU - {014A3DCE-50A6-4774-A4C1-C66EEAB67133}.Release|NoVSIX.ActiveCfg = Release|Any CPU - {014A3DCE-50A6-4774-A4C1-C66EEAB67133}.Release|NoVSIX.Build.0 = Release|Any CPU {17831017-C29C-4A48-B159-849BCE5079FB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {17831017-C29C-4A48-B159-849BCE5079FB}.Debug|Any CPU.Build.0 = Debug|Any CPU - {17831017-C29C-4A48-B159-849BCE5079FB}.Debug|NoVSIX.ActiveCfg = Debug|Any CPU - {17831017-C29C-4A48-B159-849BCE5079FB}.Debug|NoVSIX.Build.0 = Debug|Any CPU {17831017-C29C-4A48-B159-849BCE5079FB}.Release|Any CPU.ActiveCfg = Release|Any CPU {17831017-C29C-4A48-B159-849BCE5079FB}.Release|Any CPU.Build.0 = Release|Any CPU - {17831017-C29C-4A48-B159-849BCE5079FB}.Release|NoVSIX.ActiveCfg = Release|Any CPU - {17831017-C29C-4A48-B159-849BCE5079FB}.Release|NoVSIX.Build.0 = Release|Any CPU {814F94D6-1413-4ACB-B1B5-A3488CAA1E6B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {814F94D6-1413-4ACB-B1B5-A3488CAA1E6B}.Debug|Any CPU.Build.0 = Debug|Any CPU - {814F94D6-1413-4ACB-B1B5-A3488CAA1E6B}.Debug|NoVSIX.ActiveCfg = Debug|Any CPU - {814F94D6-1413-4ACB-B1B5-A3488CAA1E6B}.Debug|NoVSIX.Build.0 = Debug|Any CPU {814F94D6-1413-4ACB-B1B5-A3488CAA1E6B}.Release|Any CPU.ActiveCfg = Release|Any CPU {814F94D6-1413-4ACB-B1B5-A3488CAA1E6B}.Release|Any CPU.Build.0 = Release|Any CPU - {814F94D6-1413-4ACB-B1B5-A3488CAA1E6B}.Release|NoVSIX.ActiveCfg = Release|Any CPU - {814F94D6-1413-4ACB-B1B5-A3488CAA1E6B}.Release|NoVSIX.Build.0 = Release|Any CPU {2A32A538-BA26-4D89-85D0-E4249AFA0837}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {2A32A538-BA26-4D89-85D0-E4249AFA0837}.Debug|Any CPU.Build.0 = Debug|Any CPU - {2A32A538-BA26-4D89-85D0-E4249AFA0837}.Debug|NoVSIX.ActiveCfg = Debug|Any CPU - {2A32A538-BA26-4D89-85D0-E4249AFA0837}.Debug|NoVSIX.Build.0 = Debug|Any CPU {2A32A538-BA26-4D89-85D0-E4249AFA0837}.Release|Any CPU.ActiveCfg = Release|Any CPU {2A32A538-BA26-4D89-85D0-E4249AFA0837}.Release|Any CPU.Build.0 = Release|Any CPU - {2A32A538-BA26-4D89-85D0-E4249AFA0837}.Release|NoVSIX.ActiveCfg = Release|Any CPU - {2A32A538-BA26-4D89-85D0-E4249AFA0837}.Release|NoVSIX.Build.0 = Release|Any CPU {79C2B2CB-872A-4BA9-82DC-60F6DD77F940}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {79C2B2CB-872A-4BA9-82DC-60F6DD77F940}.Debug|Any CPU.Build.0 = Debug|Any CPU - {79C2B2CB-872A-4BA9-82DC-60F6DD77F940}.Debug|NoVSIX.ActiveCfg = Debug|Any CPU - {79C2B2CB-872A-4BA9-82DC-60F6DD77F940}.Debug|NoVSIX.Build.0 = Debug|Any CPU {79C2B2CB-872A-4BA9-82DC-60F6DD77F940}.Release|Any CPU.ActiveCfg = Release|Any CPU {79C2B2CB-872A-4BA9-82DC-60F6DD77F940}.Release|Any CPU.Build.0 = Release|Any CPU - {79C2B2CB-872A-4BA9-82DC-60F6DD77F940}.Release|NoVSIX.ActiveCfg = Release|Any CPU - {79C2B2CB-872A-4BA9-82DC-60F6DD77F940}.Release|NoVSIX.Build.0 = Release|Any CPU {85763F30-7733-44AB-89AB-D1B64F6E0D93}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {85763F30-7733-44AB-89AB-D1B64F6E0D93}.Debug|Any CPU.Build.0 = Debug|Any CPU - {85763F30-7733-44AB-89AB-D1B64F6E0D93}.Debug|NoVSIX.ActiveCfg = Debug|Any CPU - {85763F30-7733-44AB-89AB-D1B64F6E0D93}.Debug|NoVSIX.Build.0 = Debug|Any CPU {85763F30-7733-44AB-89AB-D1B64F6E0D93}.Release|Any CPU.ActiveCfg = Release|Any CPU {85763F30-7733-44AB-89AB-D1B64F6E0D93}.Release|Any CPU.Build.0 = Release|Any CPU - {85763F30-7733-44AB-89AB-D1B64F6E0D93}.Release|NoVSIX.ActiveCfg = Release|Any CPU - {85763F30-7733-44AB-89AB-D1B64F6E0D93}.Release|NoVSIX.Build.0 = Release|Any CPU {4142EA80-FEF4-44A5-8553-1AE84BEBAFED}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {4142EA80-FEF4-44A5-8553-1AE84BEBAFED}.Debug|Any CPU.Build.0 = Debug|Any CPU - {4142EA80-FEF4-44A5-8553-1AE84BEBAFED}.Debug|NoVSIX.ActiveCfg = Debug|Any CPU - {4142EA80-FEF4-44A5-8553-1AE84BEBAFED}.Debug|NoVSIX.Build.0 = Debug|Any CPU {4142EA80-FEF4-44A5-8553-1AE84BEBAFED}.Release|Any CPU.ActiveCfg = Release|Any CPU {4142EA80-FEF4-44A5-8553-1AE84BEBAFED}.Release|Any CPU.Build.0 = Release|Any CPU - {4142EA80-FEF4-44A5-8553-1AE84BEBAFED}.Release|NoVSIX.ActiveCfg = Release|Any CPU - {4142EA80-FEF4-44A5-8553-1AE84BEBAFED}.Release|NoVSIX.Build.0 = Release|Any CPU {C100FBA6-4164-4D6A-A532-5984D2B8DCB0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {C100FBA6-4164-4D6A-A532-5984D2B8DCB0}.Debug|Any CPU.Build.0 = Debug|Any CPU - {C100FBA6-4164-4D6A-A532-5984D2B8DCB0}.Debug|NoVSIX.ActiveCfg = Debug|Any CPU - {C100FBA6-4164-4D6A-A532-5984D2B8DCB0}.Debug|NoVSIX.Build.0 = Debug|Any CPU {C100FBA6-4164-4D6A-A532-5984D2B8DCB0}.Release|Any CPU.ActiveCfg = Release|Any CPU {C100FBA6-4164-4D6A-A532-5984D2B8DCB0}.Release|Any CPU.Build.0 = Release|Any CPU - {C100FBA6-4164-4D6A-A532-5984D2B8DCB0}.Release|NoVSIX.ActiveCfg = Release|Any CPU - {C100FBA6-4164-4D6A-A532-5984D2B8DCB0}.Release|NoVSIX.Build.0 = Release|Any CPU {8D9FD130-7905-47D8-A25C-7FDEE28EA0E8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {8D9FD130-7905-47D8-A25C-7FDEE28EA0E8}.Debug|Any CPU.Build.0 = Debug|Any CPU - {8D9FD130-7905-47D8-A25C-7FDEE28EA0E8}.Debug|NoVSIX.ActiveCfg = Debug|Any CPU - {8D9FD130-7905-47D8-A25C-7FDEE28EA0E8}.Debug|NoVSIX.Build.0 = Debug|Any CPU {8D9FD130-7905-47D8-A25C-7FDEE28EA0E8}.Release|Any CPU.ActiveCfg = Release|Any CPU {8D9FD130-7905-47D8-A25C-7FDEE28EA0E8}.Release|Any CPU.Build.0 = Release|Any CPU - {8D9FD130-7905-47D8-A25C-7FDEE28EA0E8}.Release|NoVSIX.ActiveCfg = Release|Any CPU - {8D9FD130-7905-47D8-A25C-7FDEE28EA0E8}.Release|NoVSIX.Build.0 = Release|Any CPU {9962132D-A271-4E68-ACC1-18FA93462552}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {9962132D-A271-4E68-ACC1-18FA93462552}.Debug|Any CPU.Build.0 = Debug|Any CPU - {9962132D-A271-4E68-ACC1-18FA93462552}.Debug|NoVSIX.ActiveCfg = Debug|Any CPU - {9962132D-A271-4E68-ACC1-18FA93462552}.Debug|NoVSIX.Build.0 = Debug|Any CPU {9962132D-A271-4E68-ACC1-18FA93462552}.Release|Any CPU.ActiveCfg = Release|Any CPU {9962132D-A271-4E68-ACC1-18FA93462552}.Release|Any CPU.Build.0 = Release|Any CPU - {9962132D-A271-4E68-ACC1-18FA93462552}.Release|NoVSIX.ActiveCfg = Release|Any CPU - {9962132D-A271-4E68-ACC1-18FA93462552}.Release|NoVSIX.Build.0 = Release|Any CPU {32C91908-5CAD-4C95-B240-ACBBACAC9476}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {32C91908-5CAD-4C95-B240-ACBBACAC9476}.Debug|Any CPU.Build.0 = Debug|Any CPU - {32C91908-5CAD-4C95-B240-ACBBACAC9476}.Debug|NoVSIX.ActiveCfg = Debug|Any CPU - {32C91908-5CAD-4C95-B240-ACBBACAC9476}.Debug|NoVSIX.Build.0 = Debug|Any CPU {32C91908-5CAD-4C95-B240-ACBBACAC9476}.Release|Any CPU.ActiveCfg = Release|Any CPU {32C91908-5CAD-4C95-B240-ACBBACAC9476}.Release|Any CPU.Build.0 = Release|Any CPU - {32C91908-5CAD-4C95-B240-ACBBACAC9476}.Release|NoVSIX.ActiveCfg = Release|Any CPU - {32C91908-5CAD-4C95-B240-ACBBACAC9476}.Release|NoVSIX.Build.0 = Release|Any CPU {8DB135F5-A6FE-44E4-9853-7B48ED21F21B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {8DB135F5-A6FE-44E4-9853-7B48ED21F21B}.Debug|Any CPU.Build.0 = Debug|Any CPU - {8DB135F5-A6FE-44E4-9853-7B48ED21F21B}.Debug|NoVSIX.ActiveCfg = Debug|Any CPU - {8DB135F5-A6FE-44E4-9853-7B48ED21F21B}.Debug|NoVSIX.Build.0 = Debug|Any CPU {8DB135F5-A6FE-44E4-9853-7B48ED21F21B}.Release|Any CPU.ActiveCfg = Release|Any CPU {8DB135F5-A6FE-44E4-9853-7B48ED21F21B}.Release|Any CPU.Build.0 = Release|Any CPU - {8DB135F5-A6FE-44E4-9853-7B48ED21F21B}.Release|NoVSIX.ActiveCfg = Release|Any CPU - {8DB135F5-A6FE-44E4-9853-7B48ED21F21B}.Release|NoVSIX.Build.0 = Release|Any CPU {7E5FB4B9-A0F5-4B10-A1F3-03AC0BC8265A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {7E5FB4B9-A0F5-4B10-A1F3-03AC0BC8265A}.Debug|Any CPU.Build.0 = Debug|Any CPU - {7E5FB4B9-A0F5-4B10-A1F3-03AC0BC8265A}.Debug|NoVSIX.ActiveCfg = Debug|Any CPU - {7E5FB4B9-A0F5-4B10-A1F3-03AC0BC8265A}.Debug|NoVSIX.Build.0 = Debug|Any CPU {7E5FB4B9-A0F5-4B10-A1F3-03AC0BC8265A}.Release|Any CPU.ActiveCfg = Release|Any CPU {7E5FB4B9-A0F5-4B10-A1F3-03AC0BC8265A}.Release|Any CPU.Build.0 = Release|Any CPU - {7E5FB4B9-A0F5-4B10-A1F3-03AC0BC8265A}.Release|NoVSIX.ActiveCfg = Release|Any CPU - {7E5FB4B9-A0F5-4B10-A1F3-03AC0BC8265A}.Release|NoVSIX.Build.0 = Release|Any CPU {6AC51E68-4681-463A-B4B6-BD53517244B2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {6AC51E68-4681-463A-B4B6-BD53517244B2}.Debug|Any CPU.Build.0 = Debug|Any CPU - {6AC51E68-4681-463A-B4B6-BD53517244B2}.Debug|NoVSIX.ActiveCfg = Debug|Any CPU - {6AC51E68-4681-463A-B4B6-BD53517244B2}.Debug|NoVSIX.Build.0 = Debug|Any CPU {6AC51E68-4681-463A-B4B6-BD53517244B2}.Release|Any CPU.ActiveCfg = Release|Any CPU {6AC51E68-4681-463A-B4B6-BD53517244B2}.Release|Any CPU.Build.0 = Release|Any CPU - {6AC51E68-4681-463A-B4B6-BD53517244B2}.Release|NoVSIX.ActiveCfg = Release|Any CPU - {6AC51E68-4681-463A-B4B6-BD53517244B2}.Release|NoVSIX.Build.0 = Release|Any CPU {4C9BB260-62D8-49CD-9F9C-9AA6A8BFC637}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {4C9BB260-62D8-49CD-9F9C-9AA6A8BFC637}.Debug|Any CPU.Build.0 = Debug|Any CPU - {4C9BB260-62D8-49CD-9F9C-9AA6A8BFC637}.Debug|NoVSIX.ActiveCfg = Debug|Any CPU - {4C9BB260-62D8-49CD-9F9C-9AA6A8BFC637}.Debug|NoVSIX.Build.0 = Debug|Any CPU {4C9BB260-62D8-49CD-9F9C-9AA6A8BFC637}.Release|Any CPU.ActiveCfg = Release|Any CPU {4C9BB260-62D8-49CD-9F9C-9AA6A8BFC637}.Release|Any CPU.Build.0 = Release|Any CPU - {4C9BB260-62D8-49CD-9F9C-9AA6A8BFC637}.Release|NoVSIX.ActiveCfg = Release|Any CPU - {4C9BB260-62D8-49CD-9F9C-9AA6A8BFC637}.Release|NoVSIX.Build.0 = Release|Any CPU {AC2503A7-736D-4AE6-9355-CF35D9DF6139}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {AC2503A7-736D-4AE6-9355-CF35D9DF6139}.Debug|Any CPU.Build.0 = Debug|Any CPU - {AC2503A7-736D-4AE6-9355-CF35D9DF6139}.Debug|NoVSIX.ActiveCfg = Debug|Any CPU - {AC2503A7-736D-4AE6-9355-CF35D9DF6139}.Debug|NoVSIX.Build.0 = Debug|Any CPU {AC2503A7-736D-4AE6-9355-CF35D9DF6139}.Release|Any CPU.ActiveCfg = Release|Any CPU {AC2503A7-736D-4AE6-9355-CF35D9DF6139}.Release|Any CPU.Build.0 = Release|Any CPU - {AC2503A7-736D-4AE6-9355-CF35D9DF6139}.Release|NoVSIX.ActiveCfg = Release|Any CPU - {AC2503A7-736D-4AE6-9355-CF35D9DF6139}.Release|NoVSIX.Build.0 = Release|Any CPU {8AB40D1C-1134-4D77-B39A-19AEDC729450}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {8AB40D1C-1134-4D77-B39A-19AEDC729450}.Debug|Any CPU.Build.0 = Debug|Any CPU - {8AB40D1C-1134-4D77-B39A-19AEDC729450}.Debug|NoVSIX.ActiveCfg = Debug|Any CPU - {8AB40D1C-1134-4D77-B39A-19AEDC729450}.Debug|NoVSIX.Build.0 = Debug|Any CPU {8AB40D1C-1134-4D77-B39A-19AEDC729450}.Release|Any CPU.ActiveCfg = Release|Any CPU {8AB40D1C-1134-4D77-B39A-19AEDC729450}.Release|Any CPU.Build.0 = Release|Any CPU - {8AB40D1C-1134-4D77-B39A-19AEDC729450}.Release|NoVSIX.ActiveCfg = Release|Any CPU - {8AB40D1C-1134-4D77-B39A-19AEDC729450}.Release|NoVSIX.Build.0 = Release|Any CPU + {D4CE7347-CEBE-46E5-BD12-1319573B6C5E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {D4CE7347-CEBE-46E5-BD12-1319573B6C5E}.Debug|Any CPU.Build.0 = Debug|Any CPU + {D4CE7347-CEBE-46E5-BD12-1319573B6C5E}.Release|Any CPU.ActiveCfg = Release|Any CPU + {D4CE7347-CEBE-46E5-BD12-1319573B6C5E}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -324,7 +216,6 @@ Global {166A16C0-B89F-41AF-956A-235C6CA62C25} = {86309CF6-0054-4CE3-BFD3-CA0AA7DB17BC} {E066F547-7261-4561-AEFC-E64DBFD874F8} = {86309CF6-0054-4CE3-BFD3-CA0AA7DB17BC} {2F9A6E0C-DE95-4460-96B7-EB72BBEAEE9E} = {86309CF6-0054-4CE3-BFD3-CA0AA7DB17BC} - {09B87BEB-D9A3-4EEB-B56A-ED53D27DF1A3} = {86309CF6-0054-4CE3-BFD3-CA0AA7DB17BC} {014A3DCE-50A6-4774-A4C1-C66EEAB67133} = {BF4C4202-5015-4FBD-80E6-D0F36A06F700} {17831017-C29C-4A48-B159-849BCE5079FB} = {86309CF6-0054-4CE3-BFD3-CA0AA7DB17BC} {814F94D6-1413-4ACB-B1B5-A3488CAA1E6B} = {BF4C4202-5015-4FBD-80E6-D0F36A06F700} @@ -342,6 +233,7 @@ Global {4C9BB260-62D8-49CD-9F9C-9AA6A8BFC637} = {51A614B0-E583-4DD2-AC7D-6A65634582E0} {AC2503A7-736D-4AE6-9355-CF35D9DF6139} = {86309CF6-0054-4CE3-BFD3-CA0AA7DB17BC} {8AB40D1C-1134-4D77-B39A-19AEDC729450} = {19FE674A-AC94-4E7E-B24C-2285D1D04CDE} + {D4CE7347-CEBE-46E5-BD12-1319573B6C5E} = {19FE674A-AC94-4E7E-B24C-2285D1D04CDE} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {B3911209-2DBF-47F8-98F6-BBC0EDFE63DE} diff --git a/README.md b/README.md index 87d4c0f32..27af11f5b 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ [![Releases](https://img.shields.io/github/release/neuecc/MessagePack-CSharp.svg)][Releases] [![Join the chat at https://gitter.im/MessagePack-CSharp/Lobby](https://badges.gitter.im/MessagePack-CSharp/Lobby.svg)](https://gitter.im/MessagePack-CSharp/Lobby?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) -[![Build Status](https://dev.azure.com/ils0086/MessagePack-CSharp/_apis/build/status/MessagePack-CSharp-CI)](https://dev.azure.com/ils0086/MessagePack-CSharp/_build/latest?definitionId=2) +[![Build Status](https://dev.azure.com/ils0086/MessagePack-CSharp/_apis/build/status/MessagePack-CSharp-CI?branchName=master)](https://dev.azure.com/ils0086/MessagePack-CSharp/_build/latest?definitionId=2&branchName=master) The extremely fast [MessagePack](http://msgpack.org/) serializer for C#. It is 10x faster than [MsgPack-Cli](https://github.com/msgpack/msgpack-cli) and outperforms other C# serializers. MessagePack for C# also ships with built-in support for LZ4 compression - an extremely fast compression algorithm. Performance is important, particularly in applications like games, distributed computing, microservices, or data caches. @@ -34,6 +34,7 @@ MessagePack has a compact binary size and a full set of general purpose expressi - [Security](#security) - [Performance](#performance) - [Deserialization Performance for different options](#deserialization-performance-for-different-options) + - [String interning](#string-interning) - [LZ4 Compression](#lz4-compression) - [Attributions](#attributions) - [Comparison with protobuf, JSON, ZeroFormatter](#comparison-with-protobuf-json-zeroformatter) @@ -184,7 +185,7 @@ These types can serialize by default: * Primitives (`int`, `string`, etc...), `Enum`s, `Nullable<>`, `Lazy<>` * `TimeSpan`, `DateTime`, `DateTimeOffset` * `Guid`, `Uri`, `Version`, `StringBuilder` -* `BigInteger`, `Complex` +* `BigInteger`, `Complex`, `Half` * `Array[]`, `Array[,]`, `Array[,,]`, `Array[,,,]`, `ArraySegment<>`, `BitArray` * `KeyValuePair<,>`, `Tuple<,...>`, `ValueTuple<,...>` * `ArrayList`, `Hashtable` @@ -404,6 +405,8 @@ public struct Point } ``` +### C# 9 `record` types + C# 9.0 record with primary constructor is similar immutable object, also supports serialize/deserialize. ```csharp @@ -412,8 +415,26 @@ C# 9.0 record with primary constructor is similar immutable object, also support // use property: to set KeyAttribute [MessagePackObject] public record Point([property:Key(0)] int X, [property: Key(1)] int Y); + +// Or use explicit properties +[MessagePackObject] +public record Person +{ + [Key(0)] + public string FirstName { get; init; } + + [Key(1)] + public string LastName { get; init; } +} ``` +### C# 9 `init` property setter limitations + +When using `init` property setters in _generic_ classes, [a CLR bug](https://github.com/neuecc/MessagePack-CSharp/issues/1134) prevents our most efficient code generation from invoking the property setter. +As a result, you should avoid using `init` on property setters in generic classes when using the public-only `DynamicObjectResolver`/`StandardResolver`. + +When using the `DynamicObjectResolverAllowPrivate`/`StandardResolverAllowPrivate` resolver the bug does not apply and you may use `init` without restriction. + ## Serialization Callback Objects implementing the `IMessagePackSerializationCallbackReceiver` interface will received `OnBeforeSerialize` and `OnAfterDeserialize` calls during serialization/deserialization. @@ -679,7 +700,7 @@ Benchmarks comparing MessagePack For C# to other serializers were run on `Window * Avoid string key decoding for lookup maps (string key and use automata based name lookup with inlined IL code generation, see: [AutomataDictionary](https://github.com/neuecc/MessagePack-CSharp/blob/bcedbce3fd98cb294210d6b4a22bdc4c75ccd916/src/MessagePack/Internal/AutomataDictionary.cs) * To encode string keys, use pre-generated member name bytes and fixed sized byte array copies in IL, see: [UnsafeMemory.cs](https://github.com/neuecc/MessagePack-CSharp/blob/f17ddc5d107d3a2f66f60398b214ef87919ff892/src/MessagePack/Internal/UnsafeMemory.cs) -Before creating this library, I implemented a fast fast serializer with [ZeroFormatter#Performance](https://github.com/neuecc/ZeroFormatter#performance). This is a further evolved implementation. MessagePack for C# is always fast and optimized for all types (primitive, small struct, large object, any collections). +Before creating this library, I implemented a fast serializer with [ZeroFormatter#Performance](https://github.com/neuecc/ZeroFormatter#performance). This is a further evolved implementation. MessagePack for C# is always fast and optimized for all types (primitive, small struct, large object, any collections). ### Deserialization Performance for different options @@ -738,6 +759,49 @@ Extra note, this is serialization benchmark result. Of course, `IntKey` is fastest but `StringKey` also performs reasonably well. +### String interning + +The msgpack format does not provide for reusing strings in the data stream. +This naturally leads the deserializer to create a new `string` object for every string encountered, +even if it is equal to another string previously encountered. + +When deserializing data that may contain the same strings repeatedly it can be worthwhile +to have the deserializer take a little extra time to check whether it has seen a given string before +and reuse it if it has. + +To enable string interning on *all* string values, use a resolver that specifies `StringInterningFormatter` +before any of the standard ones, like this: + +```cs +var options = MessagePackSerializerOptions.Standard.WithResolver( + CompositeResolver.Create( + new IMessagePackFormatter[] { new StringInterningFormatter() }, + new IFormatterResolver[] { StandardResolver.Instance })); + +MessagePackSerializer.Deserialize(data, options); +``` + +If you know which fields of a particular type are likely to contain duplicate strings, +you can apply the string interning formatter to just those fields so the deserializer only pays +for the interned string check where it matters most. +Note that this technique requires a `[MessagePackObject]` or `[DataContract]` class. + +```cs +[MessagePackObject] +public class ClassOfStrings +{ + [Key(0)] + [MessagePackFormatter(typeof(StringInterningFormatter))] + public string InternedString { get; set; } + + [Key(1)] + public string OrdinaryString { get; set; } +} +``` + +If you are writing your own formatter for some type that contains strings, +you can call on the `StringInterningFormatter` directly from your formatter as well for the strings. + ## LZ4 Compression MessagePack is a fast and *compact* format but it is not compression. [LZ4](https://github.com/lz4/lz4) is an extremely fast compression algorithm, and using it MessagePack for C# can achieve extremely fast performance as well as extremely compact binary sizes! @@ -1068,7 +1132,7 @@ Here is an example of such a custom formatter implementation. Note its use of th ```csharp /// Serializes a by its full path as a string. -public class FileInfoFormatter : IMessagePackFormatter +public class FileInfoFormatter : IMessagePackFormatter { public void Serialize( ref MessagePackWriter writer, FileInfo value, MessagePackSerializerOptions options) @@ -1111,7 +1175,7 @@ you must precede it with a map or array header. You must read the entire map/arr For example: ```csharp -public class MySpecialObjectFormatter : IMessagePackFormatter +public class MySpecialObjectFormatter : IMessagePackFormatter { public void Serialize( ref MessagePackWriter writer, MySpecialObject value, MessagePackSerializerOptions options) @@ -1149,15 +1213,18 @@ public class MySpecialObjectFormatter : IMessagePackFormatter)) - { - return Activator.CreateInstance(typeof(ValueTupleFormatter<,>).MakeGenericType(t.GenericTypeArguments)); - } - // If type can not get, must return null for fallback mechanism. return null; } @@ -1435,30 +1496,44 @@ var resolver = MessagePack.Resolvers.CompositeResolver.Create( ## Reserved Extension Types -MessagePack for C# already used some MessagePack extension type codes, be careful to use same ext code. +MessagePack for C# already used some MessagePack extension type codes, be careful to avoid using the same ext code for other purposes. + +Range | Reserved for +--|-- +\[-128, -1\] | Reserved by the msgpack spec for predefined types +\[30, 120) | Reserved for this library's use to support common types in .NET + +This leaves the following ranges for your use: + +- \[0, 30) +- \[120, 127] + +Within the *reserved* ranges, this library defines or implements extensions that use these type codes: | Code | Type | Use by | -| --- | --- | --- | -| -1 | DateTime | MessagePack-spec reserved for timestamp | -| 30 | Vector2[] | for Unity, UnsafeBlitFormatter | -| 31 | Vector3[] | for Unity, UnsafeBlitFormatter | -| 32 | Vector4[] | for Unity, UnsafeBlitFormatter | -| 33 | Quaternion[] | for Unity, UnsafeBlitFormatter | -| 34 | Color[] | for Unity, UnsafeBlitFormatter | -| 35 | Bounds[] | for Unity, UnsafeBlitFormatter | -| 36 | Rect[] | for Unity, UnsafeBlitFormatter | -| 37 | Int[] | for Unity, UnsafeBlitFormatter | -| 38 | Float[] | for Unity, UnsafeBlitFormatter | -| 39 | Double[] | for Unity, UnsafeBlitFormatter | -| 98 | All | MessagePackCompression.Lz4BlockArray | -| 99 | All | MessagePackCompression.Lz4Block | -| 100 | object | TypelessFormatter | +| ---- | ---- | --- | +| -1 | DateTime | MessagePack-spec reserved for timestamp | +| 30 | Vector2[] | for Unity, UnsafeBlitFormatter | +| 31 | Vector3[] | for Unity, UnsafeBlitFormatter | +| 32 | Vector4[] | for Unity, UnsafeBlitFormatter | +| 33 | Quaternion[] | for Unity, UnsafeBlitFormatter | +| 34 | Color[] | for Unity, UnsafeBlitFormatter | +| 35 | Bounds[] | for Unity, UnsafeBlitFormatter | +| 36 | Rect[] | for Unity, UnsafeBlitFormatter | +| 37 | Int[] | for Unity, UnsafeBlitFormatter | +| 38 | Float[] | for Unity, UnsafeBlitFormatter | +| 39 | Double[] | for Unity, UnsafeBlitFormatter | +| 98 | All | MessagePackCompression.Lz4BlockArray | +| 99 | All | MessagePackCompression.Lz4Block | +| 100 | object | TypelessFormatter | ## Unity support Unity lowest supported version is `2018.3`, API Compatibility Level supports both `.NET 4.x` and `.NET Standard 2.0`. -You can install the `unitypackage` from the [releases][Releases] page. If your build targets PC, you can use it as is, but if your build targets IL2CPP, you can not use `Dynamic***Resolver`, so it is required to use pre-code generation. Please see [pre-code generation section](#aot). +You can install the `unitypackage` from the [releases][Releases] page. +If your build targets .NET Framework 4.x and runs on mono, you can use it as is. +But if your build targets IL2CPP, you can not use `Dynamic***Resolver`, so it is required to use pre-code generation. Please see [pre-code generation section](#aot). MessagePack for C# includes some additional `System.*.dll` libraries that originally provides in NuGet. They are located under `Plugins`. If other packages use these libraries (e.g. Unity Collections package using `System.Runtime.CompilerServices.Unsafe.dll`), to avoid conflicts, please delete the DLL under `Plugins`. @@ -1504,7 +1579,8 @@ If you want to share a class between Unity and a server, you can use `SharedProj By default, MessagePack for C# serializes custom objects by [generating IL](https://msdn.microsoft.com/en-us/library/system.reflection.emit.ilgenerator.aspx) on the fly at runtime to create custom, highly tuned formatters for each type. This code generation has a minor upfront performance cost. Because strict-AOT environments such as Xamarin and Unity IL2CPP forbid runtime code generation, MessagePack provides a way for you to run a code generator ahead of time as well. -> Note: When Unity targets the PC it allows dynamic code generation, so AOT is not required. +> Note: When using Unity, dynamic code generation only works when targeting .NET Framework 4.x + mono runtime. +For all other Unity targets, AOT is required. If you want to avoid the upfront dynamic generation cost or you need to run on Xamarin or Unity, you need AOT code generation. `mpc` (MessagePackCompiler) is the code generator of MessagePack for C#. mpc uses [Roslyn](https://github.com/dotnet/roslyn) to analyze source code. @@ -1526,7 +1602,7 @@ Check in your `.config\dotnet-tools.json` file. On another machine you can "rest Once you have the tool installed, simply invoke using `dotnet mpc` within your repo: ``` -dotnet mpc -h +dotnet mpc --help ``` Alternatively, you can download mpc from the [releases][Releases] page, that includes platform native binaries (that don't require a separate dotnet runtime). @@ -1535,7 +1611,7 @@ Alternatively, you can download mpc from the [releases][Releases] page, that inc Usage: mpc [options...] Options: - -i, -input Input path of analyze csproj or directory, if input multiple csproj split with ','. (Required) + -i, -input Input path to MSBuild project file or the directory containing Unity source files. (Required) -o, -output Output file path(.cs) or directory(multiple generate file). (Required) -c, -conditionalSymbol Conditional compiler symbols, split with ','. (Default: null) -r, -resolverName Set resolver name. (Default: GeneratedResolver) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index a3206040b..d18997c3b 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -19,7 +19,7 @@ stages: jobs: - job: Windows pool: - vmImage: windows-2019 + vmImage: windows-2022 steps: - checkout: self clean: true @@ -33,7 +33,9 @@ stages: - job: Unity pool: name: CustomAgents - demands: UNITYHUB_EDITORS_FOLDER_LOCATION + demands: + - UNITYHUB_EDITORS_FOLDER_LOCATION + - UNITYVERSION -equals 2019.1 steps: - checkout: self clean: true @@ -42,7 +44,7 @@ stages: - job: Linux pool: - vmImage: Ubuntu 16.04 + vmImage: ubuntu-20.04 steps: - checkout: self clean: true @@ -51,7 +53,7 @@ stages: - job: macOS pool: - vmImage: macOS-10.15 + vmImage: macOS-11 steps: - checkout: self clean: true @@ -62,7 +64,7 @@ stages: # It also helps exercise mpc so bugs don't go unnoticed. - job: codegen_diff pool: - vmImage: ubuntu-latest + vmImage: ubuntu-20.04 steps: - checkout: self clean: true @@ -82,7 +84,7 @@ stages: jobs: - job: push pool: - vmImage: ubuntu-latest + vmImage: ubuntu-20.04 steps: - download: current artifact: nuget diff --git a/azure-pipelines/Get-TempToolsPath.ps1 b/azure-pipelines/Get-TempToolsPath.ps1 index 97c552c06..bb3da8e33 100644 --- a/azure-pipelines/Get-TempToolsPath.ps1 +++ b/azure-pipelines/Get-TempToolsPath.ps1 @@ -1,7 +1,7 @@ -if ($env:AGENT_TOOLSDIRECTORY) { - $path = "$env:AGENT_TOOLSDIRECTORY\vs-platform\tools" +if ($env:AGENT_TEMPDIRECTORY) { + $path = "$env:AGENT_TEMPDIRECTORY\$env:BUILD_BUILDID" } elseif ($env:localappdata) { - $path = "$env:localappdata\vs-platform\tools" + $path = "$env:localappdata\gitrepos\tools" } else { $path = "$PSScriptRoot\..\obj\tools" } diff --git a/azure-pipelines/Get-nbgv.ps1 b/azure-pipelines/Get-nbgv.ps1 index 925eecddb..a5be2cf7c 100644 --- a/azure-pipelines/Get-nbgv.ps1 +++ b/azure-pipelines/Get-nbgv.ps1 @@ -10,11 +10,7 @@ if ($existingTool) { return $existingTool.Path } -if ($env:AGENT_TEMPDIRECTORY) { - $toolInstallDir = "$env:AGENT_TEMPDIRECTORY/$env:BUILD_BUILDID" -} else { - $toolInstallDir = "$PSScriptRoot/../obj/tools" -} +$toolInstallDir = & "$PSScriptRoot/Get-TempToolsPath.ps1" $toolPath = "$toolInstallDir/nbgv" if (!(Test-Path $toolInstallDir)) { New-Item -Path $toolInstallDir -ItemType Directory | Out-Null } diff --git a/azure-pipelines/build.yml b/azure-pipelines/build.yml index 7a26369d3..99f5524dd 100644 --- a/azure-pipelines/build.yml +++ b/azure-pipelines/build.yml @@ -1,12 +1,8 @@ steps: -# Use VSBuild to pack because `dotnet pack` can't build VSIX projects. -- task: VSBuild@1 +- task: DotNetCoreCLI@2 inputs: - vsVersion: 16.0 - solution: MessagePack.sln - msbuildArgs: /t:build,pack /m /v:m /bl:"$(Build.ArtifactStagingDirectory)/build_logs/msbuild.binlog" - platform: $(BuildPlatform) - configuration: $(BuildConfiguration) + command: build + arguments: --configuration $(BuildConfiguration) /t:build,pack /m /v:m /bl:"$(Build.ArtifactStagingDirectory)/build_logs/msbuild.binlog" displayName: Build MessagePack.sln - task: DotNetCoreCLI@2 diff --git a/azure-pipelines/build_nonWindows.yml b/azure-pipelines/build_nonWindows.yml index af79463eb..cf3f51d76 100644 --- a/azure-pipelines/build_nonWindows.yml +++ b/azure-pipelines/build_nonWindows.yml @@ -3,15 +3,23 @@ steps: displayName: Build MessagePack.sln inputs: command: build - arguments: --no-restore /p:platform=NoVSIX -c $(BuildConfiguration) + arguments: --no-restore -c $(BuildConfiguration) - task: DotNetCoreCLI@2 - displayName: Run MessagePack.Tests (netcoreapp2.1) + displayName: Run MessagePack.Tests (netcoreapp3.1) inputs: command: test projects: tests/MessagePack.Tests/MessagePack.Tests.csproj - arguments: --no-build -c $(BuildConfiguration) -f netcoreapp2.1 -v n --settings "$(Build.Repository.LocalPath)/azure-pipelines/$(Agent.OS).runsettings" - testRunTitle: netcoreapp2.1-$(Agent.JobName) + arguments: --no-build -c $(BuildConfiguration) -f netcoreapp3.1 -v n --settings "$(Build.Repository.LocalPath)/azure-pipelines/$(Agent.OS).runsettings" + testRunTitle: netcoreapp3.1-$(Agent.JobName) + +- task: DotNetCoreCLI@2 + displayName: Run MessagePack.Tests (net6.0) + inputs: + command: test + projects: tests/MessagePack.Tests/MessagePack.Tests.csproj + arguments: --no-build -c $(BuildConfiguration) -f net6.0 -v n --settings "$(Build.Repository.LocalPath)/azure-pipelines/$(Agent.OS).runsettings" + testRunTitle: net6.0-$(Agent.JobName) - bash: mono ~/.nuget/packages/xunit.runner.console/2.4.1/tools/net472/xunit.console.exe bin/MessagePack.Tests/$(BuildConfiguration)/net472/MessagePack.Tests.dll -html $(BUILD.ARTIFACTSTAGINGDIRECTORY)/build_logs/mono_testrun.html displayName: Run MessagePack.Tests (mono) diff --git a/azure-pipelines/install-dependencies.yml b/azure-pipelines/install-dependencies.yml index 5b1ac4afd..7563bc1f8 100644 --- a/azure-pipelines/install-dependencies.yml +++ b/azure-pipelines/install-dependencies.yml @@ -7,8 +7,14 @@ steps: $AccessToken = '$(System.AccessToken)' # Avoid specifying the access token directly on the init.ps1 command line to avoid it showing up in errors .\init.ps1 -AccessToken $AccessToken ${{ parameters['initArgs'] }} -UpgradePrerequisites dotnet --info + + # Print mono version if it is present. + if (Get-Command mono -ErrorAction SilentlyContinue) { + mono --version + } displayName: Install prerequisites - powershell: azure-pipelines/variables/_pipelines.ps1 failOnStderr: true displayName: Set pipeline variables based on source + name: SetPipelineVariables diff --git a/azure-pipelines/release.yml b/azure-pipelines/release.yml index 4f6ebd829..83a6ab1ab 100644 --- a/azure-pipelines/release.yml +++ b/azure-pipelines/release.yml @@ -21,15 +21,13 @@ stages: runOnce: deploy: steps: + - download: none - powershell: | Write-Host "##vso[build.updatebuildnumber]$(resources.pipeline.CI.runName)" displayName: Set pipeline name - download: CI artifact: unity displayName: 'Downloading artifact: unity' - - download: CI - artifact: vsix - displayName: 'Downloading artifact: vsix' - task: GitHubRelease@1 displayName: GitHub release (create) inputs: @@ -41,7 +39,6 @@ stages: title: v$(resources.pipeline.CI.runName) assets: | $(Pipeline.Workspace)/CI/unity/*.unitypackage - $(Pipeline.Workspace)/CI/vsix/* isDraft: true # After running this step, visit the new draft release, edit, and publish. changeLogCompareToRelease: lastNonDraftRelease changeLogType: issueBased diff --git a/azure-pipelines/variables/_pipelines.ps1 b/azure-pipelines/variables/_pipelines.ps1 index 14d6ffc28..867b7fc8b 100644 --- a/azure-pipelines/variables/_pipelines.ps1 +++ b/azure-pipelines/variables/_pipelines.ps1 @@ -8,13 +8,16 @@ # Always use ALL CAPS for env var names since Azure Pipelines converts variable names to all caps and on non-Windows OS, env vars are case sensitive. $keyCaps = $_.Key.ToUpper() if (Test-Path -Path "env:$keyCaps") { - Write-Host "Skipping setting $keyCaps because variable is already set." -ForegroundColor Cyan + Write-Host "Skipping setting $keyCaps because variable is already set to '$(Get-Content env:$keyCaps)'." -ForegroundColor Cyan } else { Write-Host "$keyCaps=$($_.Value)" -ForegroundColor Yellow if ($env:TF_BUILD) { - Write-Host "##vso[task.setvariable variable=$keyCaps;]$($_.Value)" + # Create two variables: the first that can be used by its simple name and accessible only within this job. + Write-Host "##vso[task.setvariable variable=$keyCaps]$($_.Value)" + # and the second that works across jobs and stages but must be fully qualified when referenced. + Write-Host "##vso[task.setvariable variable=$keyCaps;isOutput=true]$($_.Value)" } elseif ($env:GITHUB_ACTIONS) { - Write-Host "::set-env name=$keyCaps::$($_.Value)" + Add-Content -Path $env:GITHUB_ENV -Value "$keyCaps=$($_.Value)" } Set-Item -Path "env:$keyCaps" -Value $_.Value } diff --git a/benchmark/ExperimentalBenchmark/ExperimentalBenchmark.csproj b/benchmark/ExperimentalBenchmark/ExperimentalBenchmark.csproj index fb222f26c..dbefafaf4 100644 --- a/benchmark/ExperimentalBenchmark/ExperimentalBenchmark.csproj +++ b/benchmark/ExperimentalBenchmark/ExperimentalBenchmark.csproj @@ -6,6 +6,7 @@ Benchmark true True + $(NoWarn);MSB3243 diff --git a/benchmark/SerializerBenchmark/BenchmarkConfig.cs b/benchmark/SerializerBenchmark/BenchmarkConfig.cs index c641d7315..e6e7066c4 100644 --- a/benchmark/SerializerBenchmark/BenchmarkConfig.cs +++ b/benchmark/SerializerBenchmark/BenchmarkConfig.cs @@ -27,13 +27,13 @@ public BenchmarkConfig() Job baseConfig = Job.ShortRun.WithIterationCount(1).WithWarmupCount(1); // Add(baseConfig.With(Runtime.Clr).With(Jit.RyuJit).With(Platform.X64)); - this.Add(baseConfig.With(CoreRuntime.Core31).With(Jit.RyuJit).With(Platform.X64)); + this.AddJob(baseConfig.WithRuntime(CoreRuntime.Core31).WithJit(Jit.RyuJit).WithPlatform(Platform.X64)); - this.Add(MarkdownExporter.GitHub); - this.Add(CsvExporter.Default); - this.Add(MemoryDiagnoser.Default); + this.AddExporter(MarkdownExporter.GitHub); + this.AddExporter(CsvExporter.Default); + this.AddDiagnoser(MemoryDiagnoser.Default); - this.Add(new DataSizeColumn()); + this.AddColumn(new DataSizeColumn()); this.Orderer = new CustomOrderer(); } @@ -96,19 +96,24 @@ public string GetValue(Summary summary, BenchmarkCase benchmarkCase) public string GetValue(Summary summary, BenchmarkCase benchmarkCase, SummaryStyle style) { System.Reflection.MethodInfo mi = benchmarkCase.Descriptor.WorkloadMethod; - if (mi.Name.Contains("Serialize")) + if (!mi.Name.Contains("Serialize")) { - var instance = Activator.CreateInstance(mi.DeclaringType); - mi.DeclaringType.GetField("Serializer").SetValue(instance, benchmarkCase.Parameters[0].Value); - mi.DeclaringType.GetMethod("Setup").Invoke(instance, null); - - var bytes = (byte[])mi.Invoke(instance, null); - return ToHumanReadableSize(bytes.Length); + return "-"; } - else + + var instance = Activator.CreateInstance(mi.DeclaringType); + mi.DeclaringType.GetField("Serializer").SetValue(instance, benchmarkCase.Parameters[0].Value); + mi.DeclaringType.GetMethod("Setup").Invoke(instance, null); + + var bytes = (byte[])mi.Invoke(instance, null); + var byteSize = bytes.Length; + var cultureInfo = summary.GetCultureInfo(); + if (style.PrintUnitsInContent) { - return "-"; + return SizeValue.FromBytes(byteSize).ToString(style.SizeUnit, cultureInfo); } + + return byteSize.ToString("0.##", cultureInfo); } public bool IsAvailable(Summary summary) @@ -120,65 +125,6 @@ public bool IsDefault(Summary summary, BenchmarkCase benchmarkCase) { return false; } - - private static string ToHumanReadableSize(long size) - { - return ToHumanReadableSize(new long?(size)); - } - - private static string ToHumanReadableSize(long? size) - { - if (size == null) - { - return "NULL"; - } - - double bytes = size.Value; - - if (bytes <= 1024) - { - return bytes.ToString("f2") + " B"; - } - - bytes = bytes / 1024; - if (bytes <= 1024) - { - return bytes.ToString("f2") + " KB"; - } - - bytes = bytes / 1024; - if (bytes <= 1024) - { - return bytes.ToString("f2") + " MB"; - } - - bytes = bytes / 1024; - if (bytes <= 1024) - { - return bytes.ToString("f2") + " GB"; - } - - bytes = bytes / 1024; - if (bytes <= 1024) - { - return bytes.ToString("f2") + " TB"; - } - - bytes = bytes / 1024; - if (bytes <= 1024) - { - return bytes.ToString("f2") + " PB"; - } - - bytes = bytes / 1024; - if (bytes <= 1024) - { - return bytes.ToString("f2") + " EB"; - } - - bytes = bytes / 1024; - return bytes + " ZB"; - } } } } diff --git a/benchmark/SerializerBenchmark/OdinSerializer.dll b/benchmark/SerializerBenchmark/OdinSerializer.dll new file mode 100644 index 000000000..c46f54936 Binary files /dev/null and b/benchmark/SerializerBenchmark/OdinSerializer.dll differ diff --git a/benchmark/SerializerBenchmark/Program.cs b/benchmark/SerializerBenchmark/Program.cs index 8bc34aecc..c0d23073b 100644 --- a/benchmark/SerializerBenchmark/Program.cs +++ b/benchmark/SerializerBenchmark/Program.cs @@ -1,13 +1,11 @@ // Copyright (c) All contributors. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. -using Benchmark; -using Benchmark.Models; using BenchmarkDotNet.Running; -namespace ConsoleApp1 +namespace Benchmark { - internal class Program + internal static class Program { private static void Main(string[] args) { diff --git a/benchmark/SerializerBenchmark/SerializerBenchmark.cs b/benchmark/SerializerBenchmark/SerializerBenchmark.cs index c29155384..71a95e208 100644 --- a/benchmark/SerializerBenchmark/SerializerBenchmark.cs +++ b/benchmark/SerializerBenchmark/SerializerBenchmark.cs @@ -21,7 +21,7 @@ public class AllSerializerBenchmark_BytesInOut [ParamsSource(nameof(Serializers))] public SerializerBase Serializer; - // Currently BenchmarkdDotNet does not detect inherited ParamsSource so use copy and paste:) + // Currently BenchmarkDotNet does not detect inherited ParamsSource so use copy and paste:) public IEnumerable Serializers => new SerializerBase[] { new MessagePack_v1(), @@ -31,19 +31,20 @@ public class AllSerializerBenchmark_BytesInOut new MsgPack_v2_opt(), //new MsgPack_v2_string(), //new MsgPack_v2_str_lz4(), - new ProtobufNet(), - new JsonNet(), - new BsonNet(), - new BinaryFormatter_(), - new DataContract_(), - new Hyperion_(), - new Jil_(), - new SpanJson_(), - new Utf8Json_(), - new SystemTextJson(), - new MsgPackCli(), - new FsPickler_(), - new Ceras_(), + new ProtobufNetSerializer(), + new JsonNetSerializer(), + new BsonNetSerializer(), + new BinaryFormatterSerializer(), + new DataContractSerializer(), + new HyperionSerializer(), + new JilSerializer(), + new SpanJsonSerializer(), + new Utf8JsonSerializer(), + new SystemTextJsonSerializer(), + new MsgPackCliSerializer(), + new FsPicklerSerializer(), + new CerasSerializer(), + new OdinSerializer_(), }; protected static readonly ExpressionTreeFixture ExpressionTreeFixture = new ExpressionTreeFixture(); @@ -568,7 +569,7 @@ public class MsgPackV1_Vs_MsgPackV2_BytesInOut // : AllSerializerBenchmark [ParamsSource(nameof(Serializers))] public SerializerBase Serializer; - // Currently BenchmarkdDotNet does not detect inherited ParamsSource so use copy and paste:) + // Currently BenchmarkDotNet does not detect inherited ParamsSource so use copy and paste:) public IEnumerable Serializers => new SerializerBase[] { new MessagePack_v1(), @@ -1099,7 +1100,7 @@ public class ShortRun_AllSerializerBenchmark_BytesInOut private bool isContractless; - // Currently BenchmarkdDotNet does not detect inherited ParamsSource so use copy and paste:) + // Currently BenchmarkDotNet does not detect inherited ParamsSource so use copy and paste:) public IEnumerable Serializers => new SerializerBase[] { new MessagePack_v1(), @@ -1111,19 +1112,20 @@ public class ShortRun_AllSerializerBenchmark_BytesInOut new MsgPack_v2_string(), new MsgPack_v1_str_lz4(), new MsgPack_v2_str_lz4(), - new ProtobufNet(), - new JsonNet(), - new BsonNet(), - new BinaryFormatter_(), - new DataContract_(), - new Hyperion_(), - new Jil_(), - new SpanJson_(), - new Utf8Json_(), - new SystemTextJson(), - new MsgPackCli(), - new FsPickler_(), - new Ceras_(), + new ProtobufNetSerializer(), + new JsonNetSerializer(), + new BsonNetSerializer(), + new BinaryFormatterSerializer(), + new DataContractSerializer(), + new HyperionSerializer(), + new JilSerializer(), + new SpanJsonSerializer(), + new Utf8JsonSerializer(), + new SystemTextJsonSerializer(), + new MsgPackCliSerializer(), + new FsPicklerSerializer(), + new CerasSerializer(), + new OdinSerializer_(), }; protected static readonly ExpressionTreeFixture ExpressionTreeFixture = new ExpressionTreeFixture(); @@ -1197,7 +1199,7 @@ public class ShortRun_MsgPackV1_Vs_MsgPackV2_BytesInOut [ParamsSource(nameof(Serializers))] public SerializerBase Serializer; - // Currently BenchmarkdDotNet does not detect inherited ParamsSource so use copy and paste:) + // Currently BenchmarkDotNet does not detect inherited ParamsSource so use copy and paste:) public IEnumerable Serializers => new SerializerBase[] { new MessagePack_v1(), diff --git a/benchmark/SerializerBenchmark/SerializerBenchmark.csproj b/benchmark/SerializerBenchmark/SerializerBenchmark.csproj index b4912cc86..b6be2ea09 100644 --- a/benchmark/SerializerBenchmark/SerializerBenchmark.csproj +++ b/benchmark/SerializerBenchmark/SerializerBenchmark.csproj @@ -10,7 +10,7 @@ - + @@ -20,7 +20,7 @@ - + @@ -40,6 +40,7 @@ true false - + + diff --git a/benchmark/SerializerBenchmark/Serializers/BinaryFormatter.cs b/benchmark/SerializerBenchmark/Serializers/BinaryFormatter.cs deleted file mode 100644 index b3981a890..000000000 --- a/benchmark/SerializerBenchmark/Serializers/BinaryFormatter.cs +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright (c) All contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using System.IO; -using System.Runtime.Serialization.Formatters.Binary; -using Benchmark.Serializers; - -#pragma warning disable SA1649 // File name should match first type name - -public class BinaryFormatter_ : SerializerBase -{ - public override T Deserialize(object input) - { - using (var ms = new MemoryStream((byte[])input)) - { - return (T)new BinaryFormatter().Deserialize(ms); - } - } - - public override object Serialize(T input) - { - using (var ms = new MemoryStream()) - { - new BinaryFormatter().Serialize(ms, input); - ms.Flush(); - return ms.ToArray(); - } - } -} diff --git a/benchmark/SerializerBenchmark/Serializers/BinaryFormatterSerializer.cs b/benchmark/SerializerBenchmark/Serializers/BinaryFormatterSerializer.cs new file mode 100644 index 000000000..c54b5487f --- /dev/null +++ b/benchmark/SerializerBenchmark/Serializers/BinaryFormatterSerializer.cs @@ -0,0 +1,34 @@ +// Copyright (c) All contributors. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +using System.IO; +using System.Runtime.Serialization.Formatters.Binary; + +namespace Benchmark.Serializers +{ + public class BinaryFormatterSerializer : SerializerBase + { + public override T Deserialize(object input) + { + using (var ms = new MemoryStream((byte[])input)) + { + return (T)new BinaryFormatter().Deserialize(ms); + } + } + + public override object Serialize(T input) + { + using (var ms = new MemoryStream()) + { + new BinaryFormatter().Serialize(ms, input); + ms.Flush(); + return ms.ToArray(); + } + } + + public override string ToString() + { + return "BinaryFormatter"; + } + } +} diff --git a/benchmark/SerializerBenchmark/Serializers/BsonNetSerializer.cs b/benchmark/SerializerBenchmark/Serializers/BsonNetSerializer.cs index cd379a0fe..68616af44 100644 --- a/benchmark/SerializerBenchmark/Serializers/BsonNetSerializer.cs +++ b/benchmark/SerializerBenchmark/Serializers/BsonNetSerializer.cs @@ -2,42 +2,47 @@ // Licensed under the MIT license. See LICENSE file in the project root for full license information. using System.IO; -using Benchmark.Serializers; using Newtonsoft.Json; using Newtonsoft.Json.Bson; -#pragma warning disable SA1649 // File name should match first type name - -public class BsonNet : SerializerBase +namespace Benchmark.Serializers { - private static readonly JsonSerializer Serializer = new JsonSerializer(); - - public override T Deserialize(object input) + public class BsonNetSerializer : SerializerBase { - using (var ms = new MemoryStream((byte[])input)) - using (var jr = new BsonDataReader(ms)) - { - return Serializer.Deserialize(jr); - } - } + private static readonly JsonSerializer Serializer = new JsonSerializer(); - public override object Serialize(T input) - { - object value = input; - if (typeof(T).IsValueType) + public override T Deserialize(object input) { - value = new[] { input }; + using (var ms = new MemoryStream((byte[])input)) + using (var jr = new BsonDataReader(ms)) + { + return Serializer.Deserialize(jr); + } } - using (var ms = new MemoryStream()) + public override object Serialize(T input) { - using (var jw = new BsonDataWriter(ms)) + object value = input; + if (typeof(T).IsValueType) { - Serializer.Serialize(jw, value); + value = new[] { input }; } - ms.Flush(); - return ms.ToArray(); + using (var ms = new MemoryStream()) + { + using (var jw = new BsonDataWriter(ms)) + { + Serializer.Serialize(jw, value); + } + + ms.Flush(); + return ms.ToArray(); + } + } + + public override string ToString() + { + return "BsonNet"; } } } diff --git a/benchmark/SerializerBenchmark/Serializers/CerasSerializer.cs b/benchmark/SerializerBenchmark/Serializers/CerasSerializer.cs index cfdd9be09..9521e4f2b 100644 --- a/benchmark/SerializerBenchmark/Serializers/CerasSerializer.cs +++ b/benchmark/SerializerBenchmark/Serializers/CerasSerializer.cs @@ -1,21 +1,25 @@ // Copyright (c) All contributors. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. -using Benchmark.Serializers; - -#pragma warning disable SA1649 // File name should match first type name - -public class Ceras_ : SerializerBase +namespace Benchmark.Serializers { - private Ceras.CerasSerializer ceras = new Ceras.CerasSerializer(); - - public override T Deserialize(object input) + public class CerasSerializer : SerializerBase { - return this.ceras.Deserialize((byte[])input); - } + private Ceras.CerasSerializer ceras = new Ceras.CerasSerializer(); - public override object Serialize(T input) - { - return this.ceras.Serialize(input); + public override T Deserialize(object input) + { + return this.ceras.Deserialize((byte[])input); + } + + public override object Serialize(T input) + { + return this.ceras.Serialize(input); + } + + public override string ToString() + { + return "Ceras"; + } } } diff --git a/benchmark/SerializerBenchmark/Serializers/DataContractSerializer.cs b/benchmark/SerializerBenchmark/Serializers/DataContractSerializer.cs index eae1431ff..4425ed0e2 100644 --- a/benchmark/SerializerBenchmark/Serializers/DataContractSerializer.cs +++ b/benchmark/SerializerBenchmark/Serializers/DataContractSerializer.cs @@ -2,28 +2,32 @@ // Licensed under the MIT license. See LICENSE file in the project root for full license information. using System.IO; -using System.Runtime.Serialization; -using Benchmark.Serializers; -#pragma warning disable SA1649 // File name should match first type name - -public class DataContract_ : SerializerBase +namespace Benchmark.Serializers { - public override T Deserialize(object input) + public class DataContractSerializer : SerializerBase { - using (var ms = new MemoryStream((byte[])input)) + public override T Deserialize(object input) { - return (T)new DataContractSerializer(typeof(T)).ReadObject(ms); + using (var ms = new MemoryStream((byte[])input)) + { + return (T)new System.Runtime.Serialization.DataContractSerializer(typeof(T)).ReadObject(ms); + } } - } - public override object Serialize(T input) - { - using (var ms = new MemoryStream()) + public override object Serialize(T input) + { + using (var ms = new MemoryStream()) + { + new System.Runtime.Serialization.DataContractSerializer(typeof(T)).WriteObject(ms, input); + ms.Flush(); + return ms.ToArray(); + } + } + + public override string ToString() { - new DataContractSerializer(typeof(T)).WriteObject(ms, input); - ms.Flush(); - return ms.ToArray(); + return "DataContract"; } } } diff --git a/benchmark/SerializerBenchmark/Serializers/FsPicklerSerializer.cs b/benchmark/SerializerBenchmark/Serializers/FsPicklerSerializer.cs index 18b1c88e8..d0c8341fe 100644 --- a/benchmark/SerializerBenchmark/Serializers/FsPicklerSerializer.cs +++ b/benchmark/SerializerBenchmark/Serializers/FsPicklerSerializer.cs @@ -2,30 +2,35 @@ // Licensed under the MIT license. See LICENSE file in the project root for full license information. using System.IO; -using Benchmark.Serializers; using MBrace.FsPickler; -#pragma warning disable SA1649 // File name should match first type name - -public class FsPickler_ : SerializerBase +namespace Benchmark.Serializers { - private static readonly BinarySerializer Serializer = MBrace.FsPickler.FsPickler.CreateBinarySerializer(); - - public override T Deserialize(object input) + public class FsPicklerSerializer : SerializerBase { - using (var ms = new MemoryStream((byte[])input)) + private static readonly BinarySerializer Serializer = MBrace.FsPickler.FsPickler.CreateBinarySerializer(); + + public override T Deserialize(object input) { - return Serializer.Deserialize(ms); + using (var ms = new MemoryStream((byte[])input)) + { + return Serializer.Deserialize(ms); + } } - } - public override object Serialize(T input) - { - using (var ms = new MemoryStream()) + public override object Serialize(T input) + { + using (var ms = new MemoryStream()) + { + Serializer.Serialize(ms, input); + ms.Flush(); + return ms.ToArray(); + } + } + + public override string ToString() { - Serializer.Serialize(ms, input); - ms.Flush(); - return ms.ToArray(); + return "FsPickler"; } } } diff --git a/benchmark/SerializerBenchmark/Serializers/HyperionSerializer.cs b/benchmark/SerializerBenchmark/Serializers/HyperionSerializer.cs index b38ef9494..0f5d5d847 100644 --- a/benchmark/SerializerBenchmark/Serializers/HyperionSerializer.cs +++ b/benchmark/SerializerBenchmark/Serializers/HyperionSerializer.cs @@ -2,30 +2,35 @@ // Licensed under the MIT license. See LICENSE file in the project root for full license information. using System.IO; -using Benchmark.Serializers; using Hyperion; -#pragma warning disable SA1649 // File name should match first type name - -public class Hyperion_ : SerializerBase +namespace Benchmark.Serializers { - private static readonly Serializer Serializer = new Hyperion.Serializer(); - - public override T Deserialize(object input) + public class HyperionSerializer : SerializerBase { - using (var ms = new MemoryStream((byte[])input)) + private static readonly Serializer Serializer = new Hyperion.Serializer(); + + public override T Deserialize(object input) { - return Serializer.Deserialize(ms); + using (var ms = new MemoryStream((byte[])input)) + { + return Serializer.Deserialize(ms); + } } - } - public override object Serialize(T input) - { - using (var ms = new MemoryStream()) + public override object Serialize(T input) + { + using (var ms = new MemoryStream()) + { + Serializer.Serialize(input, ms); + ms.Flush(); + return ms.ToArray(); + } + } + + public override string ToString() { - Serializer.Serialize(input, ms); - ms.Flush(); - return ms.ToArray(); + return "Hyperion"; } } } diff --git a/benchmark/SerializerBenchmark/Serializers/JilSerializer.cs b/benchmark/SerializerBenchmark/Serializers/JilSerializer.cs index b68a0585f..983e07d3e 100644 --- a/benchmark/SerializerBenchmark/Serializers/JilSerializer.cs +++ b/benchmark/SerializerBenchmark/Serializers/JilSerializer.cs @@ -2,20 +2,25 @@ // Licensed under the MIT license. See LICENSE file in the project root for full license information. using System.Text; -using Benchmark.Serializers; using Jil; -#pragma warning disable SA1649 // File name should match first type name - -public class Jil_ : SerializerBase +namespace Benchmark.Serializers { - public override object Serialize(T input) + public class JilSerializer : SerializerBase { - return Encoding.UTF8.GetBytes(Jil.JSON.Serialize(input, Options.ISO8601)); - } + public override object Serialize(T input) + { + return Encoding.UTF8.GetBytes(Jil.JSON.Serialize(input, Options.ISO8601)); + } - public override T Deserialize(object input) - { - return Jil.JSON.Deserialize(Encoding.UTF8.GetString((byte[])input), Options.ISO8601); + public override T Deserialize(object input) + { + return Jil.JSON.Deserialize(Encoding.UTF8.GetString((byte[])input), Options.ISO8601); + } + + public override string ToString() + { + return "Jil"; + } } } diff --git a/benchmark/SerializerBenchmark/Serializers/JsonNetSerializer.cs b/benchmark/SerializerBenchmark/Serializers/JsonNetSerializer.cs index 80761c6a4..b85574ddc 100644 --- a/benchmark/SerializerBenchmark/Serializers/JsonNetSerializer.cs +++ b/benchmark/SerializerBenchmark/Serializers/JsonNetSerializer.cs @@ -3,37 +3,42 @@ using System.IO; using System.Text; -using Benchmark.Serializers; using Newtonsoft.Json; -#pragma warning disable SA1649 // File name should match first type name - -public class JsonNet : SerializerBase +namespace Benchmark.Serializers { - private static readonly JsonSerializer Serializer = new JsonSerializer(); - - public override T Deserialize(object input) + public class JsonNetSerializer : SerializerBase { - using (var ms = new MemoryStream((byte[])input)) - using (var sr = new StreamReader(ms, Encoding.UTF8)) - using (var jr = new JsonTextReader(sr)) + private static readonly JsonSerializer Serializer = new JsonSerializer(); + + public override T Deserialize(object input) { - return Serializer.Deserialize(jr); + using (var ms = new MemoryStream((byte[])input)) + using (var sr = new StreamReader(ms, Encoding.UTF8)) + using (var jr = new JsonTextReader(sr)) + { + return Serializer.Deserialize(jr); + } } - } - public override object Serialize(T input) - { - using (var ms = new MemoryStream()) + public override object Serialize(T input) { - using (var sw = new StreamWriter(ms, Encoding.UTF8)) - using (var jw = new JsonTextWriter(sw)) + using (var ms = new MemoryStream()) { - Serializer.Serialize(jw, input); + using (var sw = new StreamWriter(ms, Encoding.UTF8)) + using (var jw = new JsonTextWriter(sw)) + { + Serializer.Serialize(jw, input); + } + + ms.Flush(); + return ms.ToArray(); } + } - ms.Flush(); - return ms.ToArray(); + public override string ToString() + { + return "JsonNet"; } } } diff --git a/benchmark/SerializerBenchmark/Serializers/MessagePackSerializer.cs b/benchmark/SerializerBenchmark/Serializers/MessagePackSerializer.cs index eb5901c9f..7583e0361 100644 --- a/benchmark/SerializerBenchmark/Serializers/MessagePackSerializer.cs +++ b/benchmark/SerializerBenchmark/Serializers/MessagePackSerializer.cs @@ -4,172 +4,221 @@ extern alias oldmsgpack; extern alias newmsgpack; -using Benchmark.Serializers; - #pragma warning disable SA1649 // File name should match first type name -public class MessagePack_v1 : SerializerBase +namespace Benchmark.Serializers { - public override T Deserialize(object input) + public class MessagePack_v1 : SerializerBase { - return oldmsgpack::MessagePack.MessagePackSerializer.Deserialize((byte[])input); - } + public override T Deserialize(object input) + { + return oldmsgpack::MessagePack.MessagePackSerializer.Deserialize((byte[])input); + } - public override object Serialize(T input) - { - return oldmsgpack::MessagePack.MessagePackSerializer.Serialize(input); - } -} + public override object Serialize(T input) + { + return oldmsgpack::MessagePack.MessagePackSerializer.Serialize(input); + } -public class MessagePack_v2 : SerializerBase -{ - public override T Deserialize(object input) - { - return newmsgpack::MessagePack.MessagePackSerializer.Deserialize((byte[])input); + public override string ToString() + { + return "MessagePack_v1"; + } } - public override object Serialize(T input) + public class MessagePack_v2 : SerializerBase { - return newmsgpack::MessagePack.MessagePackSerializer.Serialize(input); - } -} + public override T Deserialize(object input) + { + return newmsgpack::MessagePack.MessagePackSerializer.Deserialize((byte[])input); + } -public class MsgPack_v1_string : SerializerBase -{ - public override T Deserialize(object input) - { - return oldmsgpack::MessagePack.MessagePackSerializer.Deserialize((byte[])input, oldmsgpack::MessagePack.Resolvers.ContractlessStandardResolver.Instance); + public override object Serialize(T input) + { + return newmsgpack::MessagePack.MessagePackSerializer.Serialize(input); + } + + public override string ToString() + { + return "MessagePack_v2"; + } } - public override object Serialize(T input) + public class MsgPack_v1_string : SerializerBase { - return oldmsgpack::MessagePack.MessagePackSerializer.Serialize(input, oldmsgpack::MessagePack.Resolvers.ContractlessStandardResolver.Instance); - } -} + public override T Deserialize(object input) + { + return oldmsgpack::MessagePack.MessagePackSerializer.Deserialize((byte[])input, oldmsgpack::MessagePack.Resolvers.ContractlessStandardResolver.Instance); + } -public class MsgPack_v2_string : SerializerBase -{ - private static readonly newmsgpack::MessagePack.MessagePackSerializerOptions Options = newmsgpack::MessagePack.MessagePackSerializerOptions.Standard.WithResolver(newmsgpack::MessagePack.Resolvers.ContractlessStandardResolver.Instance); + public override object Serialize(T input) + { + return oldmsgpack::MessagePack.MessagePackSerializer.Serialize(input, oldmsgpack::MessagePack.Resolvers.ContractlessStandardResolver.Instance); + } - public override T Deserialize(object input) - { - return newmsgpack::MessagePack.MessagePackSerializer.Deserialize((byte[])input, options: Options); + public override string ToString() + { + return "MsgPack_v1_string"; + } } - public override object Serialize(T input) + public class MsgPack_v2_string : SerializerBase { - return newmsgpack::MessagePack.MessagePackSerializer.Serialize(input, options: Options); - } -} + private static readonly newmsgpack::MessagePack.MessagePackSerializerOptions Options = + newmsgpack::MessagePack.MessagePackSerializerOptions.Standard.WithResolver(newmsgpack::MessagePack.Resolvers.ContractlessStandardResolver.Instance); -public class MessagePackLz4_v1 : SerializerBase -{ - public override T Deserialize(object input) - { - return oldmsgpack::MessagePack.LZ4MessagePackSerializer.Deserialize((byte[])input); + public override T Deserialize(object input) + { + return newmsgpack::MessagePack.MessagePackSerializer.Deserialize((byte[])input, options: Options); + } + + public override object Serialize(T input) + { + return newmsgpack::MessagePack.MessagePackSerializer.Serialize(input, options: Options); + } + + public override string ToString() + { + return "MsgPack_v2_string"; + } } - public override object Serialize(T input) + public class MessagePackLz4_v1 : SerializerBase { - return oldmsgpack::MessagePack.LZ4MessagePackSerializer.Serialize(input); - } -} + public override T Deserialize(object input) + { + return oldmsgpack::MessagePack.LZ4MessagePackSerializer.Deserialize((byte[])input); + } -public class MessagePackLz4_v2 : SerializerBase -{ - private static readonly newmsgpack::MessagePack.MessagePackSerializerOptions LZ4BlockArray = newmsgpack::MessagePack.MessagePackSerializerOptions.Standard.WithCompression(newmsgpack::MessagePack.MessagePackCompression.Lz4BlockArray); + public override object Serialize(T input) + { + return oldmsgpack::MessagePack.LZ4MessagePackSerializer.Serialize(input); + } - public override T Deserialize(object input) - { - return newmsgpack::MessagePack.MessagePackSerializer.Deserialize((byte[])input, LZ4BlockArray); + public override string ToString() + { + return "MessagePackLz4_v1"; + } } - public override object Serialize(T input) + public class MessagePackLz4_v2 : SerializerBase { - return newmsgpack::MessagePack.MessagePackSerializer.Serialize(input, LZ4BlockArray); - } -} + private static readonly newmsgpack::MessagePack.MessagePackSerializerOptions LZ4BlockArray = + newmsgpack::MessagePack.MessagePackSerializerOptions.Standard.WithCompression(newmsgpack::MessagePack.MessagePackCompression.Lz4BlockArray); -public class MsgPack_v1_str_lz4 : SerializerBase -{ - public override T Deserialize(object input) - { - return oldmsgpack::MessagePack.LZ4MessagePackSerializer.Deserialize((byte[])input, oldmsgpack::MessagePack.Resolvers.ContractlessStandardResolver.Instance); + public override T Deserialize(object input) + { + return newmsgpack::MessagePack.MessagePackSerializer.Deserialize((byte[])input, LZ4BlockArray); + } + + public override object Serialize(T input) + { + return newmsgpack::MessagePack.MessagePackSerializer.Serialize(input, LZ4BlockArray); + } + + public override string ToString() + { + return "MessagePackLz4_v2"; + } } - public override object Serialize(T input) + public class MsgPack_v1_str_lz4 : SerializerBase { - return oldmsgpack::MessagePack.LZ4MessagePackSerializer.Serialize(input, oldmsgpack::MessagePack.Resolvers.ContractlessStandardResolver.Instance); - } -} + public override T Deserialize(object input) + { + return oldmsgpack::MessagePack.LZ4MessagePackSerializer.Deserialize((byte[])input, oldmsgpack::MessagePack.Resolvers.ContractlessStandardResolver.Instance); + } -public class MsgPack_v2_str_lz4 : SerializerBase -{ - private static readonly newmsgpack::MessagePack.MessagePackSerializerOptions Options = newmsgpack::MessagePack.MessagePackSerializerOptions.Standard.WithResolver(newmsgpack::MessagePack.Resolvers.ContractlessStandardResolver.Instance).WithCompression(newmsgpack::MessagePack.MessagePackCompression.Lz4BlockArray); + public override object Serialize(T input) + { + return oldmsgpack::MessagePack.LZ4MessagePackSerializer.Serialize(input, oldmsgpack::MessagePack.Resolvers.ContractlessStandardResolver.Instance); + } - public override T Deserialize(object input) - { - return newmsgpack::MessagePack.MessagePackSerializer.Deserialize((byte[])input, Options); + public override string ToString() + { + return "MsgPack_v1_str_lz4"; + } } - public override object Serialize(T input) + public class MsgPack_v2_str_lz4 : SerializerBase { - return newmsgpack::MessagePack.MessagePackSerializer.Serialize(input, Options); - } -} + private static readonly newmsgpack::MessagePack.MessagePackSerializerOptions Options = newmsgpack::MessagePack.MessagePackSerializerOptions.Standard + .WithResolver(newmsgpack::MessagePack.Resolvers.ContractlessStandardResolver.Instance) + .WithCompression(newmsgpack::MessagePack.MessagePackCompression.Lz4BlockArray); -public class MsgPack_v2_opt : SerializerBase -{ - private static readonly newmsgpack::MessagePack.MessagePackSerializerOptions Options = newmsgpack::MessagePack.MessagePackSerializerOptions.Standard.WithResolver(OptimizedResolver.Instance); + public override T Deserialize(object input) + { + return newmsgpack::MessagePack.MessagePackSerializer.Deserialize((byte[])input, Options); + } - public override T Deserialize(object input) - { - return newmsgpack::MessagePack.MessagePackSerializer.Deserialize((byte[])input, Options); + public override object Serialize(T input) + { + return newmsgpack::MessagePack.MessagePackSerializer.Serialize(input, Options); + } + + public override string ToString() + { + return "MsgPack_v2_str_lz4"; + } } - public override object Serialize(T input) + public class MsgPack_v2_opt : SerializerBase { - return newmsgpack::MessagePack.MessagePackSerializer.Serialize(input, Options); - } -} + private static readonly newmsgpack::MessagePack.MessagePackSerializerOptions Options = + newmsgpack::MessagePack.MessagePackSerializerOptions.Standard.WithResolver(OptimizedResolver.Instance); -public class OptimizedResolver : newmsgpack::MessagePack.IFormatterResolver -{ - public static readonly newmsgpack::MessagePack.IFormatterResolver Instance = new OptimizedResolver(); + public override T Deserialize(object input) + { + return newmsgpack::MessagePack.MessagePackSerializer.Deserialize((byte[])input, Options); + } - // configure your custom resolvers. - private static readonly newmsgpack::MessagePack.IFormatterResolver[] Resolvers = new newmsgpack::MessagePack.IFormatterResolver[] - { - newmsgpack::MessagePack.Resolvers.NativeGuidResolver.Instance, - newmsgpack::MessagePack.Resolvers.NativeDecimalResolver.Instance, - newmsgpack::MessagePack.Resolvers.NativeDateTimeResolver.Instance, - newmsgpack::MessagePack.Resolvers.StandardResolver.Instance, - }; + public override object Serialize(T input) + { + return newmsgpack::MessagePack.MessagePackSerializer.Serialize(input, Options); + } - private OptimizedResolver() - { + public override string ToString() + { + return "MsgPack_v2_opt"; + } } - public newmsgpack::MessagePack.Formatters.IMessagePackFormatter GetFormatter() + public class OptimizedResolver : newmsgpack::MessagePack.IFormatterResolver { - return Cache.Formatter; - } + public static readonly newmsgpack::MessagePack.IFormatterResolver Instance = new OptimizedResolver(); - private static class Cache - { -#pragma warning disable SA1401 // Fields should be private - public static newmsgpack::MessagePack.Formatters.IMessagePackFormatter Formatter; -#pragma warning restore SA1401 // Fields should be private + // configure your custom resolvers. + private static readonly newmsgpack::MessagePack.IFormatterResolver[] Resolvers = new newmsgpack::MessagePack.IFormatterResolver[] + { + newmsgpack::MessagePack.Resolvers.NativeGuidResolver.Instance, newmsgpack::MessagePack.Resolvers.NativeDecimalResolver.Instance, + newmsgpack::MessagePack.Resolvers.NativeDateTimeResolver.Instance, newmsgpack::MessagePack.Resolvers.StandardResolver.Instance, + }; - static Cache() + private OptimizedResolver() { - foreach (var resolver in Resolvers) + } + + public newmsgpack::MessagePack.Formatters.IMessagePackFormatter GetFormatter() + { + return Cache.Formatter; + } + + private static class Cache + { + #pragma warning disable SA1401 // Fields should be private + public static newmsgpack::MessagePack.Formatters.IMessagePackFormatter Formatter; + #pragma warning restore SA1401 // Fields should be private + + static Cache() { - var f = resolver.GetFormatter(); - if (f != null) + foreach (var resolver in Resolvers) { - Formatter = f; - return; + var f = resolver.GetFormatter(); + if (f != null) + { + Formatter = f; + return; + } } } } diff --git a/benchmark/SerializerBenchmark/Serializers/MsgPackCliSerializer.cs b/benchmark/SerializerBenchmark/Serializers/MsgPackCliSerializer.cs index a03127ae6..f3238d556 100644 --- a/benchmark/SerializerBenchmark/Serializers/MsgPackCliSerializer.cs +++ b/benchmark/SerializerBenchmark/Serializers/MsgPackCliSerializer.cs @@ -1,19 +1,23 @@ // Copyright (c) All contributors. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. -using Benchmark.Serializers; - -#pragma warning disable SA1649 // File name should match first type name - -public class MsgPackCli : SerializerBase +namespace Benchmark.Serializers { - public override T Deserialize(object input) + public class MsgPackCliSerializer : SerializerBase { - return MsgPack.Serialization.MessagePackSerializer.Get().UnpackSingleObject((byte[])input); - } + public override T Deserialize(object input) + { + return MsgPack.Serialization.MessagePackSerializer.Get().UnpackSingleObject((byte[])input); + } - public override object Serialize(T input) - { - return MsgPack.Serialization.MessagePackSerializer.Get().PackSingleObject(input); + public override object Serialize(T input) + { + return MsgPack.Serialization.MessagePackSerializer.Get().PackSingleObject(input); + } + + public override string ToString() + { + return "MsgPackCli"; + } } } diff --git a/benchmark/SerializerBenchmark/Serializers/OdinSerializer.cs b/benchmark/SerializerBenchmark/Serializers/OdinSerializer.cs new file mode 100644 index 000000000..b35de1af1 --- /dev/null +++ b/benchmark/SerializerBenchmark/Serializers/OdinSerializer.cs @@ -0,0 +1,29 @@ +// Copyright (c) All contributors. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +using Benchmark.Serializers; +using OdinSerializer; +using OdinSerializer.Utilities; + +#pragma warning disable SA1649 // File name should match first type name + +public class OdinSerializer_ : SerializerBase +{ + public override object Serialize(T input) + { + using (var ctx = Cache.Claim()) + { + ctx.Value.Config.SerializationPolicy = SerializationPolicies.Everything; + return SerializationUtility.SerializeValue(input, DataFormat.Binary, ctx.Value); + } + } + + public override T Deserialize(object input) + { + using (var ctx = Cache.Claim()) + { + ctx.Value.Config.SerializationPolicy = SerializationPolicies.Everything; + return SerializationUtility.DeserializeValue((byte[])input, DataFormat.Binary, ctx.Value); + } + } +} diff --git a/benchmark/SerializerBenchmark/Serializers/ProtobufNetSerializer.cs b/benchmark/SerializerBenchmark/Serializers/ProtobufNetSerializer.cs new file mode 100644 index 000000000..7b44b5a75 --- /dev/null +++ b/benchmark/SerializerBenchmark/Serializers/ProtobufNetSerializer.cs @@ -0,0 +1,33 @@ +// Copyright (c) All contributors. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +using System.IO; +using ProtoBuf; + +namespace Benchmark.Serializers +{ + public class ProtobufNetSerializer : SerializerBase + { + public override T Deserialize(object input) + { + using (var ms = new MemoryStream((byte[])input)) + { + return Serializer.Deserialize(ms); + } + } + + public override object Serialize(T input) + { + using (var ms = new MemoryStream()) + { + Serializer.Serialize(ms, input); + return ms.ToArray(); + } + } + + public override string ToString() + { + return "ProtobufNet"; + } + } +} diff --git a/benchmark/SerializerBenchmark/Serializers/ProtobufSerializer.cs b/benchmark/SerializerBenchmark/Serializers/ProtobufSerializer.cs deleted file mode 100644 index d0394065d..000000000 --- a/benchmark/SerializerBenchmark/Serializers/ProtobufSerializer.cs +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright (c) All contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using System.IO; -using Benchmark.Serializers; -using ProtoBuf; - -public class -#pragma warning disable SA1649 // File name should match first type name - -ProtobufNet : SerializerBase -{ - public override T Deserialize(object input) - { - using (var ms = new MemoryStream((byte[])input)) - { - return Serializer.Deserialize(ms); - } - } - - public override object Serialize(T input) - { - using (var ms = new MemoryStream()) - { - Serializer.Serialize(ms, input); - return ms.ToArray(); - } - } -} diff --git a/benchmark/SerializerBenchmark/Serializers/SpanJsonSerializer.cs b/benchmark/SerializerBenchmark/Serializers/SpanJsonSerializer.cs index a3a2f44d7..33ccbd998 100644 --- a/benchmark/SerializerBenchmark/Serializers/SpanJsonSerializer.cs +++ b/benchmark/SerializerBenchmark/Serializers/SpanJsonSerializer.cs @@ -1,19 +1,23 @@ // Copyright (c) All contributors. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. -using Benchmark.Serializers; - -#pragma warning disable SA1649 // File name should match first type name - -public class SpanJson_ : SerializerBase +namespace Benchmark.Serializers { - public override object Serialize(T input) + public class SpanJsonSerializer : SerializerBase { - return SpanJson.JsonSerializer.Generic.Utf8.Serialize(input); - } + public override object Serialize(T input) + { + return SpanJson.JsonSerializer.Generic.Utf8.Serialize(input); + } - public override T Deserialize(object input) - { - return SpanJson.JsonSerializer.Generic.Utf8.Deserialize((byte[])input); + public override T Deserialize(object input) + { + return SpanJson.JsonSerializer.Generic.Utf8.Deserialize((byte[])input); + } + + public override string ToString() + { + return "SpanJson"; + } } } diff --git a/benchmark/SerializerBenchmark/Serializers/SystemTextJsonSerializer.cs b/benchmark/SerializerBenchmark/Serializers/SystemTextJsonSerializer.cs index f6358d154..baf143f99 100644 --- a/benchmark/SerializerBenchmark/Serializers/SystemTextJsonSerializer.cs +++ b/benchmark/SerializerBenchmark/Serializers/SystemTextJsonSerializer.cs @@ -1,20 +1,24 @@ // Copyright (c) All contributors. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. -using Benchmark.Serializers; - -#pragma warning disable SA1649 // File name should match first type name - -public class SystemTextJson : SerializerBase +namespace Benchmark.Serializers { - public override object Serialize(T input) + public class SystemTextJsonSerializer : SerializerBase { - return System.Text.Json.JsonSerializer.SerializeToUtf8Bytes(input); - } + public override object Serialize(T input) + { + return System.Text.Json.JsonSerializer.SerializeToUtf8Bytes(input); + } - public override T Deserialize(object input) - { - var span = (byte[])input; - return System.Text.Json.JsonSerializer.Deserialize(span); + public override T Deserialize(object input) + { + var span = (byte[])input; + return System.Text.Json.JsonSerializer.Deserialize(span); + } + + public override string ToString() + { + return "SystemTextJson"; + } } } diff --git a/benchmark/SerializerBenchmark/Serializers/Utf8JsonSerializer.cs b/benchmark/SerializerBenchmark/Serializers/Utf8JsonSerializer.cs index f52b0d9b7..fec69a81a 100644 --- a/benchmark/SerializerBenchmark/Serializers/Utf8JsonSerializer.cs +++ b/benchmark/SerializerBenchmark/Serializers/Utf8JsonSerializer.cs @@ -1,19 +1,23 @@ // Copyright (c) All contributors. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. -using Benchmark.Serializers; - -#pragma warning disable SA1649 // File name should match first type name - -public class Utf8Json_ : SerializerBase +namespace Benchmark.Serializers { - public override object Serialize(T input) + public class Utf8JsonSerializer : SerializerBase { - return Utf8Json.JsonSerializer.Serialize(input); - } + public override object Serialize(T input) + { + return Utf8Json.JsonSerializer.Serialize(input); + } - public override T Deserialize(object input) - { - return Utf8Json.JsonSerializer.Deserialize((byte[])input); + public override T Deserialize(object input) + { + return Utf8Json.JsonSerializer.Deserialize((byte[])input); + } + + public override string ToString() + { + return "UTF8Json"; + } } } diff --git a/doc/consume_ci.md b/doc/consume_ci.md new file mode 100644 index 000000000..763f6f496 --- /dev/null +++ b/doc/consume_ci.md @@ -0,0 +1,17 @@ +# Testing fixes prior to release + +To help us test changes prior to their release to nuget.org, you can of course build from source. +An easier approach may be to consume the built nuget packages from our CI/PR feed. + +Add this feed to your nuget.config file: + +```xml + +``` + +Then you can add or update your package reference to some version recently built in our CI or PR build. +PR builds always include a `-gCOMMITID` version suffix. +CI builds lack this, but may include a standard pre-release identifier such as `-alpha`. + +If the change you seek is already merged, look for the latest version without the `-gCOMMITID` suffix. +If the change you seek is in an open PR, navigate to the PR build to find the version of the built package (it will be the build number). diff --git a/global.json b/global.json index 11833de02..954a92e75 100644 --- a/global.json +++ b/global.json @@ -1,6 +1,6 @@ { "sdk": { - "version": "3.1.301", + "version": "6.0.300", "rollForward": "patch", "allowPrerelease": false } diff --git a/init.cmd b/init.cmd index 970285c2f..667efabb7 100644 --- a/init.cmd +++ b/init.cmd @@ -1,4 +1,20 @@ @echo off SETLOCAL set PS1UnderCmd=1 + +:: Get the datetime in a format that can go in a filename. +set _my_datetime=%date%_%time% +set _my_datetime=%_my_datetime: =_% +set _my_datetime=%_my_datetime::=% +set _my_datetime=%_my_datetime:/=_% +set _my_datetime=%_my_datetime:.=_% +set CmdEnvScriptPath=%temp%\envvarscript_%_my_datetime%.cmd + powershell.exe -NoProfile -NoLogo -ExecutionPolicy bypass -Command "try { & '%~dpn0.ps1' %*; exit $LASTEXITCODE } catch { write-host $_; exit 1 }" + +:: Set environment variables in the parent cmd.exe process. +IF EXIST "%CmdEnvScriptPath%" ( + ENDLOCAL + CALL "%CmdEnvScriptPath%" + DEL "%CmdEnvScriptPath%" +) diff --git a/init.ps1 b/init.ps1 index 72d68b5fa..e5aad5bfa 100755 --- a/init.ps1 +++ b/init.ps1 @@ -2,28 +2,31 @@ <# .SYNOPSIS -Installs dependencies required to build and test the projects in this repository. + Installs dependencies required to build and test the projects in this repository. .DESCRIPTION -This MAY not require elevation, as the SDK and runtimes are installed to a per-user location, -unless the `-InstallLocality` switch is specified directing to a per-repo or per-machine location. -See detailed help on that switch for more information. + This MAY not require elevation, as the SDK and runtimes are installed to a per-user location, + unless the `-InstallLocality` switch is specified directing to a per-repo or per-machine location. + See detailed help on that switch for more information. + + The CmdEnvScriptPath environment variable may be optionally set to a path to a cmd shell script to be created (or appended to if it already exists) that will set the environment variables in cmd.exe that are set within the PowerShell environment. + This is used by init.cmd in order to reapply any new environment variables to the parent cmd.exe process that were set in the powershell child process. .PARAMETER InstallLocality -A value indicating whether dependencies should be installed locally to the repo or at a per-user location. -Per-user allows sharing the installed dependencies across repositories and allows use of a shared expanded package cache. -Visual Studio will only notice and use these SDKs/runtimes if VS is launched from the environment that runs this script. -Per-repo allows for high isolation, allowing for a more precise recreation of the environment within an Azure Pipelines build. -When using 'repo', environment variables are set to cause the locally installed dotnet SDK to be used. -Per-repo can lead to file locking issues when dotnet.exe is left running as a build server and can be mitigated by running `dotnet build-server shutdown`. -Per-machine requires elevation and will download and install all SDKs and runtimes to machine-wide locations so all applications can find it. + A value indicating whether dependencies should be installed locally to the repo or at a per-user location. + Per-user allows sharing the installed dependencies across repositories and allows use of a shared expanded package cache. + Visual Studio will only notice and use these SDKs/runtimes if VS is launched from the environment that runs this script. + Per-repo allows for high isolation, allowing for a more precise recreation of the environment within an Azure Pipelines build. + When using 'repo', environment variables are set to cause the locally installed dotnet SDK to be used. + Per-repo can lead to file locking issues when dotnet.exe is left running as a build server and can be mitigated by running `dotnet build-server shutdown`. + Per-machine requires elevation and will download and install all SDKs and runtimes to machine-wide locations so all applications can find it. .PARAMETER NoPrerequisites -Skips the installation of prerequisite software (e.g. SDKs, tools). + Skips the installation of prerequisite software (e.g. SDKs, tools). .PARAMETER UpgradePrerequisites -Takes time to install prerequisites even if they are already present in case they need to be upgraded. -No effect if -NoPrerequisites is specified. + Takes time to install prerequisites even if they are already present in case they need to be upgraded. + No effect if -NoPrerequisites is specified. .PARAMETER NoRestore -Skips the package restore step. + Skips the package restore step. .PARAMETER AccessToken -An optional access token for authenticating to Azure Artifacts authenticated feeds. + An optional access token for authenticating to Azure Artifacts authenticated feeds. #> [CmdletBinding(SupportsShouldProcess=$true)] Param ( @@ -71,7 +74,7 @@ try { } } - & "$PSScriptRoot\azure-pipelines\Set-EnvVars.ps1" -Variables $EnvVars | Out-Null + & "$PSScriptRoot/tools/Set-EnvVars.ps1" -Variables $EnvVars | Out-Null } catch { Write-Error $error[0] diff --git a/prepare_release.ps1 b/prepare_release.ps1 new file mode 100644 index 000000000..d5dc21d6f --- /dev/null +++ b/prepare_release.ps1 @@ -0,0 +1,14 @@ +# Calculate the NPM package version, assuming the version change is in a new commit. +git commit --allow-empty -m "Dummy commit" -q +$NpmPackageVersion = (nbgv get-version -f json | ConvertFrom-Json).NpmPackageVersion +git reset --mixed HEAD~ -q + +# Stamp the version into the package.json file and commit. +pushd $PSScriptRoot/src/MessagePack.UnityClient/Assets/Scripts/MessagePack +npm version $NpmPackageVersion --no-git-tag-version --allow-same-version +git add package.json +popd +git commit -m "Stamp unity package version as $NpmPackageVersion" + +# Tag the release +nbgv tag diff --git a/sandbox/DynamicCodeDumper/DynamicCodeDumper.csproj b/sandbox/DynamicCodeDumper/DynamicCodeDumper.csproj index 4ef220a07..0daf9da44 100644 --- a/sandbox/DynamicCodeDumper/DynamicCodeDumper.csproj +++ b/sandbox/DynamicCodeDumper/DynamicCodeDumper.csproj @@ -132,6 +132,9 @@ Code\DynamicUnionResolver.cs + + Code\ResolverUtilities.cs + Code\StringEncoding.cs @@ -140,8 +143,7 @@ - - - + + diff --git a/sandbox/DynamicCodeDumper/Program.cs b/sandbox/DynamicCodeDumper/Program.cs index 14f6199e9..0d74db48d 100644 --- a/sandbox/DynamicCodeDumper/Program.cs +++ b/sandbox/DynamicCodeDumper/Program.cs @@ -44,6 +44,7 @@ private static void Main(string[] args) ////DynamicObjectResolver.Instance.GetFormatter(); ////DynamicObjectResolver.Instance.GetFormatter(); IMessagePackFormatter f = DynamicObjectResolverAllowPrivate.Instance.GetFormatter(); + ////IMessagePackFormatter f = DynamicObjectResolver.Instance.GetFormatter(); ////DynamicObjectResolver.Instance.GetFormatter(); ////DynamicObjectResolver.Instance.GetFormatter(); ////DynamicObjectResolver.Instance.GetFormatter(); diff --git a/sandbox/MessagePack.Internal/MessagePack.Internal.csproj b/sandbox/MessagePack.Internal/MessagePack.Internal.csproj index d7e5caaad..283524803 100644 --- a/sandbox/MessagePack.Internal/MessagePack.Internal.csproj +++ b/sandbox/MessagePack.Internal/MessagePack.Internal.csproj @@ -1,7 +1,7 @@  - netcoreapp2.2 + netcoreapp3.1 $(DefineConstants);SPAN_BUILTIN;MESSAGEPACK_INTERNAL true True diff --git a/sandbox/PerfBenchmarkDotNet/DeserializeBenchmark.cs b/sandbox/PerfBenchmarkDotNet/DeserializeBenchmark.cs index 3c0ef2f29..68af163a9 100644 --- a/sandbox/PerfBenchmarkDotNet/DeserializeBenchmark.cs +++ b/sandbox/PerfBenchmarkDotNet/DeserializeBenchmark.cs @@ -1,4 +1,4 @@ -// Copyright (c) All contributors. All rights reserved. +// Copyright (c) All contributors. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. extern alias newmsgpack; @@ -60,6 +60,12 @@ public IntKeySerializerTarget IntKey() return newmsgpack.MessagePack.MessagePackSerializer.Deserialize(intObj); } + [Benchmark] + public IntKeySerializerTarget IntKey_NonGeneric() + { + return (IntKeySerializerTarget)newmsgpack.MessagePack.MessagePackSerializer.Deserialize(typeof(IntKeySerializerTarget), intObj); + } + [Benchmark] public StringKeySerializerTarget StringKey() { diff --git a/sandbox/PerfBenchmarkDotNet/MessagePackWriterBenchmark.cs b/sandbox/PerfBenchmarkDotNet/MessagePackWriterBenchmark.cs index 0cff63343..64e7c89a3 100644 --- a/sandbox/PerfBenchmarkDotNet/MessagePackWriterBenchmark.cs +++ b/sandbox/PerfBenchmarkDotNet/MessagePackWriterBenchmark.cs @@ -4,6 +4,7 @@ extern alias newmsgpack; extern alias oldmsgpack; +using System; using BenchmarkDotNet.Attributes; using BenchmarkDotNet.Configs; using Nerdbank.Streams; @@ -12,7 +13,7 @@ namespace PerfBenchmarkDotNet { [GroupBenchmarksBy(BenchmarkLogicalGroupRule.ByCategory)] [CategoriesColumn] - public class MessagePackWriterBenchmark + public class MessagePackWriterBenchmark : IDisposable { private const int RepsOverArray = 300 * 1024; private readonly Sequence sequence = new Sequence(); @@ -148,5 +149,19 @@ public void WriteString() offset = 0; } } + + public void Dispose() + { + this.Dispose(true); + GC.SuppressFinalize(this); + } + + protected virtual void Dispose(bool disposing) + { + if (disposing) + { + this.sequence.Dispose(); + } + } } } diff --git a/sandbox/PerfBenchmarkDotNet/PerfBenchmarkDotNet.csproj b/sandbox/PerfBenchmarkDotNet/PerfBenchmarkDotNet.csproj index 53bb5949d..6804253df 100644 --- a/sandbox/PerfBenchmarkDotNet/PerfBenchmarkDotNet.csproj +++ b/sandbox/PerfBenchmarkDotNet/PerfBenchmarkDotNet.csproj @@ -1,7 +1,7 @@  Exe - net472;netcoreapp2.2 + net472;net6.0 true true @@ -19,7 +19,7 @@ - + diff --git a/sandbox/PerfBenchmarkDotNet/SerializeBenchmark.cs b/sandbox/PerfBenchmarkDotNet/SerializeBenchmark.cs index 0ed114b06..fc9a3a06d 100644 --- a/sandbox/PerfBenchmarkDotNet/SerializeBenchmark.cs +++ b/sandbox/PerfBenchmarkDotNet/SerializeBenchmark.cs @@ -1,4 +1,4 @@ -// Copyright (c) All contributors. All rights reserved. +// Copyright (c) All contributors. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. extern alias newmsgpack; @@ -35,6 +35,12 @@ public byte[] IntKey() return newmsgpack.MessagePack.MessagePackSerializer.Serialize(intData); } + [Benchmark] + public byte[] IntKey_NonGeneric() + { + return newmsgpack.MessagePack.MessagePackSerializer.Serialize(typeof(IntKeySerializerTarget), intData); + } + [Benchmark] public byte[] StringKey() { diff --git a/sandbox/PerfNetFramework/PerfNetFramework.csproj b/sandbox/PerfNetFramework/PerfNetFramework.csproj index a0416f99f..57cbfd36e 100644 --- a/sandbox/PerfNetFramework/PerfNetFramework.csproj +++ b/sandbox/PerfNetFramework/PerfNetFramework.csproj @@ -1,12 +1,12 @@  Exe - net472;netcoreapp2.2 + net472;net6.0 true - + diff --git a/sandbox/Sandbox/Generated.cs b/sandbox/Sandbox/Generated.cs index 51a08d60b..bc3bcd7aa 100644 --- a/sandbox/Sandbox/Generated.cs +++ b/sandbox/Sandbox/Generated.cs @@ -6,15 +6,13 @@ #pragma warning disable 612 #pragma warning disable 414 #pragma warning disable 168 +#pragma warning disable CS1591 // document public APIs -#pragma warning disable SA1200 // Using directives should be placed correctly #pragma warning disable SA1312 // Variable names should begin with lower-case letter #pragma warning disable SA1649 // File name should match first type name namespace MessagePack.Resolvers { - using System; - public class GeneratedResolver : global::MessagePack.IFormatterResolver { public static readonly global::MessagePack.IFormatterResolver Instance = new GeneratedResolver(); @@ -45,11 +43,11 @@ static FormatterCache() internal static class GeneratedResolverGetFormatterHelper { - private static readonly global::System.Collections.Generic.Dictionary lookup; + private static readonly global::System.Collections.Generic.Dictionary lookup; static GeneratedResolverGetFormatterHelper() { - lookup = new global::System.Collections.Generic.Dictionary(65) + lookup = new global::System.Collections.Generic.Dictionary(72) { { typeof(global::GlobalMyEnum[,]), 0 }, { typeof(global::GlobalMyEnum[]), 1 }, @@ -72,54 +70,61 @@ static GeneratedResolverGetFormatterHelper() { typeof(global::ComplexModel), 18 }, { typeof(global::GlobalMan), 19 }, { typeof(global::Message), 20 }, - { typeof(global::PerfBenchmarkDotNet.StringKeySerializerTarget), 21 }, - { typeof(global::QuestMessageBody), 22 }, - { typeof(global::SharedData.ArrayOptimizeClass), 23 }, - { typeof(global::SharedData.BarClass), 24 }, - { typeof(global::SharedData.Callback1), 25 }, - { typeof(global::SharedData.Callback1_2), 26 }, - { typeof(global::SharedData.Callback2), 27 }, - { typeof(global::SharedData.Callback2_2), 28 }, - { typeof(global::SharedData.Empty1), 29 }, - { typeof(global::SharedData.Empty2), 30 }, - { typeof(global::SharedData.EmptyClass), 31 }, - { typeof(global::SharedData.EmptyStruct), 32 }, - { typeof(global::SharedData.FirstSimpleData), 33 }, - { typeof(global::SharedData.FooClass), 34 }, - { typeof(global::SharedData.HolderV0), 35 }, - { typeof(global::SharedData.HolderV1), 36 }, - { typeof(global::SharedData.HolderV2), 37 }, - { typeof(global::SharedData.MyClass), 38 }, - { typeof(global::SharedData.MySubUnion1), 39 }, - { typeof(global::SharedData.MySubUnion2), 40 }, - { typeof(global::SharedData.MySubUnion3), 41 }, - { typeof(global::SharedData.MySubUnion4), 42 }, - { typeof(global::SharedData.NestParent.NestContract), 43 }, - { typeof(global::SharedData.NonEmpty1), 44 }, - { typeof(global::SharedData.NonEmpty2), 45 }, - { typeof(global::SharedData.SimpleIntKeyData), 46 }, - { typeof(global::SharedData.SimpleStringKeyData), 47 }, - { typeof(global::SharedData.SimpleStructIntKeyData), 48 }, - { typeof(global::SharedData.SimpleStructStringKeyData), 49 }, - { typeof(global::SharedData.SubUnionType1), 50 }, - { typeof(global::SharedData.SubUnionType2), 51 }, - { typeof(global::SharedData.UnVersionBlockTest), 52 }, - { typeof(global::SharedData.Vector2), 53 }, - { typeof(global::SharedData.Vector3Like), 54 }, - { typeof(global::SharedData.VectorLike2), 55 }, - { typeof(global::SharedData.Version0), 56 }, - { typeof(global::SharedData.Version1), 57 }, - { typeof(global::SharedData.Version2), 58 }, - { typeof(global::SharedData.VersionBlockTest), 59 }, - { typeof(global::SharedData.VersioningUnion), 60 }, - { typeof(global::SharedData.WithIndexer), 61 }, - { typeof(global::SimpleModel), 62 }, - { typeof(global::StampMessageBody), 63 }, - { typeof(global::TextMessageBody), 64 }, + { typeof(global::MessagePackFormatterFieldUser), 21 }, + { typeof(global::PerfBenchmarkDotNet.StringKeySerializerTarget), 22 }, + { typeof(global::QuestMessageBody), 23 }, + { typeof(global::SharedData.ArrayOptimizeClass), 24 }, + { typeof(global::SharedData.BarClass), 25 }, + { typeof(global::SharedData.Callback1), 26 }, + { typeof(global::SharedData.Callback1_2), 27 }, + { typeof(global::SharedData.Callback2), 28 }, + { typeof(global::SharedData.Callback2_2), 29 }, + { typeof(global::SharedData.DefaultValueIntKeyClassWithExplicitConstructor), 30 }, + { typeof(global::SharedData.DefaultValueIntKeyClassWithoutExplicitConstructor), 31 }, + { typeof(global::SharedData.DefaultValueIntKeyStructWithExplicitConstructor), 32 }, + { typeof(global::SharedData.DefaultValueStringKeyClassWithExplicitConstructor), 33 }, + { typeof(global::SharedData.DefaultValueStringKeyClassWithoutExplicitConstructor), 34 }, + { typeof(global::SharedData.DefaultValueStringKeyStructWithExplicitConstructor), 35 }, + { typeof(global::SharedData.Empty1), 36 }, + { typeof(global::SharedData.Empty2), 37 }, + { typeof(global::SharedData.EmptyClass), 38 }, + { typeof(global::SharedData.EmptyStruct), 39 }, + { typeof(global::SharedData.FirstSimpleData), 40 }, + { typeof(global::SharedData.FooClass), 41 }, + { typeof(global::SharedData.HolderV0), 42 }, + { typeof(global::SharedData.HolderV1), 43 }, + { typeof(global::SharedData.HolderV2), 44 }, + { typeof(global::SharedData.MyClass), 45 }, + { typeof(global::SharedData.MySubUnion1), 46 }, + { typeof(global::SharedData.MySubUnion2), 47 }, + { typeof(global::SharedData.MySubUnion3), 48 }, + { typeof(global::SharedData.MySubUnion4), 49 }, + { typeof(global::SharedData.NestParent.NestContract), 50 }, + { typeof(global::SharedData.NonEmpty1), 51 }, + { typeof(global::SharedData.NonEmpty2), 52 }, + { typeof(global::SharedData.SimpleIntKeyData), 53 }, + { typeof(global::SharedData.SimpleStringKeyData), 54 }, + { typeof(global::SharedData.SimpleStructIntKeyData), 55 }, + { typeof(global::SharedData.SimpleStructStringKeyData), 56 }, + { typeof(global::SharedData.SubUnionType1), 57 }, + { typeof(global::SharedData.SubUnionType2), 58 }, + { typeof(global::SharedData.UnVersionBlockTest), 59 }, + { typeof(global::SharedData.Vector2), 60 }, + { typeof(global::SharedData.Vector3Like), 61 }, + { typeof(global::SharedData.VectorLike2), 62 }, + { typeof(global::SharedData.Version0), 63 }, + { typeof(global::SharedData.Version1), 64 }, + { typeof(global::SharedData.Version2), 65 }, + { typeof(global::SharedData.VersionBlockTest), 66 }, + { typeof(global::SharedData.VersioningUnion), 67 }, + { typeof(global::SharedData.WithIndexer), 68 }, + { typeof(global::SimpleModel), 69 }, + { typeof(global::StampMessageBody), 70 }, + { typeof(global::TextMessageBody), 71 }, }; } - internal static object GetFormatter(Type t) + internal static object GetFormatter(global::System.Type t) { int key; if (!lookup.TryGetValue(t, out key)) @@ -150,50 +155,57 @@ internal static object GetFormatter(Type t) case 18: return new MessagePack.Formatters.ComplexModelFormatter(); case 19: return new MessagePack.Formatters.GlobalManFormatter(); case 20: return new MessagePack.Formatters.MessageFormatter(); - case 21: return new MessagePack.Formatters.PerfBenchmarkDotNet.StringKeySerializerTargetFormatter(); - case 22: return new MessagePack.Formatters.QuestMessageBodyFormatter(); - case 23: return new MessagePack.Formatters.SharedData.ArrayOptimizeClassFormatter(); - case 24: return new MessagePack.Formatters.SharedData.BarClassFormatter(); - case 25: return new MessagePack.Formatters.SharedData.Callback1Formatter(); - case 26: return new MessagePack.Formatters.SharedData.Callback1_2Formatter(); - case 27: return new MessagePack.Formatters.SharedData.Callback2Formatter(); - case 28: return new MessagePack.Formatters.SharedData.Callback2_2Formatter(); - case 29: return new MessagePack.Formatters.SharedData.Empty1Formatter(); - case 30: return new MessagePack.Formatters.SharedData.Empty2Formatter(); - case 31: return new MessagePack.Formatters.SharedData.EmptyClassFormatter(); - case 32: return new MessagePack.Formatters.SharedData.EmptyStructFormatter(); - case 33: return new MessagePack.Formatters.SharedData.FirstSimpleDataFormatter(); - case 34: return new MessagePack.Formatters.SharedData.FooClassFormatter(); - case 35: return new MessagePack.Formatters.SharedData.HolderV0Formatter(); - case 36: return new MessagePack.Formatters.SharedData.HolderV1Formatter(); - case 37: return new MessagePack.Formatters.SharedData.HolderV2Formatter(); - case 38: return new MessagePack.Formatters.SharedData.MyClassFormatter(); - case 39: return new MessagePack.Formatters.SharedData.MySubUnion1Formatter(); - case 40: return new MessagePack.Formatters.SharedData.MySubUnion2Formatter(); - case 41: return new MessagePack.Formatters.SharedData.MySubUnion3Formatter(); - case 42: return new MessagePack.Formatters.SharedData.MySubUnion4Formatter(); - case 43: return new MessagePack.Formatters.SharedData.NestParent_NestContractFormatter(); - case 44: return new MessagePack.Formatters.SharedData.NonEmpty1Formatter(); - case 45: return new MessagePack.Formatters.SharedData.NonEmpty2Formatter(); - case 46: return new MessagePack.Formatters.SharedData.SimpleIntKeyDataFormatter(); - case 47: return new MessagePack.Formatters.SharedData.SimpleStringKeyDataFormatter(); - case 48: return new MessagePack.Formatters.SharedData.SimpleStructIntKeyDataFormatter(); - case 49: return new MessagePack.Formatters.SharedData.SimpleStructStringKeyDataFormatter(); - case 50: return new MessagePack.Formatters.SharedData.SubUnionType1Formatter(); - case 51: return new MessagePack.Formatters.SharedData.SubUnionType2Formatter(); - case 52: return new MessagePack.Formatters.SharedData.UnVersionBlockTestFormatter(); - case 53: return new MessagePack.Formatters.SharedData.Vector2Formatter(); - case 54: return new MessagePack.Formatters.SharedData.Vector3LikeFormatter(); - case 55: return new MessagePack.Formatters.SharedData.VectorLike2Formatter(); - case 56: return new MessagePack.Formatters.SharedData.Version0Formatter(); - case 57: return new MessagePack.Formatters.SharedData.Version1Formatter(); - case 58: return new MessagePack.Formatters.SharedData.Version2Formatter(); - case 59: return new MessagePack.Formatters.SharedData.VersionBlockTestFormatter(); - case 60: return new MessagePack.Formatters.SharedData.VersioningUnionFormatter(); - case 61: return new MessagePack.Formatters.SharedData.WithIndexerFormatter(); - case 62: return new MessagePack.Formatters.SimpleModelFormatter(); - case 63: return new MessagePack.Formatters.StampMessageBodyFormatter(); - case 64: return new MessagePack.Formatters.TextMessageBodyFormatter(); + case 21: return new MessagePack.Formatters.MessagePackFormatterFieldUserFormatter(); + case 22: return new MessagePack.Formatters.PerfBenchmarkDotNet.StringKeySerializerTargetFormatter(); + case 23: return new MessagePack.Formatters.QuestMessageBodyFormatter(); + case 24: return new MessagePack.Formatters.SharedData.ArrayOptimizeClassFormatter(); + case 25: return new MessagePack.Formatters.SharedData.BarClassFormatter(); + case 26: return new MessagePack.Formatters.SharedData.Callback1Formatter(); + case 27: return new MessagePack.Formatters.SharedData.Callback1_2Formatter(); + case 28: return new MessagePack.Formatters.SharedData.Callback2Formatter(); + case 29: return new MessagePack.Formatters.SharedData.Callback2_2Formatter(); + case 30: return new MessagePack.Formatters.SharedData.DefaultValueIntKeyClassWithExplicitConstructorFormatter(); + case 31: return new MessagePack.Formatters.SharedData.DefaultValueIntKeyClassWithoutExplicitConstructorFormatter(); + case 32: return new MessagePack.Formatters.SharedData.DefaultValueIntKeyStructWithExplicitConstructorFormatter(); + case 33: return new MessagePack.Formatters.SharedData.DefaultValueStringKeyClassWithExplicitConstructorFormatter(); + case 34: return new MessagePack.Formatters.SharedData.DefaultValueStringKeyClassWithoutExplicitConstructorFormatter(); + case 35: return new MessagePack.Formatters.SharedData.DefaultValueStringKeyStructWithExplicitConstructorFormatter(); + case 36: return new MessagePack.Formatters.SharedData.Empty1Formatter(); + case 37: return new MessagePack.Formatters.SharedData.Empty2Formatter(); + case 38: return new MessagePack.Formatters.SharedData.EmptyClassFormatter(); + case 39: return new MessagePack.Formatters.SharedData.EmptyStructFormatter(); + case 40: return new MessagePack.Formatters.SharedData.FirstSimpleDataFormatter(); + case 41: return new MessagePack.Formatters.SharedData.FooClassFormatter(); + case 42: return new MessagePack.Formatters.SharedData.HolderV0Formatter(); + case 43: return new MessagePack.Formatters.SharedData.HolderV1Formatter(); + case 44: return new MessagePack.Formatters.SharedData.HolderV2Formatter(); + case 45: return new MessagePack.Formatters.SharedData.MyClassFormatter(); + case 46: return new MessagePack.Formatters.SharedData.MySubUnion1Formatter(); + case 47: return new MessagePack.Formatters.SharedData.MySubUnion2Formatter(); + case 48: return new MessagePack.Formatters.SharedData.MySubUnion3Formatter(); + case 49: return new MessagePack.Formatters.SharedData.MySubUnion4Formatter(); + case 50: return new MessagePack.Formatters.SharedData.NestParent_NestContractFormatter(); + case 51: return new MessagePack.Formatters.SharedData.NonEmpty1Formatter(); + case 52: return new MessagePack.Formatters.SharedData.NonEmpty2Formatter(); + case 53: return new MessagePack.Formatters.SharedData.SimpleIntKeyDataFormatter(); + case 54: return new MessagePack.Formatters.SharedData.SimpleStringKeyDataFormatter(); + case 55: return new MessagePack.Formatters.SharedData.SimpleStructIntKeyDataFormatter(); + case 56: return new MessagePack.Formatters.SharedData.SimpleStructStringKeyDataFormatter(); + case 57: return new MessagePack.Formatters.SharedData.SubUnionType1Formatter(); + case 58: return new MessagePack.Formatters.SharedData.SubUnionType2Formatter(); + case 59: return new MessagePack.Formatters.SharedData.UnVersionBlockTestFormatter(); + case 60: return new MessagePack.Formatters.SharedData.Vector2Formatter(); + case 61: return new MessagePack.Formatters.SharedData.Vector3LikeFormatter(); + case 62: return new MessagePack.Formatters.SharedData.VectorLike2Formatter(); + case 63: return new MessagePack.Formatters.SharedData.Version0Formatter(); + case 64: return new MessagePack.Formatters.SharedData.Version1Formatter(); + case 65: return new MessagePack.Formatters.SharedData.Version2Formatter(); + case 66: return new MessagePack.Formatters.SharedData.VersionBlockTestFormatter(); + case 67: return new MessagePack.Formatters.SharedData.VersioningUnionFormatter(); + case 68: return new MessagePack.Formatters.SharedData.WithIndexerFormatter(); + case 69: return new MessagePack.Formatters.SimpleModelFormatter(); + case 70: return new MessagePack.Formatters.StampMessageBodyFormatter(); + case 71: return new MessagePack.Formatters.TextMessageBodyFormatter(); default: return null; } } @@ -206,7 +218,6 @@ internal static object GetFormatter(Type t) #pragma warning restore 612 #pragma warning restore SA1312 // Variable names should begin with lower-case letter -#pragma warning restore SA1200 // Using directives should be placed correctly #pragma warning restore SA1649 // File name should match first type name @@ -218,25 +229,22 @@ internal static object GetFormatter(Type t) #pragma warning disable 612 #pragma warning disable 414 #pragma warning disable 168 +#pragma warning disable CS1591 // document public APIs -#pragma warning disable SA1200 // Using directives should be placed correctly #pragma warning disable SA1403 // File may only contain a single namespace #pragma warning disable SA1649 // File name should match first type name namespace MessagePack.Formatters { - using System; - using System.Buffers; - using MessagePack; public sealed class GlobalMyEnumFormatter : global::MessagePack.Formatters.IMessagePackFormatter { - public void Serialize(ref MessagePackWriter writer, global::GlobalMyEnum value, global::MessagePack.MessagePackSerializerOptions options) + public void Serialize(ref global::MessagePack.MessagePackWriter writer, global::GlobalMyEnum value, global::MessagePack.MessagePackSerializerOptions options) { - writer.Write((Int32)value); + writer.Write((global::System.Int32)value); } - public global::GlobalMyEnum Deserialize(ref MessagePackReader reader, global::MessagePack.MessagePackSerializerOptions options) + public global::GlobalMyEnum Deserialize(ref global::MessagePack.MessagePackReader reader, global::MessagePack.MessagePackSerializerOptions options) { return (global::GlobalMyEnum)reader.ReadInt32(); } @@ -248,7 +256,6 @@ public void Serialize(ref MessagePackWriter writer, global::GlobalMyEnum value, #pragma warning restore 618 #pragma warning restore 612 -#pragma warning restore SA1200 // Using directives should be placed correctly #pragma warning restore SA1403 // File may only contain a single namespace #pragma warning restore SA1649 // File name should match first type name @@ -260,25 +267,22 @@ public void Serialize(ref MessagePackWriter writer, global::GlobalMyEnum value, #pragma warning disable 612 #pragma warning disable 414 #pragma warning disable 168 +#pragma warning disable CS1591 // document public APIs -#pragma warning disable SA1200 // Using directives should be placed correctly #pragma warning disable SA1403 // File may only contain a single namespace #pragma warning disable SA1649 // File name should match first type name namespace MessagePack.Formatters.SharedData { - using System; - using System.Buffers; - using MessagePack; public sealed class ByteEnumFormatter : global::MessagePack.Formatters.IMessagePackFormatter { - public void Serialize(ref MessagePackWriter writer, global::SharedData.ByteEnum value, global::MessagePack.MessagePackSerializerOptions options) + public void Serialize(ref global::MessagePack.MessagePackWriter writer, global::SharedData.ByteEnum value, global::MessagePack.MessagePackSerializerOptions options) { - writer.Write((Byte)value); + writer.Write((global::System.Byte)value); } - public global::SharedData.ByteEnum Deserialize(ref MessagePackReader reader, global::MessagePack.MessagePackSerializerOptions options) + public global::SharedData.ByteEnum Deserialize(ref global::MessagePack.MessagePackReader reader, global::MessagePack.MessagePackSerializerOptions options) { return (global::SharedData.ByteEnum)reader.ReadByte(); } @@ -290,7 +294,6 @@ public void Serialize(ref MessagePackWriter writer, global::SharedData.ByteEnum #pragma warning restore 618 #pragma warning restore 612 -#pragma warning restore SA1200 // Using directives should be placed correctly #pragma warning restore SA1403 // File may only contain a single namespace #pragma warning restore SA1649 // File name should match first type name @@ -303,32 +306,27 @@ public void Serialize(ref MessagePackWriter writer, global::SharedData.ByteEnum #pragma warning disable 612 #pragma warning disable 414 #pragma warning disable 168 +#pragma warning disable CS1591 // document public APIs -#pragma warning disable SA1200 // Using directives should be placed correctly #pragma warning disable SA1403 // File may only contain a single namespace #pragma warning disable SA1649 // File name should match first type name namespace MessagePack.Formatters { - using System; - using System.Buffers; - using System.Collections.Generic; - using MessagePack; - public sealed class IMessageBodyFormatter : global::MessagePack.Formatters.IMessagePackFormatter { - private readonly Dictionary> typeToKeyAndJumpMap; - private readonly Dictionary keyToJumpMap; + private readonly global::System.Collections.Generic.Dictionary> typeToKeyAndJumpMap; + private readonly global::System.Collections.Generic.Dictionary keyToJumpMap; public IMessageBodyFormatter() { - this.typeToKeyAndJumpMap = new Dictionary>(3, global::MessagePack.Internal.RuntimeTypeHandleEqualityComparer.Default) + this.typeToKeyAndJumpMap = new global::System.Collections.Generic.Dictionary>(3, global::MessagePack.Internal.RuntimeTypeHandleEqualityComparer.Default) { - { typeof(global::TextMessageBody).TypeHandle, new KeyValuePair(10, 0) }, - { typeof(global::StampMessageBody).TypeHandle, new KeyValuePair(14, 1) }, - { typeof(global::QuestMessageBody).TypeHandle, new KeyValuePair(25, 2) }, + { typeof(global::TextMessageBody).TypeHandle, new global::System.Collections.Generic.KeyValuePair(10, 0) }, + { typeof(global::StampMessageBody).TypeHandle, new global::System.Collections.Generic.KeyValuePair(14, 1) }, + { typeof(global::QuestMessageBody).TypeHandle, new global::System.Collections.Generic.KeyValuePair(25, 2) }, }; - this.keyToJumpMap = new Dictionary(3) + this.keyToJumpMap = new global::System.Collections.Generic.Dictionary(3) { { 10, 0 }, { 14, 1 }, @@ -336,9 +334,9 @@ public IMessageBodyFormatter() }; } - public void Serialize(ref MessagePackWriter writer, global::IMessageBody value, global::MessagePack.MessagePackSerializerOptions options) + public void Serialize(ref global::MessagePack.MessagePackWriter writer, global::IMessageBody value, global::MessagePack.MessagePackSerializerOptions options) { - KeyValuePair keyValuePair; + global::System.Collections.Generic.KeyValuePair keyValuePair; if (value != null && this.typeToKeyAndJumpMap.TryGetValue(value.GetType().TypeHandle, out keyValuePair)) { writer.WriteArrayHeader(2); @@ -364,7 +362,7 @@ public void Serialize(ref MessagePackWriter writer, global::IMessageBody value, writer.WriteNil(); } - public global::IMessageBody Deserialize(ref MessagePackReader reader, global::MessagePack.MessagePackSerializerOptions options) + public global::IMessageBody Deserialize(ref global::MessagePack.MessagePackReader reader, global::MessagePack.MessagePackSerializerOptions options) { if (reader.TryReadNil()) { @@ -373,7 +371,7 @@ public void Serialize(ref MessagePackWriter writer, global::IMessageBody value, if (reader.ReadArrayHeader() != 2) { - throw new InvalidOperationException("Invalid Union data was detected. Type:global::IMessageBody"); + throw new global::System.InvalidOperationException("Invalid Union data was detected. Type:global::IMessageBody"); } options.Security.DepthStep(ref reader); @@ -414,7 +412,6 @@ public void Serialize(ref MessagePackWriter writer, global::IMessageBody value, #pragma warning restore 618 #pragma warning restore 612 -#pragma warning restore SA1200 // Using directives should be placed correctly #pragma warning restore SA1403 // File may only contain a single namespace #pragma warning restore SA1649 // File name should match first type name @@ -426,38 +423,33 @@ public void Serialize(ref MessagePackWriter writer, global::IMessageBody value, #pragma warning disable 612 #pragma warning disable 414 #pragma warning disable 168 +#pragma warning disable CS1591 // document public APIs -#pragma warning disable SA1200 // Using directives should be placed correctly #pragma warning disable SA1403 // File may only contain a single namespace #pragma warning disable SA1649 // File name should match first type name namespace MessagePack.Formatters.SharedData { - using System; - using System.Buffers; - using System.Collections.Generic; - using MessagePack; - public sealed class IIVersioningUnionFormatter : global::MessagePack.Formatters.IMessagePackFormatter { - private readonly Dictionary> typeToKeyAndJumpMap; - private readonly Dictionary keyToJumpMap; + private readonly global::System.Collections.Generic.Dictionary> typeToKeyAndJumpMap; + private readonly global::System.Collections.Generic.Dictionary keyToJumpMap; public IIVersioningUnionFormatter() { - this.typeToKeyAndJumpMap = new Dictionary>(1, global::MessagePack.Internal.RuntimeTypeHandleEqualityComparer.Default) + this.typeToKeyAndJumpMap = new global::System.Collections.Generic.Dictionary>(1, global::MessagePack.Internal.RuntimeTypeHandleEqualityComparer.Default) { - { typeof(global::SharedData.MySubUnion1).TypeHandle, new KeyValuePair(0, 0) }, + { typeof(global::SharedData.MySubUnion1).TypeHandle, new global::System.Collections.Generic.KeyValuePair(0, 0) }, }; - this.keyToJumpMap = new Dictionary(1) + this.keyToJumpMap = new global::System.Collections.Generic.Dictionary(1) { { 0, 0 }, }; } - public void Serialize(ref MessagePackWriter writer, global::SharedData.IIVersioningUnion value, global::MessagePack.MessagePackSerializerOptions options) + public void Serialize(ref global::MessagePack.MessagePackWriter writer, global::SharedData.IIVersioningUnion value, global::MessagePack.MessagePackSerializerOptions options) { - KeyValuePair keyValuePair; + global::System.Collections.Generic.KeyValuePair keyValuePair; if (value != null && this.typeToKeyAndJumpMap.TryGetValue(value.GetType().TypeHandle, out keyValuePair)) { writer.WriteArrayHeader(2); @@ -477,7 +469,7 @@ public void Serialize(ref MessagePackWriter writer, global::SharedData.IIVersion writer.WriteNil(); } - public global::SharedData.IIVersioningUnion Deserialize(ref MessagePackReader reader, global::MessagePack.MessagePackSerializerOptions options) + public global::SharedData.IIVersioningUnion Deserialize(ref global::MessagePack.MessagePackReader reader, global::MessagePack.MessagePackSerializerOptions options) { if (reader.TryReadNil()) { @@ -486,7 +478,7 @@ public void Serialize(ref MessagePackWriter writer, global::SharedData.IIVersion if (reader.ReadArrayHeader() != 2) { - throw new InvalidOperationException("Invalid Union data was detected. Type:global::SharedData.IIVersioningUnion"); + throw new global::System.InvalidOperationException("Invalid Union data was detected. Type:global::SharedData.IIVersioningUnion"); } options.Security.DepthStep(ref reader); @@ -515,19 +507,19 @@ public void Serialize(ref MessagePackWriter writer, global::SharedData.IIVersion public sealed class IUnionCheckerFormatter : global::MessagePack.Formatters.IMessagePackFormatter { - private readonly Dictionary> typeToKeyAndJumpMap; - private readonly Dictionary keyToJumpMap; + private readonly global::System.Collections.Generic.Dictionary> typeToKeyAndJumpMap; + private readonly global::System.Collections.Generic.Dictionary keyToJumpMap; public IUnionCheckerFormatter() { - this.typeToKeyAndJumpMap = new Dictionary>(4, global::MessagePack.Internal.RuntimeTypeHandleEqualityComparer.Default) + this.typeToKeyAndJumpMap = new global::System.Collections.Generic.Dictionary>(4, global::MessagePack.Internal.RuntimeTypeHandleEqualityComparer.Default) { - { typeof(global::SharedData.MySubUnion1).TypeHandle, new KeyValuePair(0, 0) }, - { typeof(global::SharedData.MySubUnion2).TypeHandle, new KeyValuePair(1, 1) }, - { typeof(global::SharedData.MySubUnion3).TypeHandle, new KeyValuePair(2, 2) }, - { typeof(global::SharedData.MySubUnion4).TypeHandle, new KeyValuePair(3, 3) }, + { typeof(global::SharedData.MySubUnion1).TypeHandle, new global::System.Collections.Generic.KeyValuePair(0, 0) }, + { typeof(global::SharedData.MySubUnion2).TypeHandle, new global::System.Collections.Generic.KeyValuePair(1, 1) }, + { typeof(global::SharedData.MySubUnion3).TypeHandle, new global::System.Collections.Generic.KeyValuePair(2, 2) }, + { typeof(global::SharedData.MySubUnion4).TypeHandle, new global::System.Collections.Generic.KeyValuePair(3, 3) }, }; - this.keyToJumpMap = new Dictionary(4) + this.keyToJumpMap = new global::System.Collections.Generic.Dictionary(4) { { 0, 0 }, { 1, 1 }, @@ -536,9 +528,9 @@ public IUnionCheckerFormatter() }; } - public void Serialize(ref MessagePackWriter writer, global::SharedData.IUnionChecker value, global::MessagePack.MessagePackSerializerOptions options) + public void Serialize(ref global::MessagePack.MessagePackWriter writer, global::SharedData.IUnionChecker value, global::MessagePack.MessagePackSerializerOptions options) { - KeyValuePair keyValuePair; + global::System.Collections.Generic.KeyValuePair keyValuePair; if (value != null && this.typeToKeyAndJumpMap.TryGetValue(value.GetType().TypeHandle, out keyValuePair)) { writer.WriteArrayHeader(2); @@ -567,7 +559,7 @@ public void Serialize(ref MessagePackWriter writer, global::SharedData.IUnionChe writer.WriteNil(); } - public global::SharedData.IUnionChecker Deserialize(ref MessagePackReader reader, global::MessagePack.MessagePackSerializerOptions options) + public global::SharedData.IUnionChecker Deserialize(ref global::MessagePack.MessagePackReader reader, global::MessagePack.MessagePackSerializerOptions options) { if (reader.TryReadNil()) { @@ -576,7 +568,7 @@ public void Serialize(ref MessagePackWriter writer, global::SharedData.IUnionChe if (reader.ReadArrayHeader() != 2) { - throw new InvalidOperationException("Invalid Union data was detected. Type:global::SharedData.IUnionChecker"); + throw new global::System.InvalidOperationException("Invalid Union data was detected. Type:global::SharedData.IUnionChecker"); } options.Security.DepthStep(ref reader); @@ -614,19 +606,19 @@ public void Serialize(ref MessagePackWriter writer, global::SharedData.IUnionChe public sealed class IUnionChecker2Formatter : global::MessagePack.Formatters.IMessagePackFormatter { - private readonly Dictionary> typeToKeyAndJumpMap; - private readonly Dictionary keyToJumpMap; + private readonly global::System.Collections.Generic.Dictionary> typeToKeyAndJumpMap; + private readonly global::System.Collections.Generic.Dictionary keyToJumpMap; public IUnionChecker2Formatter() { - this.typeToKeyAndJumpMap = new Dictionary>(4, global::MessagePack.Internal.RuntimeTypeHandleEqualityComparer.Default) + this.typeToKeyAndJumpMap = new global::System.Collections.Generic.Dictionary>(4, global::MessagePack.Internal.RuntimeTypeHandleEqualityComparer.Default) { - { typeof(global::SharedData.MySubUnion2).TypeHandle, new KeyValuePair(31, 0) }, - { typeof(global::SharedData.MySubUnion3).TypeHandle, new KeyValuePair(42, 1) }, - { typeof(global::SharedData.MySubUnion4).TypeHandle, new KeyValuePair(63, 2) }, - { typeof(global::SharedData.MySubUnion1).TypeHandle, new KeyValuePair(120, 3) }, + { typeof(global::SharedData.MySubUnion2).TypeHandle, new global::System.Collections.Generic.KeyValuePair(31, 0) }, + { typeof(global::SharedData.MySubUnion3).TypeHandle, new global::System.Collections.Generic.KeyValuePair(42, 1) }, + { typeof(global::SharedData.MySubUnion4).TypeHandle, new global::System.Collections.Generic.KeyValuePair(63, 2) }, + { typeof(global::SharedData.MySubUnion1).TypeHandle, new global::System.Collections.Generic.KeyValuePair(120, 3) }, }; - this.keyToJumpMap = new Dictionary(4) + this.keyToJumpMap = new global::System.Collections.Generic.Dictionary(4) { { 31, 0 }, { 42, 1 }, @@ -635,9 +627,9 @@ public IUnionChecker2Formatter() }; } - public void Serialize(ref MessagePackWriter writer, global::SharedData.IUnionChecker2 value, global::MessagePack.MessagePackSerializerOptions options) + public void Serialize(ref global::MessagePack.MessagePackWriter writer, global::SharedData.IUnionChecker2 value, global::MessagePack.MessagePackSerializerOptions options) { - KeyValuePair keyValuePair; + global::System.Collections.Generic.KeyValuePair keyValuePair; if (value != null && this.typeToKeyAndJumpMap.TryGetValue(value.GetType().TypeHandle, out keyValuePair)) { writer.WriteArrayHeader(2); @@ -666,7 +658,7 @@ public void Serialize(ref MessagePackWriter writer, global::SharedData.IUnionChe writer.WriteNil(); } - public global::SharedData.IUnionChecker2 Deserialize(ref MessagePackReader reader, global::MessagePack.MessagePackSerializerOptions options) + public global::SharedData.IUnionChecker2 Deserialize(ref global::MessagePack.MessagePackReader reader, global::MessagePack.MessagePackSerializerOptions options) { if (reader.TryReadNil()) { @@ -675,7 +667,7 @@ public void Serialize(ref MessagePackWriter writer, global::SharedData.IUnionChe if (reader.ReadArrayHeader() != 2) { - throw new InvalidOperationException("Invalid Union data was detected. Type:global::SharedData.IUnionChecker2"); + throw new global::System.InvalidOperationException("Invalid Union data was detected. Type:global::SharedData.IUnionChecker2"); } options.Security.DepthStep(ref reader); @@ -713,26 +705,26 @@ public void Serialize(ref MessagePackWriter writer, global::SharedData.IUnionChe public sealed class IUnionSampleFormatter : global::MessagePack.Formatters.IMessagePackFormatter { - private readonly Dictionary> typeToKeyAndJumpMap; - private readonly Dictionary keyToJumpMap; + private readonly global::System.Collections.Generic.Dictionary> typeToKeyAndJumpMap; + private readonly global::System.Collections.Generic.Dictionary keyToJumpMap; public IUnionSampleFormatter() { - this.typeToKeyAndJumpMap = new Dictionary>(2, global::MessagePack.Internal.RuntimeTypeHandleEqualityComparer.Default) + this.typeToKeyAndJumpMap = new global::System.Collections.Generic.Dictionary>(2, global::MessagePack.Internal.RuntimeTypeHandleEqualityComparer.Default) { - { typeof(global::SharedData.FooClass).TypeHandle, new KeyValuePair(0, 0) }, - { typeof(global::SharedData.BarClass).TypeHandle, new KeyValuePair(100, 1) }, + { typeof(global::SharedData.FooClass).TypeHandle, new global::System.Collections.Generic.KeyValuePair(0, 0) }, + { typeof(global::SharedData.BarClass).TypeHandle, new global::System.Collections.Generic.KeyValuePair(100, 1) }, }; - this.keyToJumpMap = new Dictionary(2) + this.keyToJumpMap = new global::System.Collections.Generic.Dictionary(2) { { 0, 0 }, { 100, 1 }, }; } - public void Serialize(ref MessagePackWriter writer, global::SharedData.IUnionSample value, global::MessagePack.MessagePackSerializerOptions options) + public void Serialize(ref global::MessagePack.MessagePackWriter writer, global::SharedData.IUnionSample value, global::MessagePack.MessagePackSerializerOptions options) { - KeyValuePair keyValuePair; + global::System.Collections.Generic.KeyValuePair keyValuePair; if (value != null && this.typeToKeyAndJumpMap.TryGetValue(value.GetType().TypeHandle, out keyValuePair)) { writer.WriteArrayHeader(2); @@ -755,7 +747,7 @@ public void Serialize(ref MessagePackWriter writer, global::SharedData.IUnionSam writer.WriteNil(); } - public global::SharedData.IUnionSample Deserialize(ref MessagePackReader reader, global::MessagePack.MessagePackSerializerOptions options) + public global::SharedData.IUnionSample Deserialize(ref global::MessagePack.MessagePackReader reader, global::MessagePack.MessagePackSerializerOptions options) { if (reader.TryReadNil()) { @@ -764,7 +756,7 @@ public void Serialize(ref MessagePackWriter writer, global::SharedData.IUnionSam if (reader.ReadArrayHeader() != 2) { - throw new InvalidOperationException("Invalid Union data was detected. Type:global::SharedData.IUnionSample"); + throw new global::System.InvalidOperationException("Invalid Union data was detected. Type:global::SharedData.IUnionSample"); } options.Security.DepthStep(ref reader); @@ -796,26 +788,26 @@ public void Serialize(ref MessagePackWriter writer, global::SharedData.IUnionSam public sealed class RootUnionTypeFormatter : global::MessagePack.Formatters.IMessagePackFormatter { - private readonly Dictionary> typeToKeyAndJumpMap; - private readonly Dictionary keyToJumpMap; + private readonly global::System.Collections.Generic.Dictionary> typeToKeyAndJumpMap; + private readonly global::System.Collections.Generic.Dictionary keyToJumpMap; public RootUnionTypeFormatter() { - this.typeToKeyAndJumpMap = new Dictionary>(2, global::MessagePack.Internal.RuntimeTypeHandleEqualityComparer.Default) + this.typeToKeyAndJumpMap = new global::System.Collections.Generic.Dictionary>(2, global::MessagePack.Internal.RuntimeTypeHandleEqualityComparer.Default) { - { typeof(global::SharedData.SubUnionType1).TypeHandle, new KeyValuePair(0, 0) }, - { typeof(global::SharedData.SubUnionType2).TypeHandle, new KeyValuePair(1, 1) }, + { typeof(global::SharedData.SubUnionType1).TypeHandle, new global::System.Collections.Generic.KeyValuePair(0, 0) }, + { typeof(global::SharedData.SubUnionType2).TypeHandle, new global::System.Collections.Generic.KeyValuePair(1, 1) }, }; - this.keyToJumpMap = new Dictionary(2) + this.keyToJumpMap = new global::System.Collections.Generic.Dictionary(2) { { 0, 0 }, { 1, 1 }, }; } - public void Serialize(ref MessagePackWriter writer, global::SharedData.RootUnionType value, global::MessagePack.MessagePackSerializerOptions options) + public void Serialize(ref global::MessagePack.MessagePackWriter writer, global::SharedData.RootUnionType value, global::MessagePack.MessagePackSerializerOptions options) { - KeyValuePair keyValuePair; + global::System.Collections.Generic.KeyValuePair keyValuePair; if (value != null && this.typeToKeyAndJumpMap.TryGetValue(value.GetType().TypeHandle, out keyValuePair)) { writer.WriteArrayHeader(2); @@ -838,7 +830,7 @@ public void Serialize(ref MessagePackWriter writer, global::SharedData.RootUnion writer.WriteNil(); } - public global::SharedData.RootUnionType Deserialize(ref MessagePackReader reader, global::MessagePack.MessagePackSerializerOptions options) + public global::SharedData.RootUnionType Deserialize(ref global::MessagePack.MessagePackReader reader, global::MessagePack.MessagePackSerializerOptions options) { if (reader.TryReadNil()) { @@ -847,7 +839,7 @@ public void Serialize(ref MessagePackWriter writer, global::SharedData.RootUnion if (reader.ReadArrayHeader() != 2) { - throw new InvalidOperationException("Invalid Union data was detected. Type:global::SharedData.RootUnionType"); + throw new global::System.InvalidOperationException("Invalid Union data was detected. Type:global::SharedData.RootUnionType"); } options.Security.DepthStep(ref reader); @@ -885,7 +877,6 @@ public void Serialize(ref MessagePackWriter writer, global::SharedData.RootUnion #pragma warning restore 618 #pragma warning restore 612 -#pragma warning restore SA1200 // Using directives should be placed correctly #pragma warning restore SA1403 // File may only contain a single namespace #pragma warning restore SA1649 // File name should match first type name @@ -898,9 +889,9 @@ public void Serialize(ref MessagePackWriter writer, global::SharedData.RootUnion #pragma warning disable 612 #pragma warning disable 414 #pragma warning disable 168 +#pragma warning disable CS1591 // document public APIs #pragma warning disable SA1129 // Do not use default value type constructor -#pragma warning disable SA1200 // Using directives should be placed correctly #pragma warning disable SA1309 // Field names should not begin with underscore #pragma warning disable SA1312 // Variable names should begin with lower-case letter #pragma warning disable SA1403 // File may only contain a single namespace @@ -908,14 +899,10 @@ public void Serialize(ref MessagePackWriter writer, global::SharedData.RootUnion namespace MessagePack.Formatters.Abcdefg.Efcdigjl.Ateatatea.Hgfagfafgad { - using System; - using System.Buffers; - using MessagePack; - public sealed class TnonodsfarnoiuAtatqagaFormatter : global::MessagePack.Formatters.IMessagePackFormatter { - public void Serialize(ref MessagePackWriter writer, global::Abcdefg.Efcdigjl.Ateatatea.Hgfagfafgad.TnonodsfarnoiuAtatqaga value, global::MessagePack.MessagePackSerializerOptions options) + public void Serialize(ref global::MessagePack.MessagePackWriter writer, global::Abcdefg.Efcdigjl.Ateatatea.Hgfagfafgad.TnonodsfarnoiuAtatqaga value, global::MessagePack.MessagePackSerializerOptions options) { if (value == null) { @@ -927,7 +914,7 @@ public void Serialize(ref MessagePackWriter writer, global::Abcdefg.Efcdigjl.Ate writer.Write(value.MyProperty); } - public global::Abcdefg.Efcdigjl.Ateatatea.Hgfagfafgad.TnonodsfarnoiuAtatqaga Deserialize(ref MessagePackReader reader, global::MessagePack.MessagePackSerializerOptions options) + public global::Abcdefg.Efcdigjl.Ateatatea.Hgfagfafgad.TnonodsfarnoiuAtatqaga Deserialize(ref global::MessagePack.MessagePackReader reader, global::MessagePack.MessagePackSerializerOptions options) { if (reader.TryReadNil()) { @@ -936,14 +923,14 @@ public void Serialize(ref MessagePackWriter writer, global::Abcdefg.Efcdigjl.Ate options.Security.DepthStep(ref reader); var length = reader.ReadArrayHeader(); - var __MyProperty__ = default(int); + var ____result = new global::Abcdefg.Efcdigjl.Ateatatea.Hgfagfafgad.TnonodsfarnoiuAtatqaga(); for (int i = 0; i < length; i++) { switch (i) { case 0: - __MyProperty__ = reader.ReadInt32(); + ____result.MyProperty = reader.ReadInt32(); break; default: reader.Skip(); @@ -951,12 +938,11 @@ public void Serialize(ref MessagePackWriter writer, global::Abcdefg.Efcdigjl.Ate } } - var ____result = new global::Abcdefg.Efcdigjl.Ateatatea.Hgfagfafgad.TnonodsfarnoiuAtatqaga(); - ____result.MyProperty = __MyProperty__; reader.Depth--; return ____result; } } + } #pragma warning restore 168 @@ -965,7 +951,6 @@ public void Serialize(ref MessagePackWriter writer, global::Abcdefg.Efcdigjl.Ate #pragma warning restore 612 #pragma warning restore SA1129 // Do not use default value type constructor -#pragma warning restore SA1200 // Using directives should be placed correctly #pragma warning restore SA1309 // Field names should not begin with underscore #pragma warning restore SA1312 // Variable names should begin with lower-case letter #pragma warning restore SA1403 // File may only contain a single namespace @@ -979,9 +964,9 @@ public void Serialize(ref MessagePackWriter writer, global::Abcdefg.Efcdigjl.Ate #pragma warning disable 612 #pragma warning disable 414 #pragma warning disable 168 +#pragma warning disable CS1591 // document public APIs #pragma warning disable SA1129 // Do not use default value type constructor -#pragma warning disable SA1200 // Using directives should be placed correctly #pragma warning disable SA1309 // Field names should not begin with underscore #pragma warning disable SA1312 // Variable names should begin with lower-case letter #pragma warning disable SA1403 // File may only contain a single namespace @@ -989,14 +974,10 @@ public void Serialize(ref MessagePackWriter writer, global::Abcdefg.Efcdigjl.Ate namespace MessagePack.Formatters { - using System; - using System.Buffers; - using MessagePack; - public sealed class ArrayTestTestFormatter : global::MessagePack.Formatters.IMessagePackFormatter { - public void Serialize(ref MessagePackWriter writer, global::ArrayTestTest value, global::MessagePack.MessagePackSerializerOptions options) + public void Serialize(ref global::MessagePack.MessagePackWriter writer, global::ArrayTestTest value, global::MessagePack.MessagePackSerializerOptions options) { if (value == null) { @@ -1004,18 +985,18 @@ public void Serialize(ref MessagePackWriter writer, global::ArrayTestTest value, return; } - IFormatterResolver formatterResolver = options.Resolver; + global::MessagePack.IFormatterResolver formatterResolver = options.Resolver; writer.WriteArrayHeader(7); - formatterResolver.GetFormatterWithVerify().Serialize(ref writer, value.MyProperty0, options); - formatterResolver.GetFormatterWithVerify().Serialize(ref writer, value.MyProperty1, options); - formatterResolver.GetFormatterWithVerify().Serialize(ref writer, value.MyProperty2, options); - formatterResolver.GetFormatterWithVerify().Serialize(ref writer, value.MyProperty3, options); - formatterResolver.GetFormatterWithVerify().Serialize(ref writer, value.MyProperty4, options); - formatterResolver.GetFormatterWithVerify().Serialize(ref writer, value.MyProperty5, options); - formatterResolver.GetFormatterWithVerify().Serialize(ref writer, value.MyProperty6, options); + global::MessagePack.FormatterResolverExtensions.GetFormatterWithVerify(formatterResolver).Serialize(ref writer, value.MyProperty0, options); + global::MessagePack.FormatterResolverExtensions.GetFormatterWithVerify(formatterResolver).Serialize(ref writer, value.MyProperty1, options); + global::MessagePack.FormatterResolverExtensions.GetFormatterWithVerify(formatterResolver).Serialize(ref writer, value.MyProperty2, options); + global::MessagePack.FormatterResolverExtensions.GetFormatterWithVerify(formatterResolver).Serialize(ref writer, value.MyProperty3, options); + global::MessagePack.FormatterResolverExtensions.GetFormatterWithVerify(formatterResolver).Serialize(ref writer, value.MyProperty4, options); + global::MessagePack.FormatterResolverExtensions.GetFormatterWithVerify(formatterResolver).Serialize(ref writer, value.MyProperty5, options); + global::MessagePack.FormatterResolverExtensions.GetFormatterWithVerify(formatterResolver).Serialize(ref writer, value.MyProperty6, options); } - public global::ArrayTestTest Deserialize(ref MessagePackReader reader, global::MessagePack.MessagePackSerializerOptions options) + public global::ArrayTestTest Deserialize(ref global::MessagePack.MessagePackReader reader, global::MessagePack.MessagePackSerializerOptions options) { if (reader.TryReadNil()) { @@ -1023,40 +1004,34 @@ public void Serialize(ref MessagePackWriter writer, global::ArrayTestTest value, } options.Security.DepthStep(ref reader); - IFormatterResolver formatterResolver = options.Resolver; + global::MessagePack.IFormatterResolver formatterResolver = options.Resolver; var length = reader.ReadArrayHeader(); - var __MyProperty0__ = default(int[]); - var __MyProperty1__ = default(int[,]); - var __MyProperty2__ = default(global::GlobalMyEnum[,]); - var __MyProperty3__ = default(int[,,]); - var __MyProperty4__ = default(int[,,,]); - var __MyProperty5__ = default(global::GlobalMyEnum[]); - var __MyProperty6__ = default(global::QuestMessageBody[]); + var ____result = new global::ArrayTestTest(); for (int i = 0; i < length; i++) { switch (i) { case 0: - __MyProperty0__ = formatterResolver.GetFormatterWithVerify().Deserialize(ref reader, options); + ____result.MyProperty0 = global::MessagePack.FormatterResolverExtensions.GetFormatterWithVerify(formatterResolver).Deserialize(ref reader, options); break; case 1: - __MyProperty1__ = formatterResolver.GetFormatterWithVerify().Deserialize(ref reader, options); + ____result.MyProperty1 = global::MessagePack.FormatterResolverExtensions.GetFormatterWithVerify(formatterResolver).Deserialize(ref reader, options); break; case 2: - __MyProperty2__ = formatterResolver.GetFormatterWithVerify().Deserialize(ref reader, options); + ____result.MyProperty2 = global::MessagePack.FormatterResolverExtensions.GetFormatterWithVerify(formatterResolver).Deserialize(ref reader, options); break; case 3: - __MyProperty3__ = formatterResolver.GetFormatterWithVerify().Deserialize(ref reader, options); + ____result.MyProperty3 = global::MessagePack.FormatterResolverExtensions.GetFormatterWithVerify(formatterResolver).Deserialize(ref reader, options); break; case 4: - __MyProperty4__ = formatterResolver.GetFormatterWithVerify().Deserialize(ref reader, options); + ____result.MyProperty4 = global::MessagePack.FormatterResolverExtensions.GetFormatterWithVerify(formatterResolver).Deserialize(ref reader, options); break; case 5: - __MyProperty5__ = formatterResolver.GetFormatterWithVerify().Deserialize(ref reader, options); + ____result.MyProperty5 = global::MessagePack.FormatterResolverExtensions.GetFormatterWithVerify(formatterResolver).Deserialize(ref reader, options); break; case 6: - __MyProperty6__ = formatterResolver.GetFormatterWithVerify().Deserialize(ref reader, options); + ____result.MyProperty6 = global::MessagePack.FormatterResolverExtensions.GetFormatterWithVerify(formatterResolver).Deserialize(ref reader, options); break; default: reader.Skip(); @@ -1064,14 +1039,6 @@ public void Serialize(ref MessagePackWriter writer, global::ArrayTestTest value, } } - var ____result = new global::ArrayTestTest(); - ____result.MyProperty0 = __MyProperty0__; - ____result.MyProperty1 = __MyProperty1__; - ____result.MyProperty2 = __MyProperty2__; - ____result.MyProperty3 = __MyProperty3__; - ____result.MyProperty4 = __MyProperty4__; - ____result.MyProperty5 = __MyProperty5__; - ____result.MyProperty6 = __MyProperty6__; reader.Depth--; return ____result; } @@ -1080,7 +1047,7 @@ public void Serialize(ref MessagePackWriter writer, global::ArrayTestTest value, public sealed class GlobalManFormatter : global::MessagePack.Formatters.IMessagePackFormatter { - public void Serialize(ref MessagePackWriter writer, global::GlobalMan value, global::MessagePack.MessagePackSerializerOptions options) + public void Serialize(ref global::MessagePack.MessagePackWriter writer, global::GlobalMan value, global::MessagePack.MessagePackSerializerOptions options) { if (value == null) { @@ -1092,7 +1059,7 @@ public void Serialize(ref MessagePackWriter writer, global::GlobalMan value, glo writer.Write(value.MyProperty); } - public global::GlobalMan Deserialize(ref MessagePackReader reader, global::MessagePack.MessagePackSerializerOptions options) + public global::GlobalMan Deserialize(ref global::MessagePack.MessagePackReader reader, global::MessagePack.MessagePackSerializerOptions options) { if (reader.TryReadNil()) { @@ -1101,14 +1068,14 @@ public void Serialize(ref MessagePackWriter writer, global::GlobalMan value, glo options.Security.DepthStep(ref reader); var length = reader.ReadArrayHeader(); - var __MyProperty__ = default(int); + var ____result = new global::GlobalMan(); for (int i = 0; i < length; i++) { switch (i) { case 0: - __MyProperty__ = reader.ReadInt32(); + ____result.MyProperty = reader.ReadInt32(); break; default: reader.Skip(); @@ -1116,8 +1083,6 @@ public void Serialize(ref MessagePackWriter writer, global::GlobalMan value, glo } } - var ____result = new global::GlobalMan(); - ____result.MyProperty = __MyProperty__; reader.Depth--; return ____result; } @@ -1126,7 +1091,7 @@ public void Serialize(ref MessagePackWriter writer, global::GlobalMan value, glo public sealed class MessageFormatter : global::MessagePack.Formatters.IMessagePackFormatter { - public void Serialize(ref MessagePackWriter writer, global::Message value, global::MessagePack.MessagePackSerializerOptions options) + public void Serialize(ref global::MessagePack.MessagePackWriter writer, global::Message value, global::MessagePack.MessagePackSerializerOptions options) { if (value == null) { @@ -1134,15 +1099,15 @@ public void Serialize(ref MessagePackWriter writer, global::Message value, globa return; } - IFormatterResolver formatterResolver = options.Resolver; + global::MessagePack.IFormatterResolver formatterResolver = options.Resolver; writer.WriteArrayHeader(4); writer.Write(value.UserId); writer.Write(value.RoomId); - formatterResolver.GetFormatterWithVerify().Serialize(ref writer, value.PostTime, options); - formatterResolver.GetFormatterWithVerify().Serialize(ref writer, value.Body, options); + global::MessagePack.FormatterResolverExtensions.GetFormatterWithVerify(formatterResolver).Serialize(ref writer, value.PostTime, options); + global::MessagePack.FormatterResolverExtensions.GetFormatterWithVerify(formatterResolver).Serialize(ref writer, value.Body, options); } - public global::Message Deserialize(ref MessagePackReader reader, global::MessagePack.MessagePackSerializerOptions options) + public global::Message Deserialize(ref global::MessagePack.MessagePackReader reader, global::MessagePack.MessagePackSerializerOptions options) { if (reader.TryReadNil()) { @@ -1150,28 +1115,70 @@ public void Serialize(ref MessagePackWriter writer, global::Message value, globa } options.Security.DepthStep(ref reader); - IFormatterResolver formatterResolver = options.Resolver; + global::MessagePack.IFormatterResolver formatterResolver = options.Resolver; var length = reader.ReadArrayHeader(); - var __UserId__ = default(int); - var __RoomId__ = default(int); - var __PostTime__ = default(global::System.DateTime); - var __Body__ = default(global::IMessageBody); + var ____result = new global::Message(); for (int i = 0; i < length; i++) { switch (i) { case 0: - __UserId__ = reader.ReadInt32(); + ____result.UserId = reader.ReadInt32(); break; case 1: - __RoomId__ = reader.ReadInt32(); + ____result.RoomId = reader.ReadInt32(); break; case 2: - __PostTime__ = formatterResolver.GetFormatterWithVerify().Deserialize(ref reader, options); + ____result.PostTime = global::MessagePack.FormatterResolverExtensions.GetFormatterWithVerify(formatterResolver).Deserialize(ref reader, options); break; case 3: - __Body__ = formatterResolver.GetFormatterWithVerify().Deserialize(ref reader, options); + ____result.Body = global::MessagePack.FormatterResolverExtensions.GetFormatterWithVerify(formatterResolver).Deserialize(ref reader, options); + break; + default: + reader.Skip(); + break; + } + } + + reader.Depth--; + return ____result; + } + } + + public sealed class MessagePackFormatterFieldUserFormatter : global::MessagePack.Formatters.IMessagePackFormatter + { + private readonly global::MessagePack.Formatters.NativeDateTimeFormatter __TimestampCustomFormatter__ = new global::MessagePack.Formatters.NativeDateTimeFormatter(); + + public void Serialize(ref global::MessagePack.MessagePackWriter writer, global::MessagePackFormatterFieldUser value, global::MessagePack.MessagePackSerializerOptions options) + { + if (value == null) + { + writer.WriteNil(); + return; + } + + writer.WriteArrayHeader(1); + this.__TimestampCustomFormatter__.Serialize(ref writer, value.Timestamp, options); + } + + public global::MessagePackFormatterFieldUser Deserialize(ref global::MessagePack.MessagePackReader reader, global::MessagePack.MessagePackSerializerOptions options) + { + if (reader.TryReadNil()) + { + return null; + } + + options.Security.DepthStep(ref reader); + var length = reader.ReadArrayHeader(); + var ____result = new global::MessagePackFormatterFieldUser(); + + for (int i = 0; i < length; i++) + { + switch (i) + { + case 0: + ____result.Timestamp = this.__TimestampCustomFormatter__.Deserialize(ref reader, options); break; default: reader.Skip(); @@ -1179,11 +1186,6 @@ public void Serialize(ref MessagePackWriter writer, global::Message value, globa } } - var ____result = new global::Message(); - ____result.UserId = __UserId__; - ____result.RoomId = __RoomId__; - ____result.PostTime = __PostTime__; - ____result.Body = __Body__; reader.Depth--; return ____result; } @@ -1192,7 +1194,7 @@ public void Serialize(ref MessagePackWriter writer, global::Message value, globa public sealed class QuestMessageBodyFormatter : global::MessagePack.Formatters.IMessagePackFormatter { - public void Serialize(ref MessagePackWriter writer, global::QuestMessageBody value, global::MessagePack.MessagePackSerializerOptions options) + public void Serialize(ref global::MessagePack.MessagePackWriter writer, global::QuestMessageBody value, global::MessagePack.MessagePackSerializerOptions options) { if (value == null) { @@ -1200,13 +1202,13 @@ public void Serialize(ref MessagePackWriter writer, global::QuestMessageBody val return; } - IFormatterResolver formatterResolver = options.Resolver; + global::MessagePack.IFormatterResolver formatterResolver = options.Resolver; writer.WriteArrayHeader(2); writer.Write(value.QuestId); - formatterResolver.GetFormatterWithVerify().Serialize(ref writer, value.Text, options); + global::MessagePack.FormatterResolverExtensions.GetFormatterWithVerify(formatterResolver).Serialize(ref writer, value.Text, options); } - public global::QuestMessageBody Deserialize(ref MessagePackReader reader, global::MessagePack.MessagePackSerializerOptions options) + public global::QuestMessageBody Deserialize(ref global::MessagePack.MessagePackReader reader, global::MessagePack.MessagePackSerializerOptions options) { if (reader.TryReadNil()) { @@ -1214,20 +1216,19 @@ public void Serialize(ref MessagePackWriter writer, global::QuestMessageBody val } options.Security.DepthStep(ref reader); - IFormatterResolver formatterResolver = options.Resolver; + global::MessagePack.IFormatterResolver formatterResolver = options.Resolver; var length = reader.ReadArrayHeader(); - var __QuestId__ = default(int); - var __Text__ = default(string); + var ____result = new global::QuestMessageBody(); for (int i = 0; i < length; i++) { switch (i) { case 0: - __QuestId__ = reader.ReadInt32(); + ____result.QuestId = reader.ReadInt32(); break; case 1: - __Text__ = formatterResolver.GetFormatterWithVerify().Deserialize(ref reader, options); + ____result.Text = global::MessagePack.FormatterResolverExtensions.GetFormatterWithVerify(formatterResolver).Deserialize(ref reader, options); break; default: reader.Skip(); @@ -1235,9 +1236,6 @@ public void Serialize(ref MessagePackWriter writer, global::QuestMessageBody val } } - var ____result = new global::QuestMessageBody(); - ____result.QuestId = __QuestId__; - ____result.Text = __Text__; reader.Depth--; return ____result; } @@ -1246,7 +1244,7 @@ public void Serialize(ref MessagePackWriter writer, global::QuestMessageBody val public sealed class StampMessageBodyFormatter : global::MessagePack.Formatters.IMessagePackFormatter { - public void Serialize(ref MessagePackWriter writer, global::StampMessageBody value, global::MessagePack.MessagePackSerializerOptions options) + public void Serialize(ref global::MessagePack.MessagePackWriter writer, global::StampMessageBody value, global::MessagePack.MessagePackSerializerOptions options) { if (value == null) { @@ -1258,7 +1256,7 @@ public void Serialize(ref MessagePackWriter writer, global::StampMessageBody val writer.Write(value.StampId); } - public global::StampMessageBody Deserialize(ref MessagePackReader reader, global::MessagePack.MessagePackSerializerOptions options) + public global::StampMessageBody Deserialize(ref global::MessagePack.MessagePackReader reader, global::MessagePack.MessagePackSerializerOptions options) { if (reader.TryReadNil()) { @@ -1267,14 +1265,14 @@ public void Serialize(ref MessagePackWriter writer, global::StampMessageBody val options.Security.DepthStep(ref reader); var length = reader.ReadArrayHeader(); - var __StampId__ = default(int); + var ____result = new global::StampMessageBody(); for (int i = 0; i < length; i++) { switch (i) { case 0: - __StampId__ = reader.ReadInt32(); + ____result.StampId = reader.ReadInt32(); break; default: reader.Skip(); @@ -1282,8 +1280,6 @@ public void Serialize(ref MessagePackWriter writer, global::StampMessageBody val } } - var ____result = new global::StampMessageBody(); - ____result.StampId = __StampId__; reader.Depth--; return ____result; } @@ -1292,7 +1288,7 @@ public void Serialize(ref MessagePackWriter writer, global::StampMessageBody val public sealed class TextMessageBodyFormatter : global::MessagePack.Formatters.IMessagePackFormatter { - public void Serialize(ref MessagePackWriter writer, global::TextMessageBody value, global::MessagePack.MessagePackSerializerOptions options) + public void Serialize(ref global::MessagePack.MessagePackWriter writer, global::TextMessageBody value, global::MessagePack.MessagePackSerializerOptions options) { if (value == null) { @@ -1300,12 +1296,12 @@ public void Serialize(ref MessagePackWriter writer, global::TextMessageBody valu return; } - IFormatterResolver formatterResolver = options.Resolver; + global::MessagePack.IFormatterResolver formatterResolver = options.Resolver; writer.WriteArrayHeader(1); - formatterResolver.GetFormatterWithVerify().Serialize(ref writer, value.Text, options); + global::MessagePack.FormatterResolverExtensions.GetFormatterWithVerify(formatterResolver).Serialize(ref writer, value.Text, options); } - public global::TextMessageBody Deserialize(ref MessagePackReader reader, global::MessagePack.MessagePackSerializerOptions options) + public global::TextMessageBody Deserialize(ref global::MessagePack.MessagePackReader reader, global::MessagePack.MessagePackSerializerOptions options) { if (reader.TryReadNil()) { @@ -1313,16 +1309,16 @@ public void Serialize(ref MessagePackWriter writer, global::TextMessageBody valu } options.Security.DepthStep(ref reader); - IFormatterResolver formatterResolver = options.Resolver; + global::MessagePack.IFormatterResolver formatterResolver = options.Resolver; var length = reader.ReadArrayHeader(); - var __Text__ = default(string); + var ____result = new global::TextMessageBody(); for (int i = 0; i < length; i++) { switch (i) { case 0: - __Text__ = formatterResolver.GetFormatterWithVerify().Deserialize(ref reader, options); + ____result.Text = global::MessagePack.FormatterResolverExtensions.GetFormatterWithVerify(formatterResolver).Deserialize(ref reader, options); break; default: reader.Skip(); @@ -1330,12 +1326,11 @@ public void Serialize(ref MessagePackWriter writer, global::TextMessageBody valu } } - var ____result = new global::TextMessageBody(); - ____result.Text = __Text__; reader.Depth--; return ____result; } } + } #pragma warning restore 168 @@ -1344,7 +1339,6 @@ public void Serialize(ref MessagePackWriter writer, global::TextMessageBody valu #pragma warning restore 612 #pragma warning restore SA1129 // Do not use default value type constructor -#pragma warning restore SA1200 // Using directives should be placed correctly #pragma warning restore SA1309 // Field names should not begin with underscore #pragma warning restore SA1312 // Variable names should begin with lower-case letter #pragma warning restore SA1403 // File may only contain a single namespace @@ -1358,9 +1352,9 @@ public void Serialize(ref MessagePackWriter writer, global::TextMessageBody valu #pragma warning disable 612 #pragma warning disable 414 #pragma warning disable 168 +#pragma warning disable CS1591 // document public APIs #pragma warning disable SA1129 // Do not use default value type constructor -#pragma warning disable SA1200 // Using directives should be placed correctly #pragma warning disable SA1309 // Field names should not begin with underscore #pragma warning disable SA1312 // Variable names should begin with lower-case letter #pragma warning disable SA1403 // File may only contain a single namespace @@ -1368,11 +1362,6 @@ public void Serialize(ref MessagePackWriter writer, global::TextMessageBody valu namespace MessagePack.Formatters { - using System; - using System.Buffers; - using System.Runtime.InteropServices; - using MessagePack; - public sealed class ComplexModelFormatter : global::MessagePack.Formatters.IMessagePackFormatter { // AdditionalProperty @@ -1396,20 +1385,20 @@ public void Serialize(ref global::MessagePack.MessagePackWriter writer, global:: return; } - IFormatterResolver formatterResolver = options.Resolver; + var formatterResolver = options.Resolver; writer.WriteMapHeader(6); writer.WriteRaw(GetSpan_AdditionalProperty()); - formatterResolver.GetFormatterWithVerify>().Serialize(ref writer, value.AdditionalProperty, options); + global::MessagePack.FormatterResolverExtensions.GetFormatterWithVerify>(formatterResolver).Serialize(ref writer, value.AdditionalProperty, options); writer.WriteRaw(GetSpan_CreatedOn()); - formatterResolver.GetFormatterWithVerify().Serialize(ref writer, value.CreatedOn, options); + global::MessagePack.FormatterResolverExtensions.GetFormatterWithVerify(formatterResolver).Serialize(ref writer, value.CreatedOn, options); writer.WriteRaw(GetSpan_Id()); - formatterResolver.GetFormatterWithVerify().Serialize(ref writer, value.Id, options); + global::MessagePack.FormatterResolverExtensions.GetFormatterWithVerify(formatterResolver).Serialize(ref writer, value.Id, options); writer.WriteRaw(GetSpan_Name()); - formatterResolver.GetFormatterWithVerify().Serialize(ref writer, value.Name, options); + global::MessagePack.FormatterResolverExtensions.GetFormatterWithVerify(formatterResolver).Serialize(ref writer, value.Name, options); writer.WriteRaw(GetSpan_UpdatedOn()); - formatterResolver.GetFormatterWithVerify().Serialize(ref writer, value.UpdatedOn, options); + global::MessagePack.FormatterResolverExtensions.GetFormatterWithVerify(formatterResolver).Serialize(ref writer, value.UpdatedOn, options); writer.WriteRaw(GetSpan_SimpleModels()); - formatterResolver.GetFormatterWithVerify>().Serialize(ref writer, value.SimpleModels, options); + global::MessagePack.FormatterResolverExtensions.GetFormatterWithVerify>(formatterResolver).Serialize(ref writer, value.SimpleModels, options); } public global::ComplexModel Deserialize(ref global::MessagePack.MessagePackReader reader, global::MessagePack.MessagePackSerializerOptions options) @@ -1420,18 +1409,13 @@ public void Serialize(ref global::MessagePack.MessagePackWriter writer, global:: } options.Security.DepthStep(ref reader); - IFormatterResolver formatterResolver = options.Resolver; + var formatterResolver = options.Resolver; var length = reader.ReadMapHeader(); - var __AdditionalProperty__ = default(global::System.Collections.Generic.IDictionary); - var __CreatedOn__ = default(global::System.DateTimeOffset); - var __Id__ = default(global::System.Guid); - var __Name__ = default(string); - var __UpdatedOn__ = default(global::System.DateTimeOffset); - var __SimpleModels__ = default(global::System.Collections.Generic.IList); + var ____result = new global::ComplexModel(); for (int i = 0; i < length; i++) { - ReadOnlySpan stringKey = global::MessagePack.Internal.CodeGenHelpers.ReadStringSpan(ref reader); + var stringKey = global::MessagePack.Internal.CodeGenHelpers.ReadStringSpan(ref reader); switch (stringKey.Length) { default: @@ -1441,7 +1425,7 @@ public void Serialize(ref global::MessagePack.MessagePackWriter writer, global:: case 18: if (!global::System.MemoryExtensions.SequenceEqual(stringKey, GetSpan_AdditionalProperty().Slice(1))) { goto FAIL; } - __AdditionalProperty__ = formatterResolver.GetFormatterWithVerify>().Deserialize(ref reader, options); + reader.Skip(); continue; case 9: switch (global::MessagePack.Internal.AutomataKeyGen.GetKey(ref stringKey)) @@ -1450,43 +1434,35 @@ public void Serialize(ref global::MessagePack.MessagePackWriter writer, global:: case 5720808977192022595UL: if (stringKey[0] != 110) { goto FAIL; } - __CreatedOn__ = formatterResolver.GetFormatterWithVerify().Deserialize(ref reader, options); + ____result.CreatedOn = global::MessagePack.FormatterResolverExtensions.GetFormatterWithVerify(formatterResolver).Deserialize(ref reader, options); continue; case 5720808977191956565UL: if (stringKey[0] != 110) { goto FAIL; } - __UpdatedOn__ = formatterResolver.GetFormatterWithVerify().Deserialize(ref reader, options); + ____result.UpdatedOn = global::MessagePack.FormatterResolverExtensions.GetFormatterWithVerify(formatterResolver).Deserialize(ref reader, options); continue; } case 2: if (global::MessagePack.Internal.AutomataKeyGen.GetKey(ref stringKey) != 25673UL) { goto FAIL; } - __Id__ = formatterResolver.GetFormatterWithVerify().Deserialize(ref reader, options); + ____result.Id = global::MessagePack.FormatterResolverExtensions.GetFormatterWithVerify(formatterResolver).Deserialize(ref reader, options); continue; case 4: if (global::MessagePack.Internal.AutomataKeyGen.GetKey(ref stringKey) != 1701667150UL) { goto FAIL; } - __Name__ = formatterResolver.GetFormatterWithVerify().Deserialize(ref reader, options); + ____result.Name = global::MessagePack.FormatterResolverExtensions.GetFormatterWithVerify(formatterResolver).Deserialize(ref reader, options); continue; case 12: if (!global::System.MemoryExtensions.SequenceEqual(stringKey, GetSpan_SimpleModels().Slice(1))) { goto FAIL; } - __SimpleModels__ = formatterResolver.GetFormatterWithVerify>().Deserialize(ref reader, options); + reader.Skip(); continue; } } - var ____result = new global::ComplexModel() - { - CreatedOn = __CreatedOn__, - Id = __Id__, - Name = __Name__, - UpdatedOn = __UpdatedOn__, - }; - reader.Depth--; return ____result; } @@ -1515,18 +1491,18 @@ public void Serialize(ref global::MessagePack.MessagePackWriter writer, global:: return; } - IFormatterResolver formatterResolver = options.Resolver; + var formatterResolver = options.Resolver; writer.WriteMapHeader(6); writer.WriteRaw(GetSpan_Id()); writer.Write(value.Id); writer.WriteRaw(GetSpan_Name()); - formatterResolver.GetFormatterWithVerify().Serialize(ref writer, value.Name, options); + global::MessagePack.FormatterResolverExtensions.GetFormatterWithVerify(formatterResolver).Serialize(ref writer, value.Name, options); writer.WriteRaw(GetSpan_CreatedOn()); - formatterResolver.GetFormatterWithVerify().Serialize(ref writer, value.CreatedOn, options); + global::MessagePack.FormatterResolverExtensions.GetFormatterWithVerify(formatterResolver).Serialize(ref writer, value.CreatedOn, options); writer.WriteRaw(GetSpan_Precision()); writer.Write(value.Precision); writer.WriteRaw(GetSpan_Money()); - formatterResolver.GetFormatterWithVerify().Serialize(ref writer, value.Money, options); + global::MessagePack.FormatterResolverExtensions.GetFormatterWithVerify(formatterResolver).Serialize(ref writer, value.Money, options); writer.WriteRaw(GetSpan_Amount()); writer.Write(value.Amount); } @@ -1539,18 +1515,13 @@ public void Serialize(ref global::MessagePack.MessagePackWriter writer, global:: } options.Security.DepthStep(ref reader); - IFormatterResolver formatterResolver = options.Resolver; + var formatterResolver = options.Resolver; var length = reader.ReadMapHeader(); - var __Id__ = default(int); - var __Name__ = default(string); - var __CreatedOn__ = default(global::System.DateTime); - var __Precision__ = default(int); - var __Money__ = default(decimal); - var __Amount__ = default(long); + var ____result = new global::SimpleModel(); for (int i = 0; i < length; i++) { - ReadOnlySpan stringKey = global::MessagePack.Internal.CodeGenHelpers.ReadStringSpan(ref reader); + var stringKey = global::MessagePack.Internal.CodeGenHelpers.ReadStringSpan(ref reader); switch (stringKey.Length) { default: @@ -1560,12 +1531,12 @@ public void Serialize(ref global::MessagePack.MessagePackWriter writer, global:: case 2: if (global::MessagePack.Internal.AutomataKeyGen.GetKey(ref stringKey) != 25673UL) { goto FAIL; } - __Id__ = reader.ReadInt32(); + ____result.Id = reader.ReadInt32(); continue; case 4: if (global::MessagePack.Internal.AutomataKeyGen.GetKey(ref stringKey) != 1701667150UL) { goto FAIL; } - __Name__ = formatterResolver.GetFormatterWithVerify().Deserialize(ref reader, options); + ____result.Name = global::MessagePack.FormatterResolverExtensions.GetFormatterWithVerify(formatterResolver).Deserialize(ref reader, options); continue; case 9: switch (global::MessagePack.Internal.AutomataKeyGen.GetKey(ref stringKey)) @@ -1574,45 +1545,48 @@ public void Serialize(ref global::MessagePack.MessagePackWriter writer, global:: case 5720808977192022595UL: if (stringKey[0] != 110) { goto FAIL; } - __CreatedOn__ = formatterResolver.GetFormatterWithVerify().Deserialize(ref reader, options); + ____result.CreatedOn = global::MessagePack.FormatterResolverExtensions.GetFormatterWithVerify(formatterResolver).Deserialize(ref reader, options); continue; case 8028074707240972880UL: if (stringKey[0] != 110) { goto FAIL; } - __Precision__ = reader.ReadInt32(); + ____result.Precision = reader.ReadInt32(); continue; } case 5: if (global::MessagePack.Internal.AutomataKeyGen.GetKey(ref stringKey) != 521392779085UL) { goto FAIL; } - __Money__ = formatterResolver.GetFormatterWithVerify().Deserialize(ref reader, options); + ____result.Money = global::MessagePack.FormatterResolverExtensions.GetFormatterWithVerify(formatterResolver).Deserialize(ref reader, options); continue; case 6: if (global::MessagePack.Internal.AutomataKeyGen.GetKey(ref stringKey) != 128017765461313UL) { goto FAIL; } - __Amount__ = reader.ReadInt64(); + reader.Skip(); continue; } } - var ____result = new global::SimpleModel() - { - Id = __Id__, - Name = __Name__, - CreatedOn = __CreatedOn__, - Precision = __Precision__, - Money = __Money__, - }; - reader.Depth--; return ____result; } } + } +#pragma warning restore 168 +#pragma warning restore 414 +#pragma warning restore 618 +#pragma warning restore 612 + +#pragma warning restore SA1129 // Do not use default value type constructor +#pragma warning restore SA1309 // Field names should not begin with underscore +#pragma warning restore SA1312 // Variable names should begin with lower-case letter +#pragma warning restore SA1403 // File may only contain a single namespace +#pragma warning restore SA1649 // File name should match first type name + // // THIS (.cs) FILE IS GENERATED BY MPC(MessagePack-CSharp). DO NOT CHANGE IT. // @@ -1621,9 +1595,9 @@ public void Serialize(ref global::MessagePack.MessagePackWriter writer, global:: #pragma warning disable 612 #pragma warning disable 414 #pragma warning disable 168 +#pragma warning disable CS1591 // document public APIs #pragma warning disable SA1129 // Do not use default value type constructor -#pragma warning disable SA1200 // Using directives should be placed correctly #pragma warning disable SA1309 // Field names should not begin with underscore #pragma warning disable SA1312 // Variable names should begin with lower-case letter #pragma warning disable SA1403 // File may only contain a single namespace @@ -1631,11 +1605,6 @@ public void Serialize(ref global::MessagePack.MessagePackWriter writer, global:: namespace MessagePack.Formatters.PerfBenchmarkDotNet { - using System; - using System.Buffers; - using System.Runtime.InteropServices; - using MessagePack; - public sealed class StringKeySerializerTargetFormatter : global::MessagePack.Formatters.IMessagePackFormatter { // MyProperty1 @@ -1695,19 +1664,11 @@ public void Serialize(ref global::MessagePack.MessagePackWriter writer, global:: options.Security.DepthStep(ref reader); var length = reader.ReadMapHeader(); - var __MyProperty1__ = default(int); - var __MyProperty2__ = default(int); - var __MyProperty3__ = default(int); - var __MyProperty4__ = default(int); - var __MyProperty5__ = default(int); - var __MyProperty6__ = default(int); - var __MyProperty7__ = default(int); - var __MyProperty8__ = default(int); - var __MyProperty9__ = default(int); + var ____result = new global::PerfBenchmarkDotNet.StringKeySerializerTarget(); for (int i = 0; i < length; i++) { - ReadOnlySpan stringKey = global::MessagePack.Internal.CodeGenHelpers.ReadStringSpan(ref reader); + var stringKey = global::MessagePack.Internal.CodeGenHelpers.ReadStringSpan(ref reader); switch (stringKey.Length) { default: @@ -1723,31 +1684,31 @@ public void Serialize(ref global::MessagePack.MessagePackWriter writer, global:: { default: goto FAIL; case 3242356UL: - __MyProperty1__ = reader.ReadInt32(); + ____result.MyProperty1 = reader.ReadInt32(); continue; case 3307892UL: - __MyProperty2__ = reader.ReadInt32(); + ____result.MyProperty2 = reader.ReadInt32(); continue; case 3373428UL: - __MyProperty3__ = reader.ReadInt32(); + ____result.MyProperty3 = reader.ReadInt32(); continue; case 3438964UL: - __MyProperty4__ = reader.ReadInt32(); + ____result.MyProperty4 = reader.ReadInt32(); continue; case 3504500UL: - __MyProperty5__ = reader.ReadInt32(); + ____result.MyProperty5 = reader.ReadInt32(); continue; case 3570036UL: - __MyProperty6__ = reader.ReadInt32(); + ____result.MyProperty6 = reader.ReadInt32(); continue; case 3635572UL: - __MyProperty7__ = reader.ReadInt32(); + ____result.MyProperty7 = reader.ReadInt32(); continue; case 3701108UL: - __MyProperty8__ = reader.ReadInt32(); + ____result.MyProperty8 = reader.ReadInt32(); continue; case 3766644UL: - __MyProperty9__ = reader.ReadInt32(); + ____result.MyProperty9 = reader.ReadInt32(); continue; } @@ -1756,25 +1717,24 @@ public void Serialize(ref global::MessagePack.MessagePackWriter writer, global:: } } - var ____result = new global::PerfBenchmarkDotNet.StringKeySerializerTarget() - { - MyProperty1 = __MyProperty1__, - MyProperty2 = __MyProperty2__, - MyProperty3 = __MyProperty3__, - MyProperty4 = __MyProperty4__, - MyProperty5 = __MyProperty5__, - MyProperty6 = __MyProperty6__, - MyProperty7 = __MyProperty7__, - MyProperty8 = __MyProperty8__, - MyProperty9 = __MyProperty9__, - }; - reader.Depth--; return ____result; } } + } +#pragma warning restore 168 +#pragma warning restore 414 +#pragma warning restore 618 +#pragma warning restore 612 + +#pragma warning restore SA1129 // Do not use default value type constructor +#pragma warning restore SA1309 // Field names should not begin with underscore +#pragma warning restore SA1312 // Variable names should begin with lower-case letter +#pragma warning restore SA1403 // File may only contain a single namespace +#pragma warning restore SA1649 // File name should match first type name + // // THIS (.cs) FILE IS GENERATED BY MPC(MessagePack-CSharp). DO NOT CHANGE IT. // @@ -1783,9 +1743,9 @@ public void Serialize(ref global::MessagePack.MessagePackWriter writer, global:: #pragma warning disable 612 #pragma warning disable 414 #pragma warning disable 168 +#pragma warning disable CS1591 // document public APIs #pragma warning disable SA1129 // Do not use default value type constructor -#pragma warning disable SA1200 // Using directives should be placed correctly #pragma warning disable SA1309 // Field names should not begin with underscore #pragma warning disable SA1312 // Variable names should begin with lower-case letter #pragma warning disable SA1403 // File may only contain a single namespace @@ -1793,14 +1753,10 @@ public void Serialize(ref global::MessagePack.MessagePackWriter writer, global:: namespace MessagePack.Formatters.SharedData { - using System; - using System.Buffers; - using MessagePack; - public sealed class ArrayOptimizeClassFormatter : global::MessagePack.Formatters.IMessagePackFormatter { - public void Serialize(ref MessagePackWriter writer, global::SharedData.ArrayOptimizeClass value, global::MessagePack.MessagePackSerializerOptions options) + public void Serialize(ref global::MessagePack.MessagePackWriter writer, global::SharedData.ArrayOptimizeClass value, global::MessagePack.MessagePackSerializerOptions options) { if (value == null) { @@ -1827,7 +1783,7 @@ public void Serialize(ref MessagePackWriter writer, global::SharedData.ArrayOpti writer.Write(value.MyProperty15); } - public global::SharedData.ArrayOptimizeClass Deserialize(ref MessagePackReader reader, global::MessagePack.MessagePackSerializerOptions options) + public global::SharedData.ArrayOptimizeClass Deserialize(ref global::MessagePack.MessagePackReader reader, global::MessagePack.MessagePackSerializerOptions options) { if (reader.TryReadNil()) { @@ -1836,74 +1792,59 @@ public void Serialize(ref MessagePackWriter writer, global::SharedData.ArrayOpti options.Security.DepthStep(ref reader); var length = reader.ReadArrayHeader(); - var __MyProperty0__ = default(int); - var __MyProperty1__ = default(int); - var __MyProperty2__ = default(int); - var __MyProperty3__ = default(int); - var __MyProperty4__ = default(int); - var __MyProperty5__ = default(int); - var __MyProperty6__ = default(int); - var __MyProperty7__ = default(int); - var __MyProperty8__ = default(int); - var __MyProvperty9__ = default(int); - var __MyProperty10__ = default(int); - var __MyProperty11__ = default(int); - var __MyPropverty12__ = default(int); - var __MyPropevrty13__ = default(int); - var __MyProperty14__ = default(int); - var __MyProperty15__ = default(int); + var ____result = new global::SharedData.ArrayOptimizeClass(); for (int i = 0; i < length; i++) { switch (i) { case 0: - __MyProperty0__ = reader.ReadInt32(); + ____result.MyProperty0 = reader.ReadInt32(); break; case 1: - __MyProperty1__ = reader.ReadInt32(); + ____result.MyProperty1 = reader.ReadInt32(); break; case 2: - __MyProperty2__ = reader.ReadInt32(); + ____result.MyProperty2 = reader.ReadInt32(); break; case 3: - __MyProperty3__ = reader.ReadInt32(); + ____result.MyProperty3 = reader.ReadInt32(); break; case 4: - __MyProperty4__ = reader.ReadInt32(); + ____result.MyProperty4 = reader.ReadInt32(); break; case 5: - __MyProperty5__ = reader.ReadInt32(); + ____result.MyProperty5 = reader.ReadInt32(); break; case 6: - __MyProperty6__ = reader.ReadInt32(); + ____result.MyProperty6 = reader.ReadInt32(); break; case 7: - __MyProperty7__ = reader.ReadInt32(); + ____result.MyProperty7 = reader.ReadInt32(); break; case 8: - __MyProperty8__ = reader.ReadInt32(); + ____result.MyProperty8 = reader.ReadInt32(); break; case 9: - __MyProvperty9__ = reader.ReadInt32(); + ____result.MyProvperty9 = reader.ReadInt32(); break; case 10: - __MyProperty10__ = reader.ReadInt32(); + ____result.MyProperty10 = reader.ReadInt32(); break; case 11: - __MyProperty11__ = reader.ReadInt32(); + ____result.MyProperty11 = reader.ReadInt32(); break; case 12: - __MyPropverty12__ = reader.ReadInt32(); + ____result.MyPropverty12 = reader.ReadInt32(); break; case 13: - __MyPropevrty13__ = reader.ReadInt32(); + ____result.MyPropevrty13 = reader.ReadInt32(); break; case 14: - __MyProperty14__ = reader.ReadInt32(); + ____result.MyProperty14 = reader.ReadInt32(); break; case 15: - __MyProperty15__ = reader.ReadInt32(); + ____result.MyProperty15 = reader.ReadInt32(); break; default: reader.Skip(); @@ -1911,23 +1852,6 @@ public void Serialize(ref MessagePackWriter writer, global::SharedData.ArrayOpti } } - var ____result = new global::SharedData.ArrayOptimizeClass(); - ____result.MyProperty0 = __MyProperty0__; - ____result.MyProperty1 = __MyProperty1__; - ____result.MyProperty2 = __MyProperty2__; - ____result.MyProperty3 = __MyProperty3__; - ____result.MyProperty4 = __MyProperty4__; - ____result.MyProperty5 = __MyProperty5__; - ____result.MyProperty6 = __MyProperty6__; - ____result.MyProperty7 = __MyProperty7__; - ____result.MyProperty8 = __MyProperty8__; - ____result.MyProvperty9 = __MyProvperty9__; - ____result.MyProperty10 = __MyProperty10__; - ____result.MyProperty11 = __MyProperty11__; - ____result.MyPropverty12 = __MyPropverty12__; - ____result.MyPropevrty13 = __MyPropevrty13__; - ____result.MyProperty14 = __MyProperty14__; - ____result.MyProperty15 = __MyProperty15__; reader.Depth--; return ____result; } @@ -1936,7 +1860,7 @@ public void Serialize(ref MessagePackWriter writer, global::SharedData.ArrayOpti public sealed class BarClassFormatter : global::MessagePack.Formatters.IMessagePackFormatter { - public void Serialize(ref MessagePackWriter writer, global::SharedData.BarClass value, global::MessagePack.MessagePackSerializerOptions options) + public void Serialize(ref global::MessagePack.MessagePackWriter writer, global::SharedData.BarClass value, global::MessagePack.MessagePackSerializerOptions options) { if (value == null) { @@ -1944,12 +1868,12 @@ public void Serialize(ref MessagePackWriter writer, global::SharedData.BarClass return; } - IFormatterResolver formatterResolver = options.Resolver; + global::MessagePack.IFormatterResolver formatterResolver = options.Resolver; writer.WriteArrayHeader(1); - formatterResolver.GetFormatterWithVerify().Serialize(ref writer, value.OPQ, options); + global::MessagePack.FormatterResolverExtensions.GetFormatterWithVerify(formatterResolver).Serialize(ref writer, value.OPQ, options); } - public global::SharedData.BarClass Deserialize(ref MessagePackReader reader, global::MessagePack.MessagePackSerializerOptions options) + public global::SharedData.BarClass Deserialize(ref global::MessagePack.MessagePackReader reader, global::MessagePack.MessagePackSerializerOptions options) { if (reader.TryReadNil()) { @@ -1957,16 +1881,16 @@ public void Serialize(ref MessagePackWriter writer, global::SharedData.BarClass } options.Security.DepthStep(ref reader); - IFormatterResolver formatterResolver = options.Resolver; + global::MessagePack.IFormatterResolver formatterResolver = options.Resolver; var length = reader.ReadArrayHeader(); - var __OPQ__ = default(string); + var ____result = new global::SharedData.BarClass(); for (int i = 0; i < length; i++) { switch (i) { case 0: - __OPQ__ = formatterResolver.GetFormatterWithVerify().Deserialize(ref reader, options); + ____result.OPQ = global::MessagePack.FormatterResolverExtensions.GetFormatterWithVerify(formatterResolver).Deserialize(ref reader, options); break; default: reader.Skip(); @@ -1974,8 +1898,6 @@ public void Serialize(ref MessagePackWriter writer, global::SharedData.BarClass } } - var ____result = new global::SharedData.BarClass(); - ____result.OPQ = __OPQ__; reader.Depth--; return ____result; } @@ -1984,7 +1906,7 @@ public void Serialize(ref MessagePackWriter writer, global::SharedData.BarClass public sealed class Callback1Formatter : global::MessagePack.Formatters.IMessagePackFormatter { - public void Serialize(ref MessagePackWriter writer, global::SharedData.Callback1 value, global::MessagePack.MessagePackSerializerOptions options) + public void Serialize(ref global::MessagePack.MessagePackWriter writer, global::SharedData.Callback1 value, global::MessagePack.MessagePackSerializerOptions options) { if (value == null) { @@ -1997,7 +1919,7 @@ public void Serialize(ref MessagePackWriter writer, global::SharedData.Callback1 writer.Write(value.X); } - public global::SharedData.Callback1 Deserialize(ref MessagePackReader reader, global::MessagePack.MessagePackSerializerOptions options) + public global::SharedData.Callback1 Deserialize(ref global::MessagePack.MessagePackReader reader, global::MessagePack.MessagePackSerializerOptions options) { if (reader.TryReadNil()) { @@ -2022,7 +1944,6 @@ public void Serialize(ref MessagePackWriter writer, global::SharedData.Callback1 } var ____result = new global::SharedData.Callback1(__X__); - ____result.X = __X__; ____result.OnAfterDeserialize(); reader.Depth--; return ____result; @@ -2032,7 +1953,7 @@ public void Serialize(ref MessagePackWriter writer, global::SharedData.Callback1 public sealed class Callback1_2Formatter : global::MessagePack.Formatters.IMessagePackFormatter { - public void Serialize(ref MessagePackWriter writer, global::SharedData.Callback1_2 value, global::MessagePack.MessagePackSerializerOptions options) + public void Serialize(ref global::MessagePack.MessagePackWriter writer, global::SharedData.Callback1_2 value, global::MessagePack.MessagePackSerializerOptions options) { if (value == null) { @@ -2040,12 +1961,12 @@ public void Serialize(ref MessagePackWriter writer, global::SharedData.Callback1 return; } - ((IMessagePackSerializationCallbackReceiver)value).OnBeforeSerialize(); + ((global::MessagePack.IMessagePackSerializationCallbackReceiver)value).OnBeforeSerialize(); writer.WriteArrayHeader(1); writer.Write(value.X); } - public global::SharedData.Callback1_2 Deserialize(ref MessagePackReader reader, global::MessagePack.MessagePackSerializerOptions options) + public global::SharedData.Callback1_2 Deserialize(ref global::MessagePack.MessagePackReader reader, global::MessagePack.MessagePackSerializerOptions options) { if (reader.TryReadNil()) { @@ -2070,81 +1991,61 @@ public void Serialize(ref MessagePackWriter writer, global::SharedData.Callback1 } var ____result = new global::SharedData.Callback1_2(__X__); - ____result.X = __X__; - ((IMessagePackSerializationCallbackReceiver)____result).OnAfterDeserialize(); + ((global::MessagePack.IMessagePackSerializationCallbackReceiver)____result).OnAfterDeserialize(); reader.Depth--; return ____result; } } - public sealed class DynamicArgumentTupleFormatter : global::MessagePack.Formatters.IMessagePackFormatter> + public sealed class DefaultValueIntKeyClassWithExplicitConstructorFormatter : global::MessagePack.Formatters.IMessagePackFormatter { - public void Serialize(ref MessagePackWriter writer, global::SharedData.DynamicArgumentTuple value, global::MessagePack.MessagePackSerializerOptions options) + public void Serialize(ref global::MessagePack.MessagePackWriter writer, global::SharedData.DefaultValueIntKeyClassWithExplicitConstructor value, global::MessagePack.MessagePackSerializerOptions options) { - IFormatterResolver formatterResolver = options.Resolver; - writer.WriteArrayHeader(9); - formatterResolver.GetFormatterWithVerify().Serialize(ref writer, value.Item1, options); - formatterResolver.GetFormatterWithVerify().Serialize(ref writer, value.Item2, options); - formatterResolver.GetFormatterWithVerify().Serialize(ref writer, value.Item3, options); - formatterResolver.GetFormatterWithVerify().Serialize(ref writer, value.Item4, options); - formatterResolver.GetFormatterWithVerify().Serialize(ref writer, value.Item5, options); - formatterResolver.GetFormatterWithVerify().Serialize(ref writer, value.Item6, options); - formatterResolver.GetFormatterWithVerify().Serialize(ref writer, value.Item7, options); - formatterResolver.GetFormatterWithVerify().Serialize(ref writer, value.Item8, options); - formatterResolver.GetFormatterWithVerify().Serialize(ref writer, value.Item9, options); + if (value == null) + { + writer.WriteNil(); + return; + } + + global::MessagePack.IFormatterResolver formatterResolver = options.Resolver; + writer.WriteArrayHeader(4); + writer.Write(value.Prop1); + writer.Write(value.Prop2); + global::MessagePack.FormatterResolverExtensions.GetFormatterWithVerify(formatterResolver).Serialize(ref writer, value.Prop3, options); + global::MessagePack.FormatterResolverExtensions.GetFormatterWithVerify(formatterResolver).Serialize(ref writer, value.Prop4, options); } - public global::SharedData.DynamicArgumentTuple Deserialize(ref MessagePackReader reader, global::MessagePack.MessagePackSerializerOptions options) + public global::SharedData.DefaultValueIntKeyClassWithExplicitConstructor Deserialize(ref global::MessagePack.MessagePackReader reader, global::MessagePack.MessagePackSerializerOptions options) { if (reader.TryReadNil()) { - throw new InvalidOperationException("typecode is null, struct not supported"); + return null; } options.Security.DepthStep(ref reader); - IFormatterResolver formatterResolver = options.Resolver; + global::MessagePack.IFormatterResolver formatterResolver = options.Resolver; var length = reader.ReadArrayHeader(); - var __Item1__ = default(T1); - var __Item2__ = default(T2); - var __Item3__ = default(T3); - var __Item4__ = default(T4); - var __Item5__ = default(T5); - var __Item6__ = default(T6); - var __Item7__ = default(T7); - var __Item8__ = default(T8); - var __Item9__ = default(T9); + var __Prop1__ = default(int); + var __Prop2__ = default(int); + var __Prop3__ = default(string); + var __Prop4__ = default(string); for (int i = 0; i < length; i++) { switch (i) { case 0: - __Item1__ = formatterResolver.GetFormatterWithVerify().Deserialize(ref reader, options); + __Prop1__ = reader.ReadInt32(); break; case 1: - __Item2__ = formatterResolver.GetFormatterWithVerify().Deserialize(ref reader, options); + __Prop2__ = reader.ReadInt32(); break; case 2: - __Item3__ = formatterResolver.GetFormatterWithVerify().Deserialize(ref reader, options); + __Prop3__ = global::MessagePack.FormatterResolverExtensions.GetFormatterWithVerify(formatterResolver).Deserialize(ref reader, options); break; case 3: - __Item4__ = formatterResolver.GetFormatterWithVerify().Deserialize(ref reader, options); - break; - case 4: - __Item5__ = formatterResolver.GetFormatterWithVerify().Deserialize(ref reader, options); - break; - case 5: - __Item6__ = formatterResolver.GetFormatterWithVerify().Deserialize(ref reader, options); - break; - case 6: - __Item7__ = formatterResolver.GetFormatterWithVerify().Deserialize(ref reader, options); - break; - case 7: - __Item8__ = formatterResolver.GetFormatterWithVerify().Deserialize(ref reader, options); - break; - case 8: - __Item9__ = formatterResolver.GetFormatterWithVerify().Deserialize(ref reader, options); + __Prop4__ = global::MessagePack.FormatterResolverExtensions.GetFormatterWithVerify(formatterResolver).Deserialize(ref reader, options); break; default: reader.Skip(); @@ -2152,16 +2053,36 @@ public void Serialize(ref MessagePackWriter writer, global::SharedData.DynamicAr } } - var ____result = new global::SharedData.DynamicArgumentTuple(__Item1__, __Item2__, __Item3__, __Item4__, __Item5__, __Item6__, __Item7__, __Item8__, __Item9__); + var ____result = new global::SharedData.DefaultValueIntKeyClassWithExplicitConstructor(__Prop1__); + if (length <= 1) + { + goto MEMBER_ASSIGNMENT_END; + } + + ____result.Prop2 = __Prop2__; + if (length <= 2) + { + goto MEMBER_ASSIGNMENT_END; + } + + ____result.Prop3 = __Prop3__; + if (length <= 3) + { + goto MEMBER_ASSIGNMENT_END; + } + + ____result.Prop4 = __Prop4__; + + MEMBER_ASSIGNMENT_END: reader.Depth--; return ____result; } } - public sealed class Empty1Formatter : global::MessagePack.Formatters.IMessagePackFormatter + public sealed class DefaultValueIntKeyClassWithoutExplicitConstructorFormatter : global::MessagePack.Formatters.IMessagePackFormatter { - public void Serialize(ref MessagePackWriter writer, global::SharedData.Empty1 value, global::MessagePack.MessagePackSerializerOptions options) + public void Serialize(ref global::MessagePack.MessagePackWriter writer, global::SharedData.DefaultValueIntKeyClassWithoutExplicitConstructor value, global::MessagePack.MessagePackSerializerOptions options) { if (value == null) { @@ -2169,10 +2090,12 @@ public void Serialize(ref MessagePackWriter writer, global::SharedData.Empty1 va return; } - writer.WriteArrayHeader(0); + writer.WriteArrayHeader(2); + writer.Write(value.Prop1); + writer.Write(value.Prop2); } - public global::SharedData.Empty1 Deserialize(ref MessagePackReader reader, global::MessagePack.MessagePackSerializerOptions options) + public global::SharedData.DefaultValueIntKeyClassWithoutExplicitConstructor Deserialize(ref global::MessagePack.MessagePackReader reader, global::MessagePack.MessagePackSerializerOptions options) { if (reader.TryReadNil()) { @@ -2181,101 +2104,166 @@ public void Serialize(ref MessagePackWriter writer, global::SharedData.Empty1 va options.Security.DepthStep(ref reader); var length = reader.ReadArrayHeader(); + var ____result = new global::SharedData.DefaultValueIntKeyClassWithoutExplicitConstructor(); for (int i = 0; i < length; i++) { switch (i) { + case 0: + ____result.Prop1 = reader.ReadInt32(); + break; + case 1: + ____result.Prop2 = reader.ReadInt32(); + break; default: reader.Skip(); break; } } - var ____result = new global::SharedData.Empty1(); reader.Depth--; return ____result; } } - public sealed class EmptyClassFormatter : global::MessagePack.Formatters.IMessagePackFormatter + public sealed class DefaultValueIntKeyStructWithExplicitConstructorFormatter : global::MessagePack.Formatters.IMessagePackFormatter { - public void Serialize(ref MessagePackWriter writer, global::SharedData.EmptyClass value, global::MessagePack.MessagePackSerializerOptions options) + public void Serialize(ref global::MessagePack.MessagePackWriter writer, global::SharedData.DefaultValueIntKeyStructWithExplicitConstructor value, global::MessagePack.MessagePackSerializerOptions options) { - if (value == null) - { - writer.WriteNil(); - return; - } - - writer.WriteArrayHeader(0); + writer.WriteArrayHeader(2); + writer.Write(value.Prop1); + writer.Write(value.Prop2); } - public global::SharedData.EmptyClass Deserialize(ref MessagePackReader reader, global::MessagePack.MessagePackSerializerOptions options) + public global::SharedData.DefaultValueIntKeyStructWithExplicitConstructor Deserialize(ref global::MessagePack.MessagePackReader reader, global::MessagePack.MessagePackSerializerOptions options) { if (reader.TryReadNil()) { - return null; + throw new global::System.InvalidOperationException("typecode is null, struct not supported"); } options.Security.DepthStep(ref reader); var length = reader.ReadArrayHeader(); + var __Prop1__ = default(int); + var __Prop2__ = default(int); for (int i = 0; i < length; i++) { switch (i) { + case 0: + __Prop1__ = reader.ReadInt32(); + break; + case 1: + __Prop2__ = reader.ReadInt32(); + break; default: reader.Skip(); break; } } - var ____result = new global::SharedData.EmptyClass(); + var ____result = new global::SharedData.DefaultValueIntKeyStructWithExplicitConstructor(__Prop1__); + if (length <= 1) + { + goto MEMBER_ASSIGNMENT_END; + } + + ____result.Prop2 = __Prop2__; + + MEMBER_ASSIGNMENT_END: reader.Depth--; return ____result; } } - public sealed class EmptyStructFormatter : global::MessagePack.Formatters.IMessagePackFormatter + public sealed class DynamicArgumentTupleFormatter : global::MessagePack.Formatters.IMessagePackFormatter> { - public void Serialize(ref MessagePackWriter writer, global::SharedData.EmptyStruct value, global::MessagePack.MessagePackSerializerOptions options) + public void Serialize(ref global::MessagePack.MessagePackWriter writer, global::SharedData.DynamicArgumentTuple value, global::MessagePack.MessagePackSerializerOptions options) { - writer.WriteArrayHeader(0); + global::MessagePack.IFormatterResolver formatterResolver = options.Resolver; + writer.WriteArrayHeader(9); + global::MessagePack.FormatterResolverExtensions.GetFormatterWithVerify(formatterResolver).Serialize(ref writer, value.Item1, options); + global::MessagePack.FormatterResolverExtensions.GetFormatterWithVerify(formatterResolver).Serialize(ref writer, value.Item2, options); + global::MessagePack.FormatterResolverExtensions.GetFormatterWithVerify(formatterResolver).Serialize(ref writer, value.Item3, options); + global::MessagePack.FormatterResolverExtensions.GetFormatterWithVerify(formatterResolver).Serialize(ref writer, value.Item4, options); + global::MessagePack.FormatterResolverExtensions.GetFormatterWithVerify(formatterResolver).Serialize(ref writer, value.Item5, options); + global::MessagePack.FormatterResolverExtensions.GetFormatterWithVerify(formatterResolver).Serialize(ref writer, value.Item6, options); + global::MessagePack.FormatterResolverExtensions.GetFormatterWithVerify(formatterResolver).Serialize(ref writer, value.Item7, options); + global::MessagePack.FormatterResolverExtensions.GetFormatterWithVerify(formatterResolver).Serialize(ref writer, value.Item8, options); + global::MessagePack.FormatterResolverExtensions.GetFormatterWithVerify(formatterResolver).Serialize(ref writer, value.Item9, options); } - public global::SharedData.EmptyStruct Deserialize(ref MessagePackReader reader, global::MessagePack.MessagePackSerializerOptions options) + public global::SharedData.DynamicArgumentTuple Deserialize(ref global::MessagePack.MessagePackReader reader, global::MessagePack.MessagePackSerializerOptions options) { if (reader.TryReadNil()) { - throw new InvalidOperationException("typecode is null, struct not supported"); + throw new global::System.InvalidOperationException("typecode is null, struct not supported"); } options.Security.DepthStep(ref reader); + global::MessagePack.IFormatterResolver formatterResolver = options.Resolver; var length = reader.ReadArrayHeader(); + var __Item1__ = default(T1); + var __Item2__ = default(T2); + var __Item3__ = default(T3); + var __Item4__ = default(T4); + var __Item5__ = default(T5); + var __Item6__ = default(T6); + var __Item7__ = default(T7); + var __Item8__ = default(T8); + var __Item9__ = default(T9); for (int i = 0; i < length; i++) { switch (i) { + case 0: + __Item1__ = global::MessagePack.FormatterResolverExtensions.GetFormatterWithVerify(formatterResolver).Deserialize(ref reader, options); + break; + case 1: + __Item2__ = global::MessagePack.FormatterResolverExtensions.GetFormatterWithVerify(formatterResolver).Deserialize(ref reader, options); + break; + case 2: + __Item3__ = global::MessagePack.FormatterResolverExtensions.GetFormatterWithVerify(formatterResolver).Deserialize(ref reader, options); + break; + case 3: + __Item4__ = global::MessagePack.FormatterResolverExtensions.GetFormatterWithVerify(formatterResolver).Deserialize(ref reader, options); + break; + case 4: + __Item5__ = global::MessagePack.FormatterResolverExtensions.GetFormatterWithVerify(formatterResolver).Deserialize(ref reader, options); + break; + case 5: + __Item6__ = global::MessagePack.FormatterResolverExtensions.GetFormatterWithVerify(formatterResolver).Deserialize(ref reader, options); + break; + case 6: + __Item7__ = global::MessagePack.FormatterResolverExtensions.GetFormatterWithVerify(formatterResolver).Deserialize(ref reader, options); + break; + case 7: + __Item8__ = global::MessagePack.FormatterResolverExtensions.GetFormatterWithVerify(formatterResolver).Deserialize(ref reader, options); + break; + case 8: + __Item9__ = global::MessagePack.FormatterResolverExtensions.GetFormatterWithVerify(formatterResolver).Deserialize(ref reader, options); + break; default: reader.Skip(); break; } } - var ____result = new global::SharedData.EmptyStruct(); + var ____result = new global::SharedData.DynamicArgumentTuple(__Item1__, __Item2__, __Item3__, __Item4__, __Item5__, __Item6__, __Item7__, __Item8__, __Item9__); reader.Depth--; return ____result; } } - public sealed class FirstSimpleDataFormatter : global::MessagePack.Formatters.IMessagePackFormatter + public sealed class Empty1Formatter : global::MessagePack.Formatters.IMessagePackFormatter { - public void Serialize(ref MessagePackWriter writer, global::SharedData.FirstSimpleData value, global::MessagePack.MessagePackSerializerOptions options) + public void Serialize(ref global::MessagePack.MessagePackWriter writer, global::SharedData.Empty1 value, global::MessagePack.MessagePackSerializerOptions options) { if (value == null) { @@ -2283,59 +2271,25 @@ public void Serialize(ref MessagePackWriter writer, global::SharedData.FirstSimp return; } - IFormatterResolver formatterResolver = options.Resolver; - writer.WriteArrayHeader(3); - writer.Write(value.Prop1); - formatterResolver.GetFormatterWithVerify().Serialize(ref writer, value.Prop2, options); - writer.Write(value.Prop3); + writer.WriteArrayHeader(0); } - public global::SharedData.FirstSimpleData Deserialize(ref MessagePackReader reader, global::MessagePack.MessagePackSerializerOptions options) + public global::SharedData.Empty1 Deserialize(ref global::MessagePack.MessagePackReader reader, global::MessagePack.MessagePackSerializerOptions options) { if (reader.TryReadNil()) { return null; } - options.Security.DepthStep(ref reader); - IFormatterResolver formatterResolver = options.Resolver; - var length = reader.ReadArrayHeader(); - var __Prop1__ = default(int); - var __Prop2__ = default(string); - var __Prop3__ = default(int); - - for (int i = 0; i < length; i++) - { - switch (i) - { - case 0: - __Prop1__ = reader.ReadInt32(); - break; - case 1: - __Prop2__ = formatterResolver.GetFormatterWithVerify().Deserialize(ref reader, options); - break; - case 2: - __Prop3__ = reader.ReadInt32(); - break; - default: - reader.Skip(); - break; - } - } - - var ____result = new global::SharedData.FirstSimpleData(); - ____result.Prop1 = __Prop1__; - ____result.Prop2 = __Prop2__; - ____result.Prop3 = __Prop3__; - reader.Depth--; - return ____result; + reader.Skip(); + return new global::SharedData.Empty1(); } } - public sealed class FooClassFormatter : global::MessagePack.Formatters.IMessagePackFormatter + public sealed class EmptyClassFormatter : global::MessagePack.Formatters.IMessagePackFormatter { - public void Serialize(ref MessagePackWriter writer, global::SharedData.FooClass value, global::MessagePack.MessagePackSerializerOptions options) + public void Serialize(ref global::MessagePack.MessagePackWriter writer, global::SharedData.EmptyClass value, global::MessagePack.MessagePackSerializerOptions options) { if (value == null) { @@ -2343,27 +2297,83 @@ public void Serialize(ref MessagePackWriter writer, global::SharedData.FooClass return; } - writer.WriteArrayHeader(1); - writer.Write(value.XYZ); + writer.WriteArrayHeader(0); } - public global::SharedData.FooClass Deserialize(ref MessagePackReader reader, global::MessagePack.MessagePackSerializerOptions options) + public global::SharedData.EmptyClass Deserialize(ref global::MessagePack.MessagePackReader reader, global::MessagePack.MessagePackSerializerOptions options) { if (reader.TryReadNil()) { return null; } - options.Security.DepthStep(ref reader); - var length = reader.ReadArrayHeader(); - var __XYZ__ = default(int); + reader.Skip(); + return new global::SharedData.EmptyClass(); + } + } + + public sealed class EmptyStructFormatter : global::MessagePack.Formatters.IMessagePackFormatter + { + + public void Serialize(ref global::MessagePack.MessagePackWriter writer, global::SharedData.EmptyStruct value, global::MessagePack.MessagePackSerializerOptions options) + { + writer.WriteArrayHeader(0); + } + + public global::SharedData.EmptyStruct Deserialize(ref global::MessagePack.MessagePackReader reader, global::MessagePack.MessagePackSerializerOptions options) + { + if (reader.TryReadNil()) + { + throw new global::System.InvalidOperationException("typecode is null, struct not supported"); + } + + reader.Skip(); + return new global::SharedData.EmptyStruct(); + } + } + + public sealed class FirstSimpleDataFormatter : global::MessagePack.Formatters.IMessagePackFormatter + { + + public void Serialize(ref global::MessagePack.MessagePackWriter writer, global::SharedData.FirstSimpleData value, global::MessagePack.MessagePackSerializerOptions options) + { + if (value == null) + { + writer.WriteNil(); + return; + } + + global::MessagePack.IFormatterResolver formatterResolver = options.Resolver; + writer.WriteArrayHeader(3); + writer.Write(value.Prop1); + global::MessagePack.FormatterResolverExtensions.GetFormatterWithVerify(formatterResolver).Serialize(ref writer, value.Prop2, options); + writer.Write(value.Prop3); + } + + public global::SharedData.FirstSimpleData Deserialize(ref global::MessagePack.MessagePackReader reader, global::MessagePack.MessagePackSerializerOptions options) + { + if (reader.TryReadNil()) + { + return null; + } + + options.Security.DepthStep(ref reader); + global::MessagePack.IFormatterResolver formatterResolver = options.Resolver; + var length = reader.ReadArrayHeader(); + var ____result = new global::SharedData.FirstSimpleData(); for (int i = 0; i < length; i++) { switch (i) { case 0: - __XYZ__ = reader.ReadInt32(); + ____result.Prop1 = reader.ReadInt32(); + break; + case 1: + ____result.Prop2 = global::MessagePack.FormatterResolverExtensions.GetFormatterWithVerify(formatterResolver).Deserialize(ref reader, options); + break; + case 2: + ____result.Prop3 = reader.ReadInt32(); break; default: reader.Skip(); @@ -2371,17 +2381,59 @@ public void Serialize(ref MessagePackWriter writer, global::SharedData.FooClass } } + reader.Depth--; + return ____result; + } + } + + public sealed class FooClassFormatter : global::MessagePack.Formatters.IMessagePackFormatter + { + + public void Serialize(ref global::MessagePack.MessagePackWriter writer, global::SharedData.FooClass value, global::MessagePack.MessagePackSerializerOptions options) + { + if (value == null) + { + writer.WriteNil(); + return; + } + + writer.WriteArrayHeader(1); + writer.Write(value.XYZ); + } + + public global::SharedData.FooClass Deserialize(ref global::MessagePack.MessagePackReader reader, global::MessagePack.MessagePackSerializerOptions options) + { + if (reader.TryReadNil()) + { + return null; + } + + options.Security.DepthStep(ref reader); + var length = reader.ReadArrayHeader(); var ____result = new global::SharedData.FooClass(); - ____result.XYZ = __XYZ__; + + for (int i = 0; i < length; i++) + { + switch (i) + { + case 0: + ____result.XYZ = reader.ReadInt32(); + break; + default: + reader.Skip(); + break; + } + } + reader.Depth--; return ____result; } } - public sealed class GenericClassFormatter : global::MessagePack.Formatters.IMessagePackFormatter> + public sealed class GenericClassFormatter : global::MessagePack.Formatters.IMessagePackFormatter> { - public void Serialize(ref MessagePackWriter writer, global::SharedData.GenericClass value, global::MessagePack.MessagePackSerializerOptions options) + public void Serialize(ref global::MessagePack.MessagePackWriter writer, global::SharedData.GenericClass value, global::MessagePack.MessagePackSerializerOptions options) { if (value == null) { @@ -2389,13 +2441,13 @@ public void Serialize(ref MessagePackWriter writer, global::SharedData.GenericCl return; } - IFormatterResolver formatterResolver = options.Resolver; + global::MessagePack.IFormatterResolver formatterResolver = options.Resolver; writer.WriteArrayHeader(2); - formatterResolver.GetFormatterWithVerify().Serialize(ref writer, value.MyProperty0, options); - formatterResolver.GetFormatterWithVerify().Serialize(ref writer, value.MyProperty1, options); + global::MessagePack.FormatterResolverExtensions.GetFormatterWithVerify(formatterResolver).Serialize(ref writer, value.MyProperty0, options); + global::MessagePack.FormatterResolverExtensions.GetFormatterWithVerify(formatterResolver).Serialize(ref writer, value.MyProperty1, options); } - public global::SharedData.GenericClass Deserialize(ref MessagePackReader reader, global::MessagePack.MessagePackSerializerOptions options) + public global::SharedData.GenericClass Deserialize(ref global::MessagePack.MessagePackReader reader, global::MessagePack.MessagePackSerializerOptions options) { if (reader.TryReadNil()) { @@ -2403,20 +2455,19 @@ public void Serialize(ref MessagePackWriter writer, global::SharedData.GenericCl } options.Security.DepthStep(ref reader); - IFormatterResolver formatterResolver = options.Resolver; + global::MessagePack.IFormatterResolver formatterResolver = options.Resolver; var length = reader.ReadArrayHeader(); - var __MyProperty0__ = default(T1); - var __MyProperty1__ = default(T2); + var ____result = new global::SharedData.GenericClass(); for (int i = 0; i < length; i++) { switch (i) { case 0: - __MyProperty0__ = formatterResolver.GetFormatterWithVerify().Deserialize(ref reader, options); + ____result.MyProperty0 = global::MessagePack.FormatterResolverExtensions.GetFormatterWithVerify(formatterResolver).Deserialize(ref reader, options); break; case 1: - __MyProperty1__ = formatterResolver.GetFormatterWithVerify().Deserialize(ref reader, options); + ____result.MyProperty1 = global::MessagePack.FormatterResolverExtensions.GetFormatterWithVerify(formatterResolver).Deserialize(ref reader, options); break; default: reader.Skip(); @@ -2424,20 +2475,17 @@ public void Serialize(ref MessagePackWriter writer, global::SharedData.GenericCl } } - var ____result = new global::SharedData.GenericClass(); - ____result.MyProperty0 = __MyProperty0__; - ____result.MyProperty1 = __MyProperty1__; reader.Depth--; return ____result; } } - public sealed class GenericConstrainedClassIntKeyFormatter : global::MessagePack.Formatters.IMessagePackFormatter> + public sealed class GenericConstrainedClassIntKeyFormatter : global::MessagePack.Formatters.IMessagePackFormatter> where T1 : class where T2 : class, global::System.Collections.Generic.IEqualityComparer { - public void Serialize(ref MessagePackWriter writer, global::SharedData.GenericConstrainedClassIntKey value, global::MessagePack.MessagePackSerializerOptions options) + public void Serialize(ref global::MessagePack.MessagePackWriter writer, global::SharedData.GenericConstrainedClassIntKey value, global::MessagePack.MessagePackSerializerOptions options) { if (value == null) { @@ -2445,13 +2493,13 @@ public void Serialize(ref MessagePackWriter writer, global::SharedData.GenericCo return; } - IFormatterResolver formatterResolver = options.Resolver; + global::MessagePack.IFormatterResolver formatterResolver = options.Resolver; writer.WriteArrayHeader(2); - formatterResolver.GetFormatterWithVerify().Serialize(ref writer, value.MyProperty0, options); - formatterResolver.GetFormatterWithVerify().Serialize(ref writer, value.Comparer, options); + global::MessagePack.FormatterResolverExtensions.GetFormatterWithVerify(formatterResolver).Serialize(ref writer, value.MyProperty0, options); + global::MessagePack.FormatterResolverExtensions.GetFormatterWithVerify(formatterResolver).Serialize(ref writer, value.Comparer, options); } - public global::SharedData.GenericConstrainedClassIntKey Deserialize(ref MessagePackReader reader, global::MessagePack.MessagePackSerializerOptions options) + public global::SharedData.GenericConstrainedClassIntKey Deserialize(ref global::MessagePack.MessagePackReader reader, global::MessagePack.MessagePackSerializerOptions options) { if (reader.TryReadNil()) { @@ -2459,20 +2507,19 @@ public void Serialize(ref MessagePackWriter writer, global::SharedData.GenericCo } options.Security.DepthStep(ref reader); - IFormatterResolver formatterResolver = options.Resolver; + global::MessagePack.IFormatterResolver formatterResolver = options.Resolver; var length = reader.ReadArrayHeader(); - var __MyProperty0__ = default(T1); - var __Comparer__ = default(T2); + var ____result = new global::SharedData.GenericConstrainedClassIntKey(); for (int i = 0; i < length; i++) { switch (i) { case 0: - __MyProperty0__ = formatterResolver.GetFormatterWithVerify().Deserialize(ref reader, options); + ____result.MyProperty0 = global::MessagePack.FormatterResolverExtensions.GetFormatterWithVerify(formatterResolver).Deserialize(ref reader, options); break; case 1: - __Comparer__ = formatterResolver.GetFormatterWithVerify().Deserialize(ref reader, options); + ____result.Comparer = global::MessagePack.FormatterResolverExtensions.GetFormatterWithVerify(formatterResolver).Deserialize(ref reader, options); break; default: reader.Skip(); @@ -2480,49 +2527,45 @@ public void Serialize(ref MessagePackWriter writer, global::SharedData.GenericCo } } - var ____result = new global::SharedData.GenericConstrainedClassIntKey(); - ____result.MyProperty0 = __MyProperty0__; - ____result.Comparer = __Comparer__; reader.Depth--; return ____result; } } - public sealed class GenericConstrainedStructIntKeyFormatter : global::MessagePack.Formatters.IMessagePackFormatter> + public sealed class GenericConstrainedStructIntKeyFormatter : global::MessagePack.Formatters.IMessagePackFormatter> where T1 : unmanaged where T2 : unmanaged, global::System.Collections.Generic.IEqualityComparer { - public void Serialize(ref MessagePackWriter writer, global::SharedData.GenericConstrainedStructIntKey value, global::MessagePack.MessagePackSerializerOptions options) + public void Serialize(ref global::MessagePack.MessagePackWriter writer, global::SharedData.GenericConstrainedStructIntKey value, global::MessagePack.MessagePackSerializerOptions options) { - IFormatterResolver formatterResolver = options.Resolver; + global::MessagePack.IFormatterResolver formatterResolver = options.Resolver; writer.WriteArrayHeader(2); - formatterResolver.GetFormatterWithVerify().Serialize(ref writer, value.MyProperty0, options); - formatterResolver.GetFormatterWithVerify().Serialize(ref writer, value.Comparer, options); + global::MessagePack.FormatterResolverExtensions.GetFormatterWithVerify(formatterResolver).Serialize(ref writer, value.MyProperty0, options); + global::MessagePack.FormatterResolverExtensions.GetFormatterWithVerify(formatterResolver).Serialize(ref writer, value.Comparer, options); } - public global::SharedData.GenericConstrainedStructIntKey Deserialize(ref MessagePackReader reader, global::MessagePack.MessagePackSerializerOptions options) + public global::SharedData.GenericConstrainedStructIntKey Deserialize(ref global::MessagePack.MessagePackReader reader, global::MessagePack.MessagePackSerializerOptions options) { if (reader.TryReadNil()) { - throw new InvalidOperationException("typecode is null, struct not supported"); + throw new global::System.InvalidOperationException("typecode is null, struct not supported"); } options.Security.DepthStep(ref reader); - IFormatterResolver formatterResolver = options.Resolver; + global::MessagePack.IFormatterResolver formatterResolver = options.Resolver; var length = reader.ReadArrayHeader(); - var __MyProperty0__ = default(T1); - var __Comparer__ = default(T2); + var ____result = new global::SharedData.GenericConstrainedStructIntKey(); for (int i = 0; i < length; i++) { switch (i) { case 0: - __MyProperty0__ = formatterResolver.GetFormatterWithVerify().Deserialize(ref reader, options); + ____result.MyProperty0 = global::MessagePack.FormatterResolverExtensions.GetFormatterWithVerify(formatterResolver).Deserialize(ref reader, options); break; case 1: - __Comparer__ = formatterResolver.GetFormatterWithVerify().Deserialize(ref reader, options); + ____result.Comparer = global::MessagePack.FormatterResolverExtensions.GetFormatterWithVerify(formatterResolver).Deserialize(ref reader, options); break; default: reader.Skip(); @@ -2530,47 +2573,43 @@ public void Serialize(ref MessagePackWriter writer, global::SharedData.GenericCo } } - var ____result = new global::SharedData.GenericConstrainedStructIntKey(); - ____result.MyProperty0 = __MyProperty0__; - ____result.Comparer = __Comparer__; reader.Depth--; return ____result; } } - public sealed class GenericStructFormatter : global::MessagePack.Formatters.IMessagePackFormatter> + public sealed class GenericStructFormatter : global::MessagePack.Formatters.IMessagePackFormatter> { - public void Serialize(ref MessagePackWriter writer, global::SharedData.GenericStruct value, global::MessagePack.MessagePackSerializerOptions options) + public void Serialize(ref global::MessagePack.MessagePackWriter writer, global::SharedData.GenericStruct value, global::MessagePack.MessagePackSerializerOptions options) { - IFormatterResolver formatterResolver = options.Resolver; + global::MessagePack.IFormatterResolver formatterResolver = options.Resolver; writer.WriteArrayHeader(2); - formatterResolver.GetFormatterWithVerify().Serialize(ref writer, value.MyProperty0, options); - formatterResolver.GetFormatterWithVerify().Serialize(ref writer, value.MyProperty1, options); + global::MessagePack.FormatterResolverExtensions.GetFormatterWithVerify(formatterResolver).Serialize(ref writer, value.MyProperty0, options); + global::MessagePack.FormatterResolverExtensions.GetFormatterWithVerify(formatterResolver).Serialize(ref writer, value.MyProperty1, options); } - public global::SharedData.GenericStruct Deserialize(ref MessagePackReader reader, global::MessagePack.MessagePackSerializerOptions options) + public global::SharedData.GenericStruct Deserialize(ref global::MessagePack.MessagePackReader reader, global::MessagePack.MessagePackSerializerOptions options) { if (reader.TryReadNil()) { - throw new InvalidOperationException("typecode is null, struct not supported"); + throw new global::System.InvalidOperationException("typecode is null, struct not supported"); } options.Security.DepthStep(ref reader); - IFormatterResolver formatterResolver = options.Resolver; + global::MessagePack.IFormatterResolver formatterResolver = options.Resolver; var length = reader.ReadArrayHeader(); - var __MyProperty0__ = default(T1); - var __MyProperty1__ = default(T2); + var ____result = new global::SharedData.GenericStruct(); for (int i = 0; i < length; i++) { switch (i) { case 0: - __MyProperty0__ = formatterResolver.GetFormatterWithVerify().Deserialize(ref reader, options); + ____result.MyProperty0 = global::MessagePack.FormatterResolverExtensions.GetFormatterWithVerify(formatterResolver).Deserialize(ref reader, options); break; case 1: - __MyProperty1__ = formatterResolver.GetFormatterWithVerify().Deserialize(ref reader, options); + ____result.MyProperty1 = global::MessagePack.FormatterResolverExtensions.GetFormatterWithVerify(formatterResolver).Deserialize(ref reader, options); break; default: reader.Skip(); @@ -2578,9 +2617,6 @@ public void Serialize(ref MessagePackWriter writer, global::SharedData.GenericSt } } - var ____result = new global::SharedData.GenericStruct(); - ____result.MyProperty0 = __MyProperty0__; - ____result.MyProperty1 = __MyProperty1__; reader.Depth--; return ____result; } @@ -2589,7 +2625,7 @@ public void Serialize(ref MessagePackWriter writer, global::SharedData.GenericSt public sealed class HolderV0Formatter : global::MessagePack.Formatters.IMessagePackFormatter { - public void Serialize(ref MessagePackWriter writer, global::SharedData.HolderV0 value, global::MessagePack.MessagePackSerializerOptions options) + public void Serialize(ref global::MessagePack.MessagePackWriter writer, global::SharedData.HolderV0 value, global::MessagePack.MessagePackSerializerOptions options) { if (value == null) { @@ -2597,13 +2633,13 @@ public void Serialize(ref MessagePackWriter writer, global::SharedData.HolderV0 return; } - IFormatterResolver formatterResolver = options.Resolver; + global::MessagePack.IFormatterResolver formatterResolver = options.Resolver; writer.WriteArrayHeader(2); - formatterResolver.GetFormatterWithVerify().Serialize(ref writer, value.MyProperty1, options); + global::MessagePack.FormatterResolverExtensions.GetFormatterWithVerify(formatterResolver).Serialize(ref writer, value.MyProperty1, options); writer.Write(value.After); } - public global::SharedData.HolderV0 Deserialize(ref MessagePackReader reader, global::MessagePack.MessagePackSerializerOptions options) + public global::SharedData.HolderV0 Deserialize(ref global::MessagePack.MessagePackReader reader, global::MessagePack.MessagePackSerializerOptions options) { if (reader.TryReadNil()) { @@ -2611,20 +2647,19 @@ public void Serialize(ref MessagePackWriter writer, global::SharedData.HolderV0 } options.Security.DepthStep(ref reader); - IFormatterResolver formatterResolver = options.Resolver; + global::MessagePack.IFormatterResolver formatterResolver = options.Resolver; var length = reader.ReadArrayHeader(); - var __MyProperty1__ = default(global::SharedData.Version0); - var __After__ = default(int); + var ____result = new global::SharedData.HolderV0(); for (int i = 0; i < length; i++) { switch (i) { case 0: - __MyProperty1__ = formatterResolver.GetFormatterWithVerify().Deserialize(ref reader, options); + ____result.MyProperty1 = global::MessagePack.FormatterResolverExtensions.GetFormatterWithVerify(formatterResolver).Deserialize(ref reader, options); break; case 1: - __After__ = reader.ReadInt32(); + ____result.After = reader.ReadInt32(); break; default: reader.Skip(); @@ -2632,9 +2667,6 @@ public void Serialize(ref MessagePackWriter writer, global::SharedData.HolderV0 } } - var ____result = new global::SharedData.HolderV0(); - ____result.MyProperty1 = __MyProperty1__; - ____result.After = __After__; reader.Depth--; return ____result; } @@ -2643,7 +2675,7 @@ public void Serialize(ref MessagePackWriter writer, global::SharedData.HolderV0 public sealed class HolderV1Formatter : global::MessagePack.Formatters.IMessagePackFormatter { - public void Serialize(ref MessagePackWriter writer, global::SharedData.HolderV1 value, global::MessagePack.MessagePackSerializerOptions options) + public void Serialize(ref global::MessagePack.MessagePackWriter writer, global::SharedData.HolderV1 value, global::MessagePack.MessagePackSerializerOptions options) { if (value == null) { @@ -2651,13 +2683,13 @@ public void Serialize(ref MessagePackWriter writer, global::SharedData.HolderV1 return; } - IFormatterResolver formatterResolver = options.Resolver; + global::MessagePack.IFormatterResolver formatterResolver = options.Resolver; writer.WriteArrayHeader(2); - formatterResolver.GetFormatterWithVerify().Serialize(ref writer, value.MyProperty1, options); + global::MessagePack.FormatterResolverExtensions.GetFormatterWithVerify(formatterResolver).Serialize(ref writer, value.MyProperty1, options); writer.Write(value.After); } - public global::SharedData.HolderV1 Deserialize(ref MessagePackReader reader, global::MessagePack.MessagePackSerializerOptions options) + public global::SharedData.HolderV1 Deserialize(ref global::MessagePack.MessagePackReader reader, global::MessagePack.MessagePackSerializerOptions options) { if (reader.TryReadNil()) { @@ -2665,20 +2697,19 @@ public void Serialize(ref MessagePackWriter writer, global::SharedData.HolderV1 } options.Security.DepthStep(ref reader); - IFormatterResolver formatterResolver = options.Resolver; + global::MessagePack.IFormatterResolver formatterResolver = options.Resolver; var length = reader.ReadArrayHeader(); - var __MyProperty1__ = default(global::SharedData.Version1); - var __After__ = default(int); + var ____result = new global::SharedData.HolderV1(); for (int i = 0; i < length; i++) { switch (i) { case 0: - __MyProperty1__ = formatterResolver.GetFormatterWithVerify().Deserialize(ref reader, options); + ____result.MyProperty1 = global::MessagePack.FormatterResolverExtensions.GetFormatterWithVerify(formatterResolver).Deserialize(ref reader, options); break; case 1: - __After__ = reader.ReadInt32(); + ____result.After = reader.ReadInt32(); break; default: reader.Skip(); @@ -2686,9 +2717,6 @@ public void Serialize(ref MessagePackWriter writer, global::SharedData.HolderV1 } } - var ____result = new global::SharedData.HolderV1(); - ____result.MyProperty1 = __MyProperty1__; - ____result.After = __After__; reader.Depth--; return ____result; } @@ -2697,7 +2725,7 @@ public void Serialize(ref MessagePackWriter writer, global::SharedData.HolderV1 public sealed class HolderV2Formatter : global::MessagePack.Formatters.IMessagePackFormatter { - public void Serialize(ref MessagePackWriter writer, global::SharedData.HolderV2 value, global::MessagePack.MessagePackSerializerOptions options) + public void Serialize(ref global::MessagePack.MessagePackWriter writer, global::SharedData.HolderV2 value, global::MessagePack.MessagePackSerializerOptions options) { if (value == null) { @@ -2705,13 +2733,13 @@ public void Serialize(ref MessagePackWriter writer, global::SharedData.HolderV2 return; } - IFormatterResolver formatterResolver = options.Resolver; + global::MessagePack.IFormatterResolver formatterResolver = options.Resolver; writer.WriteArrayHeader(2); - formatterResolver.GetFormatterWithVerify().Serialize(ref writer, value.MyProperty1, options); + global::MessagePack.FormatterResolverExtensions.GetFormatterWithVerify(formatterResolver).Serialize(ref writer, value.MyProperty1, options); writer.Write(value.After); } - public global::SharedData.HolderV2 Deserialize(ref MessagePackReader reader, global::MessagePack.MessagePackSerializerOptions options) + public global::SharedData.HolderV2 Deserialize(ref global::MessagePack.MessagePackReader reader, global::MessagePack.MessagePackSerializerOptions options) { if (reader.TryReadNil()) { @@ -2719,20 +2747,19 @@ public void Serialize(ref MessagePackWriter writer, global::SharedData.HolderV2 } options.Security.DepthStep(ref reader); - IFormatterResolver formatterResolver = options.Resolver; + global::MessagePack.IFormatterResolver formatterResolver = options.Resolver; var length = reader.ReadArrayHeader(); - var __MyProperty1__ = default(global::SharedData.Version2); - var __After__ = default(int); + var ____result = new global::SharedData.HolderV2(); for (int i = 0; i < length; i++) { switch (i) { case 0: - __MyProperty1__ = formatterResolver.GetFormatterWithVerify().Deserialize(ref reader, options); + ____result.MyProperty1 = global::MessagePack.FormatterResolverExtensions.GetFormatterWithVerify(formatterResolver).Deserialize(ref reader, options); break; case 1: - __After__ = reader.ReadInt32(); + ____result.After = reader.ReadInt32(); break; default: reader.Skip(); @@ -2740,9 +2767,6 @@ public void Serialize(ref MessagePackWriter writer, global::SharedData.HolderV2 } } - var ____result = new global::SharedData.HolderV2(); - ____result.MyProperty1 = __MyProperty1__; - ____result.After = __After__; reader.Depth--; return ____result; } @@ -2751,7 +2775,7 @@ public void Serialize(ref MessagePackWriter writer, global::SharedData.HolderV2 public sealed class MyClassFormatter : global::MessagePack.Formatters.IMessagePackFormatter { - public void Serialize(ref MessagePackWriter writer, global::SharedData.MyClass value, global::MessagePack.MessagePackSerializerOptions options) + public void Serialize(ref global::MessagePack.MessagePackWriter writer, global::SharedData.MyClass value, global::MessagePack.MessagePackSerializerOptions options) { if (value == null) { @@ -2765,7 +2789,7 @@ public void Serialize(ref MessagePackWriter writer, global::SharedData.MyClass v writer.Write(value.MyProperty3); } - public global::SharedData.MyClass Deserialize(ref MessagePackReader reader, global::MessagePack.MessagePackSerializerOptions options) + public global::SharedData.MyClass Deserialize(ref global::MessagePack.MessagePackReader reader, global::MessagePack.MessagePackSerializerOptions options) { if (reader.TryReadNil()) { @@ -2774,22 +2798,20 @@ public void Serialize(ref MessagePackWriter writer, global::SharedData.MyClass v options.Security.DepthStep(ref reader); var length = reader.ReadArrayHeader(); - var __MyProperty1__ = default(int); - var __MyProperty2__ = default(int); - var __MyProperty3__ = default(int); + var ____result = new global::SharedData.MyClass(); for (int i = 0; i < length; i++) { switch (i) { case 0: - __MyProperty1__ = reader.ReadInt32(); + ____result.MyProperty1 = reader.ReadInt32(); break; case 1: - __MyProperty2__ = reader.ReadInt32(); + ____result.MyProperty2 = reader.ReadInt32(); break; case 2: - __MyProperty3__ = reader.ReadInt32(); + ____result.MyProperty3 = reader.ReadInt32(); break; default: reader.Skip(); @@ -2797,10 +2819,6 @@ public void Serialize(ref MessagePackWriter writer, global::SharedData.MyClass v } } - var ____result = new global::SharedData.MyClass(); - ____result.MyProperty1 = __MyProperty1__; - ____result.MyProperty2 = __MyProperty2__; - ____result.MyProperty3 = __MyProperty3__; reader.Depth--; return ____result; } @@ -2809,7 +2827,7 @@ public void Serialize(ref MessagePackWriter writer, global::SharedData.MyClass v public sealed class MySubUnion1Formatter : global::MessagePack.Formatters.IMessagePackFormatter { - public void Serialize(ref MessagePackWriter writer, global::SharedData.MySubUnion1 value, global::MessagePack.MessagePackSerializerOptions options) + public void Serialize(ref global::MessagePack.MessagePackWriter writer, global::SharedData.MySubUnion1 value, global::MessagePack.MessagePackSerializerOptions options) { if (value == null) { @@ -2824,7 +2842,7 @@ public void Serialize(ref MessagePackWriter writer, global::SharedData.MySubUnio writer.Write(value.One); } - public global::SharedData.MySubUnion1 Deserialize(ref MessagePackReader reader, global::MessagePack.MessagePackSerializerOptions options) + public global::SharedData.MySubUnion1 Deserialize(ref global::MessagePack.MessagePackReader reader, global::MessagePack.MessagePackSerializerOptions options) { if (reader.TryReadNil()) { @@ -2833,14 +2851,14 @@ public void Serialize(ref MessagePackWriter writer, global::SharedData.MySubUnio options.Security.DepthStep(ref reader); var length = reader.ReadArrayHeader(); - var __One__ = default(int); + var ____result = new global::SharedData.MySubUnion1(); for (int i = 0; i < length; i++) { switch (i) { case 3: - __One__ = reader.ReadInt32(); + ____result.One = reader.ReadInt32(); break; default: reader.Skip(); @@ -2848,8 +2866,6 @@ public void Serialize(ref MessagePackWriter writer, global::SharedData.MySubUnio } } - var ____result = new global::SharedData.MySubUnion1(); - ____result.One = __One__; reader.Depth--; return ____result; } @@ -2858,7 +2874,7 @@ public void Serialize(ref MessagePackWriter writer, global::SharedData.MySubUnio public sealed class MySubUnion2Formatter : global::MessagePack.Formatters.IMessagePackFormatter { - public void Serialize(ref MessagePackWriter writer, global::SharedData.MySubUnion2 value, global::MessagePack.MessagePackSerializerOptions options) + public void Serialize(ref global::MessagePack.MessagePackWriter writer, global::SharedData.MySubUnion2 value, global::MessagePack.MessagePackSerializerOptions options) { writer.WriteArrayHeader(6); writer.WriteNil(); @@ -2869,23 +2885,23 @@ public void Serialize(ref MessagePackWriter writer, global::SharedData.MySubUnio writer.Write(value.Two); } - public global::SharedData.MySubUnion2 Deserialize(ref MessagePackReader reader, global::MessagePack.MessagePackSerializerOptions options) + public global::SharedData.MySubUnion2 Deserialize(ref global::MessagePack.MessagePackReader reader, global::MessagePack.MessagePackSerializerOptions options) { if (reader.TryReadNil()) { - throw new InvalidOperationException("typecode is null, struct not supported"); + throw new global::System.InvalidOperationException("typecode is null, struct not supported"); } options.Security.DepthStep(ref reader); var length = reader.ReadArrayHeader(); - var __Two__ = default(int); + var ____result = new global::SharedData.MySubUnion2(); for (int i = 0; i < length; i++) { switch (i) { case 5: - __Two__ = reader.ReadInt32(); + ____result.Two = reader.ReadInt32(); break; default: reader.Skip(); @@ -2893,8 +2909,6 @@ public void Serialize(ref MessagePackWriter writer, global::SharedData.MySubUnio } } - var ____result = new global::SharedData.MySubUnion2(); - ____result.Two = __Two__; reader.Depth--; return ____result; } @@ -2903,7 +2917,7 @@ public void Serialize(ref MessagePackWriter writer, global::SharedData.MySubUnio public sealed class MySubUnion3Formatter : global::MessagePack.Formatters.IMessagePackFormatter { - public void Serialize(ref MessagePackWriter writer, global::SharedData.MySubUnion3 value, global::MessagePack.MessagePackSerializerOptions options) + public void Serialize(ref global::MessagePack.MessagePackWriter writer, global::SharedData.MySubUnion3 value, global::MessagePack.MessagePackSerializerOptions options) { if (value == null) { @@ -2917,7 +2931,7 @@ public void Serialize(ref MessagePackWriter writer, global::SharedData.MySubUnio writer.Write(value.Three); } - public global::SharedData.MySubUnion3 Deserialize(ref MessagePackReader reader, global::MessagePack.MessagePackSerializerOptions options) + public global::SharedData.MySubUnion3 Deserialize(ref global::MessagePack.MessagePackReader reader, global::MessagePack.MessagePackSerializerOptions options) { if (reader.TryReadNil()) { @@ -2926,14 +2940,14 @@ public void Serialize(ref MessagePackWriter writer, global::SharedData.MySubUnio options.Security.DepthStep(ref reader); var length = reader.ReadArrayHeader(); - var __Three__ = default(int); + var ____result = new global::SharedData.MySubUnion3(); for (int i = 0; i < length; i++) { switch (i) { case 2: - __Three__ = reader.ReadInt32(); + ____result.Three = reader.ReadInt32(); break; default: reader.Skip(); @@ -2941,8 +2955,6 @@ public void Serialize(ref MessagePackWriter writer, global::SharedData.MySubUnio } } - var ____result = new global::SharedData.MySubUnion3(); - ____result.Three = __Three__; reader.Depth--; return ____result; } @@ -2951,7 +2963,7 @@ public void Serialize(ref MessagePackWriter writer, global::SharedData.MySubUnio public sealed class MySubUnion4Formatter : global::MessagePack.Formatters.IMessagePackFormatter { - public void Serialize(ref MessagePackWriter writer, global::SharedData.MySubUnion4 value, global::MessagePack.MessagePackSerializerOptions options) + public void Serialize(ref global::MessagePack.MessagePackWriter writer, global::SharedData.MySubUnion4 value, global::MessagePack.MessagePackSerializerOptions options) { writer.WriteArrayHeader(8); writer.WriteNil(); @@ -2964,23 +2976,23 @@ public void Serialize(ref MessagePackWriter writer, global::SharedData.MySubUnio writer.Write(value.Four); } - public global::SharedData.MySubUnion4 Deserialize(ref MessagePackReader reader, global::MessagePack.MessagePackSerializerOptions options) + public global::SharedData.MySubUnion4 Deserialize(ref global::MessagePack.MessagePackReader reader, global::MessagePack.MessagePackSerializerOptions options) { if (reader.TryReadNil()) { - throw new InvalidOperationException("typecode is null, struct not supported"); + throw new global::System.InvalidOperationException("typecode is null, struct not supported"); } options.Security.DepthStep(ref reader); var length = reader.ReadArrayHeader(); - var __Four__ = default(int); + var ____result = new global::SharedData.MySubUnion4(); for (int i = 0; i < length; i++) { switch (i) { case 7: - __Four__ = reader.ReadInt32(); + ____result.Four = reader.ReadInt32(); break; default: reader.Skip(); @@ -2988,8 +3000,6 @@ public void Serialize(ref MessagePackWriter writer, global::SharedData.MySubUnio } } - var ____result = new global::SharedData.MySubUnion4(); - ____result.Four = __Four__; reader.Depth--; return ____result; } @@ -2998,7 +3008,7 @@ public void Serialize(ref MessagePackWriter writer, global::SharedData.MySubUnio public sealed class NestParent_NestContractFormatter : global::MessagePack.Formatters.IMessagePackFormatter { - public void Serialize(ref MessagePackWriter writer, global::SharedData.NestParent.NestContract value, global::MessagePack.MessagePackSerializerOptions options) + public void Serialize(ref global::MessagePack.MessagePackWriter writer, global::SharedData.NestParent.NestContract value, global::MessagePack.MessagePackSerializerOptions options) { if (value == null) { @@ -3010,7 +3020,7 @@ public void Serialize(ref MessagePackWriter writer, global::SharedData.NestParen writer.Write(value.MyProperty); } - public global::SharedData.NestParent.NestContract Deserialize(ref MessagePackReader reader, global::MessagePack.MessagePackSerializerOptions options) + public global::SharedData.NestParent.NestContract Deserialize(ref global::MessagePack.MessagePackReader reader, global::MessagePack.MessagePackSerializerOptions options) { if (reader.TryReadNil()) { @@ -3019,14 +3029,14 @@ public void Serialize(ref MessagePackWriter writer, global::SharedData.NestParen options.Security.DepthStep(ref reader); var length = reader.ReadArrayHeader(); - var __MyProperty__ = default(int); + var ____result = new global::SharedData.NestParent.NestContract(); for (int i = 0; i < length; i++) { switch (i) { case 0: - __MyProperty__ = reader.ReadInt32(); + ____result.MyProperty = reader.ReadInt32(); break; default: reader.Skip(); @@ -3034,8 +3044,6 @@ public void Serialize(ref MessagePackWriter writer, global::SharedData.NestParen } } - var ____result = new global::SharedData.NestParent.NestContract(); - ____result.MyProperty = __MyProperty__; reader.Depth--; return ____result; } @@ -3044,7 +3052,7 @@ public void Serialize(ref MessagePackWriter writer, global::SharedData.NestParen public sealed class NonEmpty1Formatter : global::MessagePack.Formatters.IMessagePackFormatter { - public void Serialize(ref MessagePackWriter writer, global::SharedData.NonEmpty1 value, global::MessagePack.MessagePackSerializerOptions options) + public void Serialize(ref global::MessagePack.MessagePackWriter writer, global::SharedData.NonEmpty1 value, global::MessagePack.MessagePackSerializerOptions options) { if (value == null) { @@ -3056,7 +3064,7 @@ public void Serialize(ref MessagePackWriter writer, global::SharedData.NonEmpty1 writer.Write(value.MyProperty); } - public global::SharedData.NonEmpty1 Deserialize(ref MessagePackReader reader, global::MessagePack.MessagePackSerializerOptions options) + public global::SharedData.NonEmpty1 Deserialize(ref global::MessagePack.MessagePackReader reader, global::MessagePack.MessagePackSerializerOptions options) { if (reader.TryReadNil()) { @@ -3065,14 +3073,14 @@ public void Serialize(ref MessagePackWriter writer, global::SharedData.NonEmpty1 options.Security.DepthStep(ref reader); var length = reader.ReadArrayHeader(); - var __MyProperty__ = default(int); + var ____result = new global::SharedData.NonEmpty1(); for (int i = 0; i < length; i++) { switch (i) { case 0: - __MyProperty__ = reader.ReadInt32(); + ____result.MyProperty = reader.ReadInt32(); break; default: reader.Skip(); @@ -3080,8 +3088,6 @@ public void Serialize(ref MessagePackWriter writer, global::SharedData.NonEmpty1 } } - var ____result = new global::SharedData.NonEmpty1(); - ____result.MyProperty = __MyProperty__; reader.Depth--; return ____result; } @@ -3090,7 +3096,7 @@ public void Serialize(ref MessagePackWriter writer, global::SharedData.NonEmpty1 public sealed class SimpleIntKeyDataFormatter : global::MessagePack.Formatters.IMessagePackFormatter { - public void Serialize(ref MessagePackWriter writer, global::SharedData.SimpleIntKeyData value, global::MessagePack.MessagePackSerializerOptions options) + public void Serialize(ref global::MessagePack.MessagePackWriter writer, global::SharedData.SimpleIntKeyData value, global::MessagePack.MessagePackSerializerOptions options) { if (value == null) { @@ -3098,18 +3104,18 @@ public void Serialize(ref MessagePackWriter writer, global::SharedData.SimpleInt return; } - IFormatterResolver formatterResolver = options.Resolver; + global::MessagePack.IFormatterResolver formatterResolver = options.Resolver; writer.WriteArrayHeader(7); writer.Write(value.Prop1); - formatterResolver.GetFormatterWithVerify().Serialize(ref writer, value.Prop2, options); - formatterResolver.GetFormatterWithVerify().Serialize(ref writer, value.Prop3, options); - formatterResolver.GetFormatterWithVerify().Serialize(ref writer, value.Prop4, options); - formatterResolver.GetFormatterWithVerify().Serialize(ref writer, value.Prop5, options); - formatterResolver.GetFormatterWithVerify().Serialize(ref writer, value.Prop6, options); + global::MessagePack.FormatterResolverExtensions.GetFormatterWithVerify(formatterResolver).Serialize(ref writer, value.Prop2, options); + global::MessagePack.FormatterResolverExtensions.GetFormatterWithVerify(formatterResolver).Serialize(ref writer, value.Prop3, options); + global::MessagePack.FormatterResolverExtensions.GetFormatterWithVerify(formatterResolver).Serialize(ref writer, value.Prop4, options); + global::MessagePack.FormatterResolverExtensions.GetFormatterWithVerify(formatterResolver).Serialize(ref writer, value.Prop5, options); + global::MessagePack.FormatterResolverExtensions.GetFormatterWithVerify(formatterResolver).Serialize(ref writer, value.Prop6, options); writer.Write(value.BytesSpecial); } - public global::SharedData.SimpleIntKeyData Deserialize(ref MessagePackReader reader, global::MessagePack.MessagePackSerializerOptions options) + public global::SharedData.SimpleIntKeyData Deserialize(ref global::MessagePack.MessagePackReader reader, global::MessagePack.MessagePackSerializerOptions options) { if (reader.TryReadNil()) { @@ -3117,40 +3123,34 @@ public void Serialize(ref MessagePackWriter writer, global::SharedData.SimpleInt } options.Security.DepthStep(ref reader); - IFormatterResolver formatterResolver = options.Resolver; + global::MessagePack.IFormatterResolver formatterResolver = options.Resolver; var length = reader.ReadArrayHeader(); - var __Prop1__ = default(int); - var __Prop2__ = default(global::SharedData.ByteEnum); - var __Prop3__ = default(string); - var __Prop4__ = default(global::SharedData.SimpleStringKeyData); - var __Prop5__ = default(global::SharedData.SimpleStructIntKeyData); - var __Prop6__ = default(global::SharedData.SimpleStructStringKeyData); - var __BytesSpecial__ = default(byte[]); + var ____result = new global::SharedData.SimpleIntKeyData(); for (int i = 0; i < length; i++) { switch (i) { case 0: - __Prop1__ = reader.ReadInt32(); + ____result.Prop1 = reader.ReadInt32(); break; case 1: - __Prop2__ = formatterResolver.GetFormatterWithVerify().Deserialize(ref reader, options); + ____result.Prop2 = global::MessagePack.FormatterResolverExtensions.GetFormatterWithVerify(formatterResolver).Deserialize(ref reader, options); break; case 2: - __Prop3__ = formatterResolver.GetFormatterWithVerify().Deserialize(ref reader, options); + ____result.Prop3 = global::MessagePack.FormatterResolverExtensions.GetFormatterWithVerify(formatterResolver).Deserialize(ref reader, options); break; case 3: - __Prop4__ = formatterResolver.GetFormatterWithVerify().Deserialize(ref reader, options); + ____result.Prop4 = global::MessagePack.FormatterResolverExtensions.GetFormatterWithVerify(formatterResolver).Deserialize(ref reader, options); break; case 4: - __Prop5__ = formatterResolver.GetFormatterWithVerify().Deserialize(ref reader, options); + ____result.Prop5 = global::MessagePack.FormatterResolverExtensions.GetFormatterWithVerify(formatterResolver).Deserialize(ref reader, options); break; case 5: - __Prop6__ = formatterResolver.GetFormatterWithVerify().Deserialize(ref reader, options); + ____result.Prop6 = global::MessagePack.FormatterResolverExtensions.GetFormatterWithVerify(formatterResolver).Deserialize(ref reader, options); break; case 6: - __BytesSpecial__ = reader.ReadBytes()?.ToArray(); + ____result.BytesSpecial = global::MessagePack.Internal.CodeGenHelpers.GetArrayFromNullableSequence(reader.ReadBytes()); break; default: reader.Skip(); @@ -3158,14 +3158,6 @@ public void Serialize(ref MessagePackWriter writer, global::SharedData.SimpleInt } } - var ____result = new global::SharedData.SimpleIntKeyData(); - ____result.Prop1 = __Prop1__; - ____result.Prop2 = __Prop2__; - ____result.Prop3 = __Prop3__; - ____result.Prop4 = __Prop4__; - ____result.Prop5 = __Prop5__; - ____result.Prop6 = __Prop6__; - ____result.BytesSpecial = __BytesSpecial__; reader.Depth--; return ____result; } @@ -3174,7 +3166,7 @@ public void Serialize(ref MessagePackWriter writer, global::SharedData.SimpleInt public sealed class SimpleStructIntKeyDataFormatter : global::MessagePack.Formatters.IMessagePackFormatter { - public void Serialize(ref MessagePackWriter writer, global::SharedData.SimpleStructIntKeyData value, global::MessagePack.MessagePackSerializerOptions options) + public void Serialize(ref global::MessagePack.MessagePackWriter writer, global::SharedData.SimpleStructIntKeyData value, global::MessagePack.MessagePackSerializerOptions options) { writer.WriteArrayHeader(3); writer.Write(value.X); @@ -3182,31 +3174,29 @@ public void Serialize(ref MessagePackWriter writer, global::SharedData.SimpleStr writer.Write(value.BytesSpecial); } - public global::SharedData.SimpleStructIntKeyData Deserialize(ref MessagePackReader reader, global::MessagePack.MessagePackSerializerOptions options) + public global::SharedData.SimpleStructIntKeyData Deserialize(ref global::MessagePack.MessagePackReader reader, global::MessagePack.MessagePackSerializerOptions options) { if (reader.TryReadNil()) { - throw new InvalidOperationException("typecode is null, struct not supported"); + throw new global::System.InvalidOperationException("typecode is null, struct not supported"); } options.Security.DepthStep(ref reader); var length = reader.ReadArrayHeader(); - var __X__ = default(int); - var __Y__ = default(int); - var __BytesSpecial__ = default(byte[]); + var ____result = new global::SharedData.SimpleStructIntKeyData(); for (int i = 0; i < length; i++) { switch (i) { case 0: - __X__ = reader.ReadInt32(); + ____result.X = reader.ReadInt32(); break; case 1: - __Y__ = reader.ReadInt32(); + ____result.Y = reader.ReadInt32(); break; case 2: - __BytesSpecial__ = reader.ReadBytes()?.ToArray(); + ____result.BytesSpecial = global::MessagePack.Internal.CodeGenHelpers.GetArrayFromNullableSequence(reader.ReadBytes()); break; default: reader.Skip(); @@ -3214,10 +3204,6 @@ public void Serialize(ref MessagePackWriter writer, global::SharedData.SimpleStr } } - var ____result = new global::SharedData.SimpleStructIntKeyData(); - ____result.X = __X__; - ____result.Y = __Y__; - ____result.BytesSpecial = __BytesSpecial__; reader.Depth--; return ____result; } @@ -3226,7 +3212,7 @@ public void Serialize(ref MessagePackWriter writer, global::SharedData.SimpleStr public sealed class SubUnionType1Formatter : global::MessagePack.Formatters.IMessagePackFormatter { - public void Serialize(ref MessagePackWriter writer, global::SharedData.SubUnionType1 value, global::MessagePack.MessagePackSerializerOptions options) + public void Serialize(ref global::MessagePack.MessagePackWriter writer, global::SharedData.SubUnionType1 value, global::MessagePack.MessagePackSerializerOptions options) { if (value == null) { @@ -3239,7 +3225,7 @@ public void Serialize(ref MessagePackWriter writer, global::SharedData.SubUnionT writer.Write(value.MyProperty1); } - public global::SharedData.SubUnionType1 Deserialize(ref MessagePackReader reader, global::MessagePack.MessagePackSerializerOptions options) + public global::SharedData.SubUnionType1 Deserialize(ref global::MessagePack.MessagePackReader reader, global::MessagePack.MessagePackSerializerOptions options) { if (reader.TryReadNil()) { @@ -3248,18 +3234,17 @@ public void Serialize(ref MessagePackWriter writer, global::SharedData.SubUnionT options.Security.DepthStep(ref reader); var length = reader.ReadArrayHeader(); - var __MyProperty1__ = default(int); - var __MyProperty__ = default(int); + var ____result = new global::SharedData.SubUnionType1(); for (int i = 0; i < length; i++) { switch (i) { - case 1: - __MyProperty1__ = reader.ReadInt32(); - break; case 0: - __MyProperty__ = reader.ReadInt32(); + ____result.MyProperty = reader.ReadInt32(); + break; + case 1: + ____result.MyProperty1 = reader.ReadInt32(); break; default: reader.Skip(); @@ -3267,9 +3252,6 @@ public void Serialize(ref MessagePackWriter writer, global::SharedData.SubUnionT } } - var ____result = new global::SharedData.SubUnionType1(); - ____result.MyProperty1 = __MyProperty1__; - ____result.MyProperty = __MyProperty__; reader.Depth--; return ____result; } @@ -3278,7 +3260,7 @@ public void Serialize(ref MessagePackWriter writer, global::SharedData.SubUnionT public sealed class SubUnionType2Formatter : global::MessagePack.Formatters.IMessagePackFormatter { - public void Serialize(ref MessagePackWriter writer, global::SharedData.SubUnionType2 value, global::MessagePack.MessagePackSerializerOptions options) + public void Serialize(ref global::MessagePack.MessagePackWriter writer, global::SharedData.SubUnionType2 value, global::MessagePack.MessagePackSerializerOptions options) { if (value == null) { @@ -3291,7 +3273,7 @@ public void Serialize(ref MessagePackWriter writer, global::SharedData.SubUnionT writer.Write(value.MyProperty2); } - public global::SharedData.SubUnionType2 Deserialize(ref MessagePackReader reader, global::MessagePack.MessagePackSerializerOptions options) + public global::SharedData.SubUnionType2 Deserialize(ref global::MessagePack.MessagePackReader reader, global::MessagePack.MessagePackSerializerOptions options) { if (reader.TryReadNil()) { @@ -3300,18 +3282,17 @@ public void Serialize(ref MessagePackWriter writer, global::SharedData.SubUnionT options.Security.DepthStep(ref reader); var length = reader.ReadArrayHeader(); - var __MyProperty2__ = default(int); - var __MyProperty__ = default(int); + var ____result = new global::SharedData.SubUnionType2(); for (int i = 0; i < length; i++) { switch (i) { - case 1: - __MyProperty2__ = reader.ReadInt32(); - break; case 0: - __MyProperty__ = reader.ReadInt32(); + ____result.MyProperty = reader.ReadInt32(); + break; + case 1: + ____result.MyProperty2 = reader.ReadInt32(); break; default: reader.Skip(); @@ -3319,9 +3300,6 @@ public void Serialize(ref MessagePackWriter writer, global::SharedData.SubUnionT } } - var ____result = new global::SharedData.SubUnionType2(); - ____result.MyProperty2 = __MyProperty2__; - ____result.MyProperty = __MyProperty__; reader.Depth--; return ____result; } @@ -3330,7 +3308,7 @@ public void Serialize(ref MessagePackWriter writer, global::SharedData.SubUnionT public sealed class UnVersionBlockTestFormatter : global::MessagePack.Formatters.IMessagePackFormatter { - public void Serialize(ref MessagePackWriter writer, global::SharedData.UnVersionBlockTest value, global::MessagePack.MessagePackSerializerOptions options) + public void Serialize(ref global::MessagePack.MessagePackWriter writer, global::SharedData.UnVersionBlockTest value, global::MessagePack.MessagePackSerializerOptions options) { if (value == null) { @@ -3344,7 +3322,7 @@ public void Serialize(ref MessagePackWriter writer, global::SharedData.UnVersion writer.Write(value.MyProperty2); } - public global::SharedData.UnVersionBlockTest Deserialize(ref MessagePackReader reader, global::MessagePack.MessagePackSerializerOptions options) + public global::SharedData.UnVersionBlockTest Deserialize(ref global::MessagePack.MessagePackReader reader, global::MessagePack.MessagePackSerializerOptions options) { if (reader.TryReadNil()) { @@ -3353,18 +3331,17 @@ public void Serialize(ref MessagePackWriter writer, global::SharedData.UnVersion options.Security.DepthStep(ref reader); var length = reader.ReadArrayHeader(); - var __MyProperty__ = default(int); - var __MyProperty2__ = default(int); + var ____result = new global::SharedData.UnVersionBlockTest(); for (int i = 0; i < length; i++) { switch (i) { case 0: - __MyProperty__ = reader.ReadInt32(); + ____result.MyProperty = reader.ReadInt32(); break; case 2: - __MyProperty2__ = reader.ReadInt32(); + ____result.MyProperty2 = reader.ReadInt32(); break; default: reader.Skip(); @@ -3372,9 +3349,6 @@ public void Serialize(ref MessagePackWriter writer, global::SharedData.UnVersion } } - var ____result = new global::SharedData.UnVersionBlockTest(); - ____result.MyProperty = __MyProperty__; - ____result.MyProperty2 = __MyProperty2__; reader.Depth--; return ____result; } @@ -3383,18 +3357,18 @@ public void Serialize(ref MessagePackWriter writer, global::SharedData.UnVersion public sealed class Vector2Formatter : global::MessagePack.Formatters.IMessagePackFormatter { - public void Serialize(ref MessagePackWriter writer, global::SharedData.Vector2 value, global::MessagePack.MessagePackSerializerOptions options) + public void Serialize(ref global::MessagePack.MessagePackWriter writer, global::SharedData.Vector2 value, global::MessagePack.MessagePackSerializerOptions options) { writer.WriteArrayHeader(2); writer.Write(value.X); writer.Write(value.Y); } - public global::SharedData.Vector2 Deserialize(ref MessagePackReader reader, global::MessagePack.MessagePackSerializerOptions options) + public global::SharedData.Vector2 Deserialize(ref global::MessagePack.MessagePackReader reader, global::MessagePack.MessagePackSerializerOptions options) { if (reader.TryReadNil()) { - throw new InvalidOperationException("typecode is null, struct not supported"); + throw new global::System.InvalidOperationException("typecode is null, struct not supported"); } options.Security.DepthStep(ref reader); @@ -3427,7 +3401,7 @@ public void Serialize(ref MessagePackWriter writer, global::SharedData.Vector2 v public sealed class Vector3LikeFormatter : global::MessagePack.Formatters.IMessagePackFormatter { - public void Serialize(ref MessagePackWriter writer, global::SharedData.Vector3Like value, global::MessagePack.MessagePackSerializerOptions options) + public void Serialize(ref global::MessagePack.MessagePackWriter writer, global::SharedData.Vector3Like value, global::MessagePack.MessagePackSerializerOptions options) { writer.WriteArrayHeader(3); writer.Write(value.x); @@ -3435,11 +3409,11 @@ public void Serialize(ref MessagePackWriter writer, global::SharedData.Vector3Li writer.Write(value.z); } - public global::SharedData.Vector3Like Deserialize(ref MessagePackReader reader, global::MessagePack.MessagePackSerializerOptions options) + public global::SharedData.Vector3Like Deserialize(ref global::MessagePack.MessagePackReader reader, global::MessagePack.MessagePackSerializerOptions options) { if (reader.TryReadNil()) { - throw new InvalidOperationException("typecode is null, struct not supported"); + throw new global::System.InvalidOperationException("typecode is null, struct not supported"); } options.Security.DepthStep(ref reader); @@ -3468,9 +3442,6 @@ public void Serialize(ref MessagePackWriter writer, global::SharedData.Vector3Li } var ____result = new global::SharedData.Vector3Like(__x__, __y__, __z__); - ____result.x = __x__; - ____result.y = __y__; - ____result.z = __z__; reader.Depth--; return ____result; } @@ -3479,18 +3450,18 @@ public void Serialize(ref MessagePackWriter writer, global::SharedData.Vector3Li public sealed class VectorLike2Formatter : global::MessagePack.Formatters.IMessagePackFormatter { - public void Serialize(ref MessagePackWriter writer, global::SharedData.VectorLike2 value, global::MessagePack.MessagePackSerializerOptions options) + public void Serialize(ref global::MessagePack.MessagePackWriter writer, global::SharedData.VectorLike2 value, global::MessagePack.MessagePackSerializerOptions options) { writer.WriteArrayHeader(2); writer.Write(value.x); writer.Write(value.y); } - public global::SharedData.VectorLike2 Deserialize(ref MessagePackReader reader, global::MessagePack.MessagePackSerializerOptions options) + public global::SharedData.VectorLike2 Deserialize(ref global::MessagePack.MessagePackReader reader, global::MessagePack.MessagePackSerializerOptions options) { if (reader.TryReadNil()) { - throw new InvalidOperationException("typecode is null, struct not supported"); + throw new global::System.InvalidOperationException("typecode is null, struct not supported"); } options.Security.DepthStep(ref reader); @@ -3515,8 +3486,6 @@ public void Serialize(ref MessagePackWriter writer, global::SharedData.VectorLik } var ____result = new global::SharedData.VectorLike2(__x__, __y__); - ____result.x = __x__; - ____result.y = __y__; reader.Depth--; return ____result; } @@ -3525,7 +3494,7 @@ public void Serialize(ref MessagePackWriter writer, global::SharedData.VectorLik public sealed class Version0Formatter : global::MessagePack.Formatters.IMessagePackFormatter { - public void Serialize(ref MessagePackWriter writer, global::SharedData.Version0 value, global::MessagePack.MessagePackSerializerOptions options) + public void Serialize(ref global::MessagePack.MessagePackWriter writer, global::SharedData.Version0 value, global::MessagePack.MessagePackSerializerOptions options) { if (value == null) { @@ -3540,7 +3509,7 @@ public void Serialize(ref MessagePackWriter writer, global::SharedData.Version0 writer.Write(value.MyProperty1); } - public global::SharedData.Version0 Deserialize(ref MessagePackReader reader, global::MessagePack.MessagePackSerializerOptions options) + public global::SharedData.Version0 Deserialize(ref global::MessagePack.MessagePackReader reader, global::MessagePack.MessagePackSerializerOptions options) { if (reader.TryReadNil()) { @@ -3549,14 +3518,14 @@ public void Serialize(ref MessagePackWriter writer, global::SharedData.Version0 options.Security.DepthStep(ref reader); var length = reader.ReadArrayHeader(); - var __MyProperty1__ = default(int); + var ____result = new global::SharedData.Version0(); for (int i = 0; i < length; i++) { switch (i) { case 3: - __MyProperty1__ = reader.ReadInt32(); + ____result.MyProperty1 = reader.ReadInt32(); break; default: reader.Skip(); @@ -3564,8 +3533,6 @@ public void Serialize(ref MessagePackWriter writer, global::SharedData.Version0 } } - var ____result = new global::SharedData.Version0(); - ____result.MyProperty1 = __MyProperty1__; reader.Depth--; return ____result; } @@ -3574,7 +3541,7 @@ public void Serialize(ref MessagePackWriter writer, global::SharedData.Version0 public sealed class Version1Formatter : global::MessagePack.Formatters.IMessagePackFormatter { - public void Serialize(ref MessagePackWriter writer, global::SharedData.Version1 value, global::MessagePack.MessagePackSerializerOptions options) + public void Serialize(ref global::MessagePack.MessagePackWriter writer, global::SharedData.Version1 value, global::MessagePack.MessagePackSerializerOptions options) { if (value == null) { @@ -3591,7 +3558,7 @@ public void Serialize(ref MessagePackWriter writer, global::SharedData.Version1 writer.Write(value.MyProperty3); } - public global::SharedData.Version1 Deserialize(ref MessagePackReader reader, global::MessagePack.MessagePackSerializerOptions options) + public global::SharedData.Version1 Deserialize(ref global::MessagePack.MessagePackReader reader, global::MessagePack.MessagePackSerializerOptions options) { if (reader.TryReadNil()) { @@ -3600,22 +3567,20 @@ public void Serialize(ref MessagePackWriter writer, global::SharedData.Version1 options.Security.DepthStep(ref reader); var length = reader.ReadArrayHeader(); - var __MyProperty1__ = default(int); - var __MyProperty2__ = default(int); - var __MyProperty3__ = default(int); + var ____result = new global::SharedData.Version1(); for (int i = 0; i < length; i++) { switch (i) { case 3: - __MyProperty1__ = reader.ReadInt32(); + ____result.MyProperty1 = reader.ReadInt32(); break; case 4: - __MyProperty2__ = reader.ReadInt32(); + ____result.MyProperty2 = reader.ReadInt32(); break; case 5: - __MyProperty3__ = reader.ReadInt32(); + ____result.MyProperty3 = reader.ReadInt32(); break; default: reader.Skip(); @@ -3623,10 +3588,6 @@ public void Serialize(ref MessagePackWriter writer, global::SharedData.Version1 } } - var ____result = new global::SharedData.Version1(); - ____result.MyProperty1 = __MyProperty1__; - ____result.MyProperty2 = __MyProperty2__; - ____result.MyProperty3 = __MyProperty3__; reader.Depth--; return ____result; } @@ -3635,7 +3596,7 @@ public void Serialize(ref MessagePackWriter writer, global::SharedData.Version1 public sealed class Version2Formatter : global::MessagePack.Formatters.IMessagePackFormatter { - public void Serialize(ref MessagePackWriter writer, global::SharedData.Version2 value, global::MessagePack.MessagePackSerializerOptions options) + public void Serialize(ref global::MessagePack.MessagePackWriter writer, global::SharedData.Version2 value, global::MessagePack.MessagePackSerializerOptions options) { if (value == null) { @@ -3654,7 +3615,7 @@ public void Serialize(ref MessagePackWriter writer, global::SharedData.Version2 writer.Write(value.MyProperty5); } - public global::SharedData.Version2 Deserialize(ref MessagePackReader reader, global::MessagePack.MessagePackSerializerOptions options) + public global::SharedData.Version2 Deserialize(ref global::MessagePack.MessagePackReader reader, global::MessagePack.MessagePackSerializerOptions options) { if (reader.TryReadNil()) { @@ -3663,26 +3624,23 @@ public void Serialize(ref MessagePackWriter writer, global::SharedData.Version2 options.Security.DepthStep(ref reader); var length = reader.ReadArrayHeader(); - var __MyProperty1__ = default(int); - var __MyProperty2__ = default(int); - var __MyProperty3__ = default(int); - var __MyProperty5__ = default(int); + var ____result = new global::SharedData.Version2(); for (int i = 0; i < length; i++) { switch (i) { case 3: - __MyProperty1__ = reader.ReadInt32(); + ____result.MyProperty1 = reader.ReadInt32(); break; case 4: - __MyProperty2__ = reader.ReadInt32(); + ____result.MyProperty2 = reader.ReadInt32(); break; case 5: - __MyProperty3__ = reader.ReadInt32(); + ____result.MyProperty3 = reader.ReadInt32(); break; case 7: - __MyProperty5__ = reader.ReadInt32(); + ____result.MyProperty5 = reader.ReadInt32(); break; default: reader.Skip(); @@ -3690,11 +3648,6 @@ public void Serialize(ref MessagePackWriter writer, global::SharedData.Version2 } } - var ____result = new global::SharedData.Version2(); - ____result.MyProperty1 = __MyProperty1__; - ____result.MyProperty2 = __MyProperty2__; - ____result.MyProperty3 = __MyProperty3__; - ____result.MyProperty5 = __MyProperty5__; reader.Depth--; return ____result; } @@ -3703,7 +3656,7 @@ public void Serialize(ref MessagePackWriter writer, global::SharedData.Version2 public sealed class VersionBlockTestFormatter : global::MessagePack.Formatters.IMessagePackFormatter { - public void Serialize(ref MessagePackWriter writer, global::SharedData.VersionBlockTest value, global::MessagePack.MessagePackSerializerOptions options) + public void Serialize(ref global::MessagePack.MessagePackWriter writer, global::SharedData.VersionBlockTest value, global::MessagePack.MessagePackSerializerOptions options) { if (value == null) { @@ -3711,14 +3664,14 @@ public void Serialize(ref MessagePackWriter writer, global::SharedData.VersionBl return; } - IFormatterResolver formatterResolver = options.Resolver; + global::MessagePack.IFormatterResolver formatterResolver = options.Resolver; writer.WriteArrayHeader(3); writer.Write(value.MyProperty); - formatterResolver.GetFormatterWithVerify().Serialize(ref writer, value.UnknownBlock, options); + global::MessagePack.FormatterResolverExtensions.GetFormatterWithVerify(formatterResolver).Serialize(ref writer, value.UnknownBlock, options); writer.Write(value.MyProperty2); } - public global::SharedData.VersionBlockTest Deserialize(ref MessagePackReader reader, global::MessagePack.MessagePackSerializerOptions options) + public global::SharedData.VersionBlockTest Deserialize(ref global::MessagePack.MessagePackReader reader, global::MessagePack.MessagePackSerializerOptions options) { if (reader.TryReadNil()) { @@ -3726,24 +3679,22 @@ public void Serialize(ref MessagePackWriter writer, global::SharedData.VersionBl } options.Security.DepthStep(ref reader); - IFormatterResolver formatterResolver = options.Resolver; + global::MessagePack.IFormatterResolver formatterResolver = options.Resolver; var length = reader.ReadArrayHeader(); - var __MyProperty__ = default(int); - var __UnknownBlock__ = default(global::SharedData.MyClass); - var __MyProperty2__ = default(int); + var ____result = new global::SharedData.VersionBlockTest(); for (int i = 0; i < length; i++) { switch (i) { case 0: - __MyProperty__ = reader.ReadInt32(); + ____result.MyProperty = reader.ReadInt32(); break; case 1: - __UnknownBlock__ = formatterResolver.GetFormatterWithVerify().Deserialize(ref reader, options); + ____result.UnknownBlock = global::MessagePack.FormatterResolverExtensions.GetFormatterWithVerify(formatterResolver).Deserialize(ref reader, options); break; case 2: - __MyProperty2__ = reader.ReadInt32(); + ____result.MyProperty2 = reader.ReadInt32(); break; default: reader.Skip(); @@ -3751,10 +3702,6 @@ public void Serialize(ref MessagePackWriter writer, global::SharedData.VersionBl } } - var ____result = new global::SharedData.VersionBlockTest(); - ____result.MyProperty = __MyProperty__; - ____result.UnknownBlock = __UnknownBlock__; - ____result.MyProperty2 = __MyProperty2__; reader.Depth--; return ____result; } @@ -3763,7 +3710,7 @@ public void Serialize(ref MessagePackWriter writer, global::SharedData.VersionBl public sealed class VersioningUnionFormatter : global::MessagePack.Formatters.IMessagePackFormatter { - public void Serialize(ref MessagePackWriter writer, global::SharedData.VersioningUnion value, global::MessagePack.MessagePackSerializerOptions options) + public void Serialize(ref global::MessagePack.MessagePackWriter writer, global::SharedData.VersioningUnion value, global::MessagePack.MessagePackSerializerOptions options) { if (value == null) { @@ -3782,7 +3729,7 @@ public void Serialize(ref MessagePackWriter writer, global::SharedData.Versionin writer.Write(value.FV); } - public global::SharedData.VersioningUnion Deserialize(ref MessagePackReader reader, global::MessagePack.MessagePackSerializerOptions options) + public global::SharedData.VersioningUnion Deserialize(ref global::MessagePack.MessagePackReader reader, global::MessagePack.MessagePackSerializerOptions options) { if (reader.TryReadNil()) { @@ -3791,14 +3738,14 @@ public void Serialize(ref MessagePackWriter writer, global::SharedData.Versionin options.Security.DepthStep(ref reader); var length = reader.ReadArrayHeader(); - var __FV__ = default(int); + var ____result = new global::SharedData.VersioningUnion(); for (int i = 0; i < length; i++) { switch (i) { case 7: - __FV__ = reader.ReadInt32(); + ____result.FV = reader.ReadInt32(); break; default: reader.Skip(); @@ -3806,8 +3753,6 @@ public void Serialize(ref MessagePackWriter writer, global::SharedData.Versionin } } - var ____result = new global::SharedData.VersioningUnion(); - ____result.FV = __FV__; reader.Depth--; return ____result; } @@ -3816,7 +3761,7 @@ public void Serialize(ref MessagePackWriter writer, global::SharedData.Versionin public sealed class WithIndexerFormatter : global::MessagePack.Formatters.IMessagePackFormatter { - public void Serialize(ref MessagePackWriter writer, global::SharedData.WithIndexer value, global::MessagePack.MessagePackSerializerOptions options) + public void Serialize(ref global::MessagePack.MessagePackWriter writer, global::SharedData.WithIndexer value, global::MessagePack.MessagePackSerializerOptions options) { if (value == null) { @@ -3824,13 +3769,13 @@ public void Serialize(ref MessagePackWriter writer, global::SharedData.WithIndex return; } - IFormatterResolver formatterResolver = options.Resolver; + global::MessagePack.IFormatterResolver formatterResolver = options.Resolver; writer.WriteArrayHeader(2); writer.Write(value.Data1); - formatterResolver.GetFormatterWithVerify().Serialize(ref writer, value.Data2, options); + global::MessagePack.FormatterResolverExtensions.GetFormatterWithVerify(formatterResolver).Serialize(ref writer, value.Data2, options); } - public global::SharedData.WithIndexer Deserialize(ref MessagePackReader reader, global::MessagePack.MessagePackSerializerOptions options) + public global::SharedData.WithIndexer Deserialize(ref global::MessagePack.MessagePackReader reader, global::MessagePack.MessagePackSerializerOptions options) { if (reader.TryReadNil()) { @@ -3838,20 +3783,19 @@ public void Serialize(ref MessagePackWriter writer, global::SharedData.WithIndex } options.Security.DepthStep(ref reader); - IFormatterResolver formatterResolver = options.Resolver; + global::MessagePack.IFormatterResolver formatterResolver = options.Resolver; var length = reader.ReadArrayHeader(); - var __Data1__ = default(int); - var __Data2__ = default(string); + var ____result = new global::SharedData.WithIndexer(); for (int i = 0; i < length; i++) { switch (i) { case 0: - __Data1__ = reader.ReadInt32(); + ____result.Data1 = reader.ReadInt32(); break; case 1: - __Data2__ = formatterResolver.GetFormatterWithVerify().Deserialize(ref reader, options); + ____result.Data2 = global::MessagePack.FormatterResolverExtensions.GetFormatterWithVerify(formatterResolver).Deserialize(ref reader, options); break; default: reader.Skip(); @@ -3859,13 +3803,11 @@ public void Serialize(ref MessagePackWriter writer, global::SharedData.WithIndex } } - var ____result = new global::SharedData.WithIndexer(); - ____result.Data1 = __Data1__; - ____result.Data2 = __Data2__; reader.Depth--; return ____result; } } + } #pragma warning restore 168 @@ -3874,7 +3816,6 @@ public void Serialize(ref MessagePackWriter writer, global::SharedData.WithIndex #pragma warning restore 612 #pragma warning restore SA1129 // Do not use default value type constructor -#pragma warning restore SA1200 // Using directives should be placed correctly #pragma warning restore SA1309 // Field names should not begin with underscore #pragma warning restore SA1312 // Variable names should begin with lower-case letter #pragma warning restore SA1403 // File may only contain a single namespace @@ -3888,9 +3829,9 @@ public void Serialize(ref MessagePackWriter writer, global::SharedData.WithIndex #pragma warning disable 612 #pragma warning disable 414 #pragma warning disable 168 +#pragma warning disable CS1591 // document public APIs #pragma warning disable SA1129 // Do not use default value type constructor -#pragma warning disable SA1200 // Using directives should be placed correctly #pragma warning disable SA1309 // Field names should not begin with underscore #pragma warning disable SA1312 // Variable names should begin with lower-case letter #pragma warning disable SA1403 // File may only contain a single namespace @@ -3898,11 +3839,6 @@ public void Serialize(ref MessagePackWriter writer, global::SharedData.WithIndex namespace MessagePack.Formatters.SharedData { - using System; - using System.Buffers; - using System.Runtime.InteropServices; - using MessagePack; - public sealed class Callback2Formatter : global::MessagePack.Formatters.IMessagePackFormatter { // X @@ -3929,7 +3865,7 @@ public void Serialize(ref global::MessagePack.MessagePackWriter writer, global:: for (int i = 0; i < length; i++) { - ReadOnlySpan stringKey = global::MessagePack.Internal.CodeGenHelpers.ReadStringSpan(ref reader); + var stringKey = global::MessagePack.Internal.CodeGenHelpers.ReadStringSpan(ref reader); switch (stringKey.Length) { default: @@ -3945,11 +3881,7 @@ public void Serialize(ref global::MessagePack.MessagePackWriter writer, global:: } } - var ____result = new global::SharedData.Callback2(__X__) - { - X = __X__, - }; - + var ____result = new global::SharedData.Callback2(__X__); ____result.OnAfterDeserialize(); reader.Depth--; return ____result; @@ -3982,7 +3914,7 @@ public void Serialize(ref global::MessagePack.MessagePackWriter writer, global:: for (int i = 0; i < length; i++) { - ReadOnlySpan stringKey = global::MessagePack.Internal.CodeGenHelpers.ReadStringSpan(ref reader); + var stringKey = global::MessagePack.Internal.CodeGenHelpers.ReadStringSpan(ref reader); switch (stringKey.Length) { default: @@ -3998,20 +3930,213 @@ public void Serialize(ref global::MessagePack.MessagePackWriter writer, global:: } } - var ____result = new global::SharedData.Callback2_2(__X__) + var ____result = new global::SharedData.Callback2_2(__X__); + ((global::MessagePack.IMessagePackSerializationCallbackReceiver)____result).OnAfterDeserialize(); + reader.Depth--; + return ____result; + } + } + + public sealed class DefaultValueStringKeyClassWithExplicitConstructorFormatter : global::MessagePack.Formatters.IMessagePackFormatter + { + // Prop1 + private static global::System.ReadOnlySpan GetSpan_Prop1() => new byte[1 + 5] { 165, 80, 114, 111, 112, 49 }; + // Prop2 + private static global::System.ReadOnlySpan GetSpan_Prop2() => new byte[1 + 5] { 165, 80, 114, 111, 112, 50 }; + + public void Serialize(ref global::MessagePack.MessagePackWriter writer, global::SharedData.DefaultValueStringKeyClassWithExplicitConstructor value, global::MessagePack.MessagePackSerializerOptions options) + { + if (value is null) { - X = __X__, - }; + writer.WriteNil(); + return; + } + + writer.WriteMapHeader(2); + writer.WriteRaw(GetSpan_Prop1()); + writer.Write(value.Prop1); + writer.WriteRaw(GetSpan_Prop2()); + writer.Write(value.Prop2); + } + + public global::SharedData.DefaultValueStringKeyClassWithExplicitConstructor Deserialize(ref global::MessagePack.MessagePackReader reader, global::MessagePack.MessagePackSerializerOptions options) + { + if (reader.TryReadNil()) + { + return null; + } + + options.Security.DepthStep(ref reader); + var length = reader.ReadMapHeader(); + var __Prop1__ = default(int); + var __Prop2__IsInitialized = false; + var __Prop2__ = default(int); + + for (int i = 0; i < length; i++) + { + var stringKey = global::MessagePack.Internal.CodeGenHelpers.ReadStringSpan(ref reader); + switch (stringKey.Length) + { + default: + FAIL: + reader.Skip(); + continue; + case 5: + switch (global::MessagePack.Internal.AutomataKeyGen.GetKey(ref stringKey)) + { + default: goto FAIL; + case 212339749456UL: + __Prop1__ = reader.ReadInt32(); + continue; + case 216634716752UL: + __Prop2__IsInitialized = true; + __Prop2__ = reader.ReadInt32(); + continue; + } + + } + } + + var ____result = new global::SharedData.DefaultValueStringKeyClassWithExplicitConstructor(__Prop1__); + if (__Prop2__IsInitialized) + { + ____result.Prop2 = __Prop2__; + } - ((global::MessagePack.IMessagePackSerializationCallbackReceiver)____result).OnAfterDeserialize(); reader.Depth--; return ____result; } } - public sealed class Empty2Formatter : global::MessagePack.Formatters.IMessagePackFormatter + public sealed class DefaultValueStringKeyClassWithoutExplicitConstructorFormatter : global::MessagePack.Formatters.IMessagePackFormatter { + // Prop1 + private static global::System.ReadOnlySpan GetSpan_Prop1() => new byte[1 + 5] { 165, 80, 114, 111, 112, 49 }; + // Prop2 + private static global::System.ReadOnlySpan GetSpan_Prop2() => new byte[1 + 5] { 165, 80, 114, 111, 112, 50 }; + + public void Serialize(ref global::MessagePack.MessagePackWriter writer, global::SharedData.DefaultValueStringKeyClassWithoutExplicitConstructor value, global::MessagePack.MessagePackSerializerOptions options) + { + if (value is null) + { + writer.WriteNil(); + return; + } + + writer.WriteMapHeader(2); + writer.WriteRaw(GetSpan_Prop1()); + writer.Write(value.Prop1); + writer.WriteRaw(GetSpan_Prop2()); + writer.Write(value.Prop2); + } + + public global::SharedData.DefaultValueStringKeyClassWithoutExplicitConstructor Deserialize(ref global::MessagePack.MessagePackReader reader, global::MessagePack.MessagePackSerializerOptions options) + { + if (reader.TryReadNil()) + { + return null; + } + + options.Security.DepthStep(ref reader); + var length = reader.ReadMapHeader(); + var ____result = new global::SharedData.DefaultValueStringKeyClassWithoutExplicitConstructor(); + + for (int i = 0; i < length; i++) + { + var stringKey = global::MessagePack.Internal.CodeGenHelpers.ReadStringSpan(ref reader); + switch (stringKey.Length) + { + default: + FAIL: + reader.Skip(); + continue; + case 5: + switch (global::MessagePack.Internal.AutomataKeyGen.GetKey(ref stringKey)) + { + default: goto FAIL; + case 212339749456UL: + ____result.Prop1 = reader.ReadInt32(); + continue; + case 216634716752UL: + ____result.Prop2 = reader.ReadInt32(); + continue; + } + + } + } + reader.Depth--; + return ____result; + } + } + + public sealed class DefaultValueStringKeyStructWithExplicitConstructorFormatter : global::MessagePack.Formatters.IMessagePackFormatter + { + // Prop1 + private static global::System.ReadOnlySpan GetSpan_Prop1() => new byte[1 + 5] { 165, 80, 114, 111, 112, 49 }; + // Prop2 + private static global::System.ReadOnlySpan GetSpan_Prop2() => new byte[1 + 5] { 165, 80, 114, 111, 112, 50 }; + + public void Serialize(ref global::MessagePack.MessagePackWriter writer, global::SharedData.DefaultValueStringKeyStructWithExplicitConstructor value, global::MessagePack.MessagePackSerializerOptions options) + { + writer.WriteMapHeader(2); + writer.WriteRaw(GetSpan_Prop1()); + writer.Write(value.Prop1); + writer.WriteRaw(GetSpan_Prop2()); + writer.Write(value.Prop2); + } + + public global::SharedData.DefaultValueStringKeyStructWithExplicitConstructor Deserialize(ref global::MessagePack.MessagePackReader reader, global::MessagePack.MessagePackSerializerOptions options) + { + if (reader.TryReadNil()) + { + throw new global::System.InvalidOperationException("typecode is null, struct not supported"); + } + + options.Security.DepthStep(ref reader); + var length = reader.ReadMapHeader(); + var __Prop1__ = default(int); + var __Prop2__IsInitialized = false; + var __Prop2__ = default(int); + + for (int i = 0; i < length; i++) + { + var stringKey = global::MessagePack.Internal.CodeGenHelpers.ReadStringSpan(ref reader); + switch (stringKey.Length) + { + default: + FAIL: + reader.Skip(); + continue; + case 5: + switch (global::MessagePack.Internal.AutomataKeyGen.GetKey(ref stringKey)) + { + default: goto FAIL; + case 212339749456UL: + __Prop1__ = reader.ReadInt32(); + continue; + case 216634716752UL: + __Prop2__IsInitialized = true; + __Prop2__ = reader.ReadInt32(); + continue; + } + + } + } + + var ____result = new global::SharedData.DefaultValueStringKeyStructWithExplicitConstructor(__Prop1__); + if (__Prop2__IsInitialized) + { + ____result.Prop2 = __Prop2__; + } + + reader.Depth--; + return ____result; + } + } + + public sealed class Empty2Formatter : global::MessagePack.Formatters.IMessagePackFormatter + { public void Serialize(ref global::MessagePack.MessagePackWriter writer, global::SharedData.Empty2 value, global::MessagePack.MessagePackSerializerOptions options) { if (value is null) @@ -4053,12 +4178,12 @@ public void Serialize(ref global::MessagePack.MessagePackWriter writer, global:: return; } - IFormatterResolver formatterResolver = options.Resolver; + var formatterResolver = options.Resolver; writer.WriteMapHeader(2); writer.WriteRaw(GetSpan_MyProperty0()); - formatterResolver.GetFormatterWithVerify().Serialize(ref writer, value.MyProperty0, options); + global::MessagePack.FormatterResolverExtensions.GetFormatterWithVerify(formatterResolver).Serialize(ref writer, value.MyProperty0, options); writer.WriteRaw(GetSpan_Comparer()); - formatterResolver.GetFormatterWithVerify().Serialize(ref writer, value.Comparer, options); + global::MessagePack.FormatterResolverExtensions.GetFormatterWithVerify(formatterResolver).Serialize(ref writer, value.Comparer, options); } public global::SharedData.GenericConstrainedClassStringKey Deserialize(ref global::MessagePack.MessagePackReader reader, global::MessagePack.MessagePackSerializerOptions options) @@ -4069,14 +4194,13 @@ public void Serialize(ref global::MessagePack.MessagePackWriter writer, global:: } options.Security.DepthStep(ref reader); - IFormatterResolver formatterResolver = options.Resolver; + var formatterResolver = options.Resolver; var length = reader.ReadMapHeader(); - var __MyProperty0__ = default(T1); - var __Comparer__ = default(T2); + var ____result = new global::SharedData.GenericConstrainedClassStringKey(); for (int i = 0; i < length; i++) { - ReadOnlySpan stringKey = global::MessagePack.Internal.CodeGenHelpers.ReadStringSpan(ref reader); + var stringKey = global::MessagePack.Internal.CodeGenHelpers.ReadStringSpan(ref reader); switch (stringKey.Length) { default: @@ -4086,23 +4210,17 @@ public void Serialize(ref global::MessagePack.MessagePackWriter writer, global:: case 11: if (!global::System.MemoryExtensions.SequenceEqual(stringKey, GetSpan_MyProperty0().Slice(1))) { goto FAIL; } - __MyProperty0__ = formatterResolver.GetFormatterWithVerify().Deserialize(ref reader, options); + ____result.MyProperty0 = global::MessagePack.FormatterResolverExtensions.GetFormatterWithVerify(formatterResolver).Deserialize(ref reader, options); continue; case 8: if (global::MessagePack.Internal.AutomataKeyGen.GetKey(ref stringKey) != 8243120455795175235UL) { goto FAIL; } - __Comparer__ = formatterResolver.GetFormatterWithVerify().Deserialize(ref reader, options); + ____result.Comparer = global::MessagePack.FormatterResolverExtensions.GetFormatterWithVerify(formatterResolver).Deserialize(ref reader, options); continue; } } - var ____result = new global::SharedData.GenericConstrainedClassStringKey() - { - MyProperty0 = __MyProperty0__, - Comparer = __Comparer__, - }; - reader.Depth--; return ____result; } @@ -4119,12 +4237,12 @@ public sealed class GenericConstrainedStructStringKeyFormatter : global: public void Serialize(ref global::MessagePack.MessagePackWriter writer, global::SharedData.GenericConstrainedStructStringKey value, global::MessagePack.MessagePackSerializerOptions options) { - IFormatterResolver formatterResolver = options.Resolver; + var formatterResolver = options.Resolver; writer.WriteMapHeader(2); writer.WriteRaw(GetSpan_MyProperty0()); - formatterResolver.GetFormatterWithVerify().Serialize(ref writer, value.MyProperty0, options); + global::MessagePack.FormatterResolverExtensions.GetFormatterWithVerify(formatterResolver).Serialize(ref writer, value.MyProperty0, options); writer.WriteRaw(GetSpan_Comparer()); - formatterResolver.GetFormatterWithVerify().Serialize(ref writer, value.Comparer, options); + global::MessagePack.FormatterResolverExtensions.GetFormatterWithVerify(formatterResolver).Serialize(ref writer, value.Comparer, options); } public global::SharedData.GenericConstrainedStructStringKey Deserialize(ref global::MessagePack.MessagePackReader reader, global::MessagePack.MessagePackSerializerOptions options) @@ -4135,14 +4253,13 @@ public void Serialize(ref global::MessagePack.MessagePackWriter writer, global:: } options.Security.DepthStep(ref reader); - IFormatterResolver formatterResolver = options.Resolver; + var formatterResolver = options.Resolver; var length = reader.ReadMapHeader(); - var __MyProperty0__ = default(T1); - var __Comparer__ = default(T2); + var ____result = new global::SharedData.GenericConstrainedStructStringKey(); for (int i = 0; i < length; i++) { - ReadOnlySpan stringKey = global::MessagePack.Internal.CodeGenHelpers.ReadStringSpan(ref reader); + var stringKey = global::MessagePack.Internal.CodeGenHelpers.ReadStringSpan(ref reader); switch (stringKey.Length) { default: @@ -4152,23 +4269,17 @@ public void Serialize(ref global::MessagePack.MessagePackWriter writer, global:: case 11: if (!global::System.MemoryExtensions.SequenceEqual(stringKey, GetSpan_MyProperty0().Slice(1))) { goto FAIL; } - __MyProperty0__ = formatterResolver.GetFormatterWithVerify().Deserialize(ref reader, options); + ____result.MyProperty0 = global::MessagePack.FormatterResolverExtensions.GetFormatterWithVerify(formatterResolver).Deserialize(ref reader, options); continue; case 8: if (global::MessagePack.Internal.AutomataKeyGen.GetKey(ref stringKey) != 8243120455795175235UL) { goto FAIL; } - __Comparer__ = formatterResolver.GetFormatterWithVerify().Deserialize(ref reader, options); + ____result.Comparer = global::MessagePack.FormatterResolverExtensions.GetFormatterWithVerify(formatterResolver).Deserialize(ref reader, options); continue; } } - var ____result = new global::SharedData.GenericConstrainedStructStringKey() - { - MyProperty0 = __MyProperty0__, - Comparer = __Comparer__, - }; - reader.Depth--; return ____result; } @@ -4201,11 +4312,11 @@ public void Serialize(ref global::MessagePack.MessagePackWriter writer, global:: options.Security.DepthStep(ref reader); var length = reader.ReadMapHeader(); - var __MyProperty__ = default(int); + var ____result = new global::SharedData.NonEmpty2(); for (int i = 0; i < length; i++) { - ReadOnlySpan stringKey = global::MessagePack.Internal.CodeGenHelpers.ReadStringSpan(ref reader); + var stringKey = global::MessagePack.Internal.CodeGenHelpers.ReadStringSpan(ref reader); switch (stringKey.Length) { default: @@ -4215,17 +4326,12 @@ public void Serialize(ref global::MessagePack.MessagePackWriter writer, global:: case 10: if (!global::System.MemoryExtensions.SequenceEqual(stringKey, GetSpan_MyProperty().Slice(1))) { goto FAIL; } - __MyProperty__ = reader.ReadInt32(); + ____result.MyProperty = reader.ReadInt32(); continue; } } - var ____result = new global::SharedData.NonEmpty2() - { - MyProperty = __MyProperty__, - }; - reader.Depth--; return ____result; } @@ -4248,12 +4354,12 @@ public void Serialize(ref global::MessagePack.MessagePackWriter writer, global:: return; } - IFormatterResolver formatterResolver = options.Resolver; + var formatterResolver = options.Resolver; writer.WriteMapHeader(3); writer.WriteRaw(GetSpan_Prop1()); writer.Write(value.Prop1); writer.WriteRaw(GetSpan_Prop2()); - formatterResolver.GetFormatterWithVerify().Serialize(ref writer, value.Prop2, options); + global::MessagePack.FormatterResolverExtensions.GetFormatterWithVerify(formatterResolver).Serialize(ref writer, value.Prop2, options); writer.WriteRaw(GetSpan_Prop3()); writer.Write(value.Prop3); } @@ -4266,15 +4372,13 @@ public void Serialize(ref global::MessagePack.MessagePackWriter writer, global:: } options.Security.DepthStep(ref reader); - IFormatterResolver formatterResolver = options.Resolver; + var formatterResolver = options.Resolver; var length = reader.ReadMapHeader(); - var __Prop1__ = default(int); - var __Prop2__ = default(global::SharedData.ByteEnum); - var __Prop3__ = default(int); + var ____result = new global::SharedData.SimpleStringKeyData(); for (int i = 0; i < length; i++) { - ReadOnlySpan stringKey = global::MessagePack.Internal.CodeGenHelpers.ReadStringSpan(ref reader); + var stringKey = global::MessagePack.Internal.CodeGenHelpers.ReadStringSpan(ref reader); switch (stringKey.Length) { default: @@ -4286,26 +4390,19 @@ public void Serialize(ref global::MessagePack.MessagePackWriter writer, global:: { default: goto FAIL; case 212339749456UL: - __Prop1__ = reader.ReadInt32(); + ____result.Prop1 = reader.ReadInt32(); continue; case 216634716752UL: - __Prop2__ = formatterResolver.GetFormatterWithVerify().Deserialize(ref reader, options); + ____result.Prop2 = global::MessagePack.FormatterResolverExtensions.GetFormatterWithVerify(formatterResolver).Deserialize(ref reader, options); continue; case 220929684048UL: - __Prop3__ = reader.ReadInt32(); + ____result.Prop3 = reader.ReadInt32(); continue; } } } - var ____result = new global::SharedData.SimpleStringKeyData() - { - Prop1 = __Prop1__, - Prop2 = __Prop2__, - Prop3 = __Prop3__, - }; - reader.Depth--; return ____result; } @@ -4320,12 +4417,12 @@ public sealed class SimpleStructStringKeyDataFormatter : global::MessagePack.For public void Serialize(ref global::MessagePack.MessagePackWriter writer, global::SharedData.SimpleStructStringKeyData value, global::MessagePack.MessagePackSerializerOptions options) { - IFormatterResolver formatterResolver = options.Resolver; + var formatterResolver = options.Resolver; writer.WriteMapHeader(2); writer.WriteRaw(GetSpan_X()); writer.Write(value.X); writer.WriteRaw(GetSpan_Y()); - formatterResolver.GetFormatterWithVerify().Serialize(ref writer, value.Y, options); + global::MessagePack.FormatterResolverExtensions.GetFormatterWithVerify(formatterResolver).Serialize(ref writer, value.Y, options); } public global::SharedData.SimpleStructStringKeyData Deserialize(ref global::MessagePack.MessagePackReader reader, global::MessagePack.MessagePackSerializerOptions options) @@ -4336,14 +4433,13 @@ public void Serialize(ref global::MessagePack.MessagePackWriter writer, global:: } options.Security.DepthStep(ref reader); - IFormatterResolver formatterResolver = options.Resolver; + var formatterResolver = options.Resolver; var length = reader.ReadMapHeader(); - var __X__ = default(int); - var __Y__ = default(int[]); + var ____result = new global::SharedData.SimpleStructStringKeyData(); for (int i = 0; i < length; i++) { - ReadOnlySpan stringKey = global::MessagePack.Internal.CodeGenHelpers.ReadStringSpan(ref reader); + var stringKey = global::MessagePack.Internal.CodeGenHelpers.ReadStringSpan(ref reader); switch (stringKey.Length) { default: @@ -4355,25 +4451,31 @@ public void Serialize(ref global::MessagePack.MessagePackWriter writer, global:: { default: goto FAIL; case 378720052587UL: - __X__ = reader.ReadInt32(); + ____result.X = reader.ReadInt32(); continue; case 383015019883UL: - __Y__ = formatterResolver.GetFormatterWithVerify().Deserialize(ref reader, options); + ____result.Y = global::MessagePack.FormatterResolverExtensions.GetFormatterWithVerify(formatterResolver).Deserialize(ref reader, options); continue; } } } - var ____result = new global::SharedData.SimpleStructStringKeyData() - { - X = __X__, - Y = __Y__, - }; - reader.Depth--; return ____result; } } + } +#pragma warning restore 168 +#pragma warning restore 414 +#pragma warning restore 618 +#pragma warning restore 612 + +#pragma warning restore SA1129 // Do not use default value type constructor +#pragma warning restore SA1309 // Field names should not begin with underscore +#pragma warning restore SA1312 // Variable names should begin with lower-case letter +#pragma warning restore SA1403 // File may only contain a single namespace +#pragma warning restore SA1649 // File name should match first type name + diff --git a/sandbox/Sandbox/Sandbox.csproj b/sandbox/Sandbox/Sandbox.csproj index 489425ec8..17da2db30 100644 --- a/sandbox/Sandbox/Sandbox.csproj +++ b/sandbox/Sandbox/Sandbox.csproj @@ -2,14 +2,14 @@ Exe - netcoreapp2.1 + netcoreapp3.1 True - + diff --git a/sandbox/Sandbox/codegen.ps1 b/sandbox/Sandbox/codegen.ps1 index 6dd4f2335..279718f6f 100644 --- a/sandbox/Sandbox/codegen.ps1 +++ b/sandbox/Sandbox/codegen.ps1 @@ -1 +1 @@ -dotnet run -p "$PSScriptRoot/../../src/MessagePack.Generator/MessagePack.Generator.csproj" -- -i "$PSScriptRoot/../SharedData/SharedData.csproj" -o "$PSScriptRoot/Generated.cs" +dotnet run -f "net6.0" --project "$PSScriptRoot/../../src/MessagePack.Generator/MessagePack.Generator.csproj" -- -i "$PSScriptRoot/../SharedData/SharedData.csproj" -o "$PSScriptRoot/Generated.cs" diff --git a/sandbox/TestData2/A.cs b/sandbox/TestData2/A.cs index 44b0a47f3..a7eeef9d0 100644 --- a/sandbox/TestData2/A.cs +++ b/sandbox/TestData2/A.cs @@ -1,17 +1,14 @@ // Copyright (c) All contributors. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. -using System.Collections.Generic; -using MessagePack; - #pragma warning disable SA1307 // Accessible fields should begin with upper-case letter #pragma warning disable SA1401 // Fields should be private +#nullable enable + +namespace TestData2; -namespace TestData2 +[MessagePackObject(true)] +public class A { - [MessagePackObject(true)] - public class A - { - public int a; public List bs; public C c; - } + public int a; public List? bs; public C? c; } diff --git a/sandbox/TestData2/B.cs b/sandbox/TestData2/B.cs index 769c0e1c5..d9c4029ec 100644 --- a/sandbox/TestData2/B.cs +++ b/sandbox/TestData2/B.cs @@ -1,17 +1,14 @@ -// Copyright (c) All contributors. All rights reserved. +// Copyright (c) All contributors. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. -using System.Collections.Generic; -using MessagePack; - #pragma warning disable SA1307 // Accessible fields should begin with upper-case letter #pragma warning disable SA1401 // Fields should be private +#nullable enable + +namespace TestData2; -namespace TestData2 +[MessagePackObject(true)] +public class B { - [MessagePackObject(true)] - public class B - { - public List ass; public C c; public int a; - } + public List? ass; public C? c; public int a; } diff --git a/sandbox/TestData2/C.cs b/sandbox/TestData2/C.cs index 079c171e6..741517fff 100644 --- a/sandbox/TestData2/C.cs +++ b/sandbox/TestData2/C.cs @@ -1,16 +1,14 @@ -// Copyright (c) All contributors. All rights reserved. +// Copyright (c) All contributors. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. -using MessagePack; - #pragma warning disable SA1307 // Accessible fields should begin with upper-case letter #pragma warning disable SA1401 // Fields should be private +#nullable enable + +namespace TestData2; -namespace TestData2 +[MessagePackObject(true)] +public class C { - [MessagePackObject(true)] - public class C - { - public B b; public int a; - } + public B? b; public int a; } diff --git a/sandbox/TestData2/Generated.cs b/sandbox/TestData2/Generated.cs index 0d6025a99..1e65486dc 100644 --- a/sandbox/TestData2/Generated.cs +++ b/sandbox/TestData2/Generated.cs @@ -6,15 +6,13 @@ #pragma warning disable 612 #pragma warning disable 414 #pragma warning disable 168 +#pragma warning disable CS1591 // document public APIs -#pragma warning disable SA1200 // Using directives should be placed correctly #pragma warning disable SA1312 // Variable names should begin with lower-case letter #pragma warning disable SA1649 // File name should match first type name namespace MessagePack.Resolvers { - using System; - public class GeneratedResolver : global::MessagePack.IFormatterResolver { public static readonly global::MessagePack.IFormatterResolver Instance = new GeneratedResolver(); @@ -45,11 +43,11 @@ static FormatterCache() internal static class GeneratedResolverGetFormatterHelper { - private static readonly global::System.Collections.Generic.Dictionary lookup; + private static readonly global::System.Collections.Generic.Dictionary lookup; static GeneratedResolverGetFormatterHelper() { - lookup = new global::System.Collections.Generic.Dictionary(13) + lookup = new global::System.Collections.Generic.Dictionary(14) { { typeof(global::System.Collections.Generic.List), 0 }, { typeof(global::System.Collections.Generic.List), 1 }, @@ -64,10 +62,11 @@ static GeneratedResolverGetFormatterHelper() { typeof(global::TestData2.Nest2.IdType), 10 }, { typeof(global::TestData2.PropNameCheck1), 11 }, { typeof(global::TestData2.PropNameCheck2), 12 }, + { typeof(global::TestData2.Record), 13 }, }; } - internal static object GetFormatter(Type t) + internal static object GetFormatter(global::System.Type t) { int key; if (!lookup.TryGetValue(t, out key)) @@ -90,6 +89,7 @@ internal static object GetFormatter(Type t) case 10: return new MessagePack.Formatters.TestData2.Nest2_IdTypeFormatter(); case 11: return new MessagePack.Formatters.TestData2.PropNameCheck1Formatter(); case 12: return new MessagePack.Formatters.TestData2.PropNameCheck2Formatter(); + case 13: return new MessagePack.Formatters.TestData2.RecordFormatter(); default: return null; } } @@ -102,7 +102,6 @@ internal static object GetFormatter(Type t) #pragma warning restore 612 #pragma warning restore SA1312 // Variable names should begin with lower-case letter -#pragma warning restore SA1200 // Using directives should be placed correctly #pragma warning restore SA1649 // File name should match first type name @@ -114,25 +113,22 @@ internal static object GetFormatter(Type t) #pragma warning disable 612 #pragma warning disable 414 #pragma warning disable 168 +#pragma warning disable CS1591 // document public APIs -#pragma warning disable SA1200 // Using directives should be placed correctly #pragma warning disable SA1403 // File may only contain a single namespace #pragma warning disable SA1649 // File name should match first type name namespace MessagePack.Formatters.TestData2 { - using System; - using System.Buffers; - using MessagePack; public sealed class Nest1_IdFormatter : global::MessagePack.Formatters.IMessagePackFormatter { - public void Serialize(ref MessagePackWriter writer, global::TestData2.Nest1.Id value, global::MessagePack.MessagePackSerializerOptions options) + public void Serialize(ref global::MessagePack.MessagePackWriter writer, global::TestData2.Nest1.Id value, global::MessagePack.MessagePackSerializerOptions options) { - writer.Write((Int32)value); + writer.Write((global::System.Int32)value); } - public global::TestData2.Nest1.Id Deserialize(ref MessagePackReader reader, global::MessagePack.MessagePackSerializerOptions options) + public global::TestData2.Nest1.Id Deserialize(ref global::MessagePack.MessagePackReader reader, global::MessagePack.MessagePackSerializerOptions options) { return (global::TestData2.Nest1.Id)reader.ReadInt32(); } @@ -140,12 +136,12 @@ public void Serialize(ref MessagePackWriter writer, global::TestData2.Nest1.Id v public sealed class Nest2_IdFormatter : global::MessagePack.Formatters.IMessagePackFormatter { - public void Serialize(ref MessagePackWriter writer, global::TestData2.Nest2.Id value, global::MessagePack.MessagePackSerializerOptions options) + public void Serialize(ref global::MessagePack.MessagePackWriter writer, global::TestData2.Nest2.Id value, global::MessagePack.MessagePackSerializerOptions options) { - writer.Write((Int32)value); + writer.Write((global::System.Int32)value); } - public global::TestData2.Nest2.Id Deserialize(ref MessagePackReader reader, global::MessagePack.MessagePackSerializerOptions options) + public global::TestData2.Nest2.Id Deserialize(ref global::MessagePack.MessagePackReader reader, global::MessagePack.MessagePackSerializerOptions options) { return (global::TestData2.Nest2.Id)reader.ReadInt32(); } @@ -157,7 +153,6 @@ public void Serialize(ref MessagePackWriter writer, global::TestData2.Nest2.Id v #pragma warning restore 618 #pragma warning restore 612 -#pragma warning restore SA1200 // Using directives should be placed correctly #pragma warning restore SA1403 // File may only contain a single namespace #pragma warning restore SA1649 // File name should match first type name @@ -171,9 +166,9 @@ public void Serialize(ref MessagePackWriter writer, global::TestData2.Nest2.Id v #pragma warning disable 612 #pragma warning disable 414 #pragma warning disable 168 +#pragma warning disable CS1591 // document public APIs #pragma warning disable SA1129 // Do not use default value type constructor -#pragma warning disable SA1200 // Using directives should be placed correctly #pragma warning disable SA1309 // Field names should not begin with underscore #pragma warning disable SA1312 // Variable names should begin with lower-case letter #pragma warning disable SA1403 // File may only contain a single namespace @@ -181,11 +176,6 @@ public void Serialize(ref MessagePackWriter writer, global::TestData2.Nest2.Id v namespace MessagePack.Formatters.TestData2 { - using System; - using System.Buffers; - using System.Runtime.InteropServices; - using MessagePack; - public sealed class AFormatter : global::MessagePack.Formatters.IMessagePackFormatter { // a @@ -203,14 +193,14 @@ public void Serialize(ref global::MessagePack.MessagePackWriter writer, global:: return; } - IFormatterResolver formatterResolver = options.Resolver; + var formatterResolver = options.Resolver; writer.WriteMapHeader(3); writer.WriteRaw(GetSpan_a()); writer.Write(value.a); writer.WriteRaw(GetSpan_bs()); - formatterResolver.GetFormatterWithVerify>().Serialize(ref writer, value.bs, options); + global::MessagePack.FormatterResolverExtensions.GetFormatterWithVerify>(formatterResolver).Serialize(ref writer, value.bs, options); writer.WriteRaw(GetSpan_c()); - formatterResolver.GetFormatterWithVerify().Serialize(ref writer, value.c, options); + global::MessagePack.FormatterResolverExtensions.GetFormatterWithVerify(formatterResolver).Serialize(ref writer, value.c, options); } public global::TestData2.A Deserialize(ref global::MessagePack.MessagePackReader reader, global::MessagePack.MessagePackSerializerOptions options) @@ -221,15 +211,13 @@ public void Serialize(ref global::MessagePack.MessagePackWriter writer, global:: } options.Security.DepthStep(ref reader); - IFormatterResolver formatterResolver = options.Resolver; + var formatterResolver = options.Resolver; var length = reader.ReadMapHeader(); - var __a__ = default(int); - var __bs__ = default(global::System.Collections.Generic.List); - var __c__ = default(global::TestData2.C); + var ____result = new global::TestData2.A(); for (int i = 0; i < length; i++) { - ReadOnlySpan stringKey = global::MessagePack.Internal.CodeGenHelpers.ReadStringSpan(ref reader); + var stringKey = global::MessagePack.Internal.CodeGenHelpers.ReadStringSpan(ref reader); switch (stringKey.Length) { default: @@ -241,28 +229,21 @@ public void Serialize(ref global::MessagePack.MessagePackWriter writer, global:: { default: goto FAIL; case 97UL: - __a__ = reader.ReadInt32(); + ____result.a = reader.ReadInt32(); continue; case 99UL: - __c__ = formatterResolver.GetFormatterWithVerify().Deserialize(ref reader, options); + ____result.c = global::MessagePack.FormatterResolverExtensions.GetFormatterWithVerify(formatterResolver).Deserialize(ref reader, options); continue; } case 2: if (global::MessagePack.Internal.AutomataKeyGen.GetKey(ref stringKey) != 29538UL) { goto FAIL; } - __bs__ = formatterResolver.GetFormatterWithVerify>().Deserialize(ref reader, options); + ____result.bs = global::MessagePack.FormatterResolverExtensions.GetFormatterWithVerify>(formatterResolver).Deserialize(ref reader, options); continue; } } - var ____result = new global::TestData2.A() - { - a = __a__, - bs = __bs__, - c = __c__, - }; - reader.Depth--; return ____result; } @@ -285,12 +266,12 @@ public void Serialize(ref global::MessagePack.MessagePackWriter writer, global:: return; } - IFormatterResolver formatterResolver = options.Resolver; + var formatterResolver = options.Resolver; writer.WriteMapHeader(3); writer.WriteRaw(GetSpan_ass()); - formatterResolver.GetFormatterWithVerify>().Serialize(ref writer, value.ass, options); + global::MessagePack.FormatterResolverExtensions.GetFormatterWithVerify>(formatterResolver).Serialize(ref writer, value.ass, options); writer.WriteRaw(GetSpan_c()); - formatterResolver.GetFormatterWithVerify().Serialize(ref writer, value.c, options); + global::MessagePack.FormatterResolverExtensions.GetFormatterWithVerify(formatterResolver).Serialize(ref writer, value.c, options); writer.WriteRaw(GetSpan_a()); writer.Write(value.a); } @@ -303,15 +284,13 @@ public void Serialize(ref global::MessagePack.MessagePackWriter writer, global:: } options.Security.DepthStep(ref reader); - IFormatterResolver formatterResolver = options.Resolver; + var formatterResolver = options.Resolver; var length = reader.ReadMapHeader(); - var __ass__ = default(global::System.Collections.Generic.List); - var __c__ = default(global::TestData2.C); - var __a__ = default(int); + var ____result = new global::TestData2.B(); for (int i = 0; i < length; i++) { - ReadOnlySpan stringKey = global::MessagePack.Internal.CodeGenHelpers.ReadStringSpan(ref reader); + var stringKey = global::MessagePack.Internal.CodeGenHelpers.ReadStringSpan(ref reader); switch (stringKey.Length) { default: @@ -321,30 +300,23 @@ public void Serialize(ref global::MessagePack.MessagePackWriter writer, global:: case 3: if (global::MessagePack.Internal.AutomataKeyGen.GetKey(ref stringKey) != 7566177UL) { goto FAIL; } - __ass__ = formatterResolver.GetFormatterWithVerify>().Deserialize(ref reader, options); + ____result.ass = global::MessagePack.FormatterResolverExtensions.GetFormatterWithVerify>(formatterResolver).Deserialize(ref reader, options); continue; case 1: switch (global::MessagePack.Internal.AutomataKeyGen.GetKey(ref stringKey)) { default: goto FAIL; case 99UL: - __c__ = formatterResolver.GetFormatterWithVerify().Deserialize(ref reader, options); + ____result.c = global::MessagePack.FormatterResolverExtensions.GetFormatterWithVerify(formatterResolver).Deserialize(ref reader, options); continue; case 97UL: - __a__ = reader.ReadInt32(); + ____result.a = reader.ReadInt32(); continue; } } } - var ____result = new global::TestData2.B() - { - ass = __ass__, - c = __c__, - a = __a__, - }; - reader.Depth--; return ____result; } @@ -365,10 +337,10 @@ public void Serialize(ref global::MessagePack.MessagePackWriter writer, global:: return; } - IFormatterResolver formatterResolver = options.Resolver; + var formatterResolver = options.Resolver; writer.WriteMapHeader(2); writer.WriteRaw(GetSpan_b()); - formatterResolver.GetFormatterWithVerify().Serialize(ref writer, value.b, options); + global::MessagePack.FormatterResolverExtensions.GetFormatterWithVerify(formatterResolver).Serialize(ref writer, value.b, options); writer.WriteRaw(GetSpan_a()); writer.Write(value.a); } @@ -381,14 +353,13 @@ public void Serialize(ref global::MessagePack.MessagePackWriter writer, global:: } options.Security.DepthStep(ref reader); - IFormatterResolver formatterResolver = options.Resolver; + var formatterResolver = options.Resolver; var length = reader.ReadMapHeader(); - var __b__ = default(global::TestData2.B); - var __a__ = default(int); + var ____result = new global::TestData2.C(); for (int i = 0; i < length; i++) { - ReadOnlySpan stringKey = global::MessagePack.Internal.CodeGenHelpers.ReadStringSpan(ref reader); + var stringKey = global::MessagePack.Internal.CodeGenHelpers.ReadStringSpan(ref reader); switch (stringKey.Length) { default: @@ -400,22 +371,16 @@ public void Serialize(ref global::MessagePack.MessagePackWriter writer, global:: { default: goto FAIL; case 98UL: - __b__ = formatterResolver.GetFormatterWithVerify().Deserialize(ref reader, options); + ____result.b = global::MessagePack.FormatterResolverExtensions.GetFormatterWithVerify(formatterResolver).Deserialize(ref reader, options); continue; case 97UL: - __a__ = reader.ReadInt32(); + ____result.a = reader.ReadInt32(); continue; } } } - var ____result = new global::TestData2.C() - { - b = __b__, - a = __a__, - }; - reader.Depth--; return ____result; } @@ -436,12 +401,12 @@ public void Serialize(ref global::MessagePack.MessagePackWriter writer, global:: return; } - IFormatterResolver formatterResolver = options.Resolver; + var formatterResolver = options.Resolver; writer.WriteMapHeader(2); writer.WriteRaw(GetSpan_EnumId()); - formatterResolver.GetFormatterWithVerify().Serialize(ref writer, value.EnumId, options); + global::MessagePack.FormatterResolverExtensions.GetFormatterWithVerify(formatterResolver).Serialize(ref writer, value.EnumId, options); writer.WriteRaw(GetSpan_ClassId()); - formatterResolver.GetFormatterWithVerify().Serialize(ref writer, value.ClassId, options); + global::MessagePack.FormatterResolverExtensions.GetFormatterWithVerify(formatterResolver).Serialize(ref writer, value.ClassId, options); } public global::TestData2.Nest1 Deserialize(ref global::MessagePack.MessagePackReader reader, global::MessagePack.MessagePackSerializerOptions options) @@ -452,14 +417,13 @@ public void Serialize(ref global::MessagePack.MessagePackWriter writer, global:: } options.Security.DepthStep(ref reader); - IFormatterResolver formatterResolver = options.Resolver; + var formatterResolver = options.Resolver; var length = reader.ReadMapHeader(); - var __EnumId__ = default(global::TestData2.Nest1.Id); - var __ClassId__ = default(global::TestData2.Nest1.IdType); + var ____result = new global::TestData2.Nest1(); for (int i = 0; i < length; i++) { - ReadOnlySpan stringKey = global::MessagePack.Internal.CodeGenHelpers.ReadStringSpan(ref reader); + var stringKey = global::MessagePack.Internal.CodeGenHelpers.ReadStringSpan(ref reader); switch (stringKey.Length) { default: @@ -469,23 +433,17 @@ public void Serialize(ref global::MessagePack.MessagePackWriter writer, global:: case 6: if (global::MessagePack.Internal.AutomataKeyGen.GetKey(ref stringKey) != 110266531802693UL) { goto FAIL; } - __EnumId__ = formatterResolver.GetFormatterWithVerify().Deserialize(ref reader, options); + ____result.EnumId = global::MessagePack.FormatterResolverExtensions.GetFormatterWithVerify(formatterResolver).Deserialize(ref reader, options); continue; case 7: if (global::MessagePack.Internal.AutomataKeyGen.GetKey(ref stringKey) != 28228257876896835UL) { goto FAIL; } - __ClassId__ = formatterResolver.GetFormatterWithVerify().Deserialize(ref reader, options); + ____result.ClassId = global::MessagePack.FormatterResolverExtensions.GetFormatterWithVerify(formatterResolver).Deserialize(ref reader, options); continue; } } - var ____result = new global::TestData2.Nest1() - { - EnumId = __EnumId__, - ClassId = __ClassId__, - }; - reader.Depth--; return ____result; } @@ -493,7 +451,6 @@ public void Serialize(ref global::MessagePack.MessagePackWriter writer, global:: public sealed class Nest1_IdTypeFormatter : global::MessagePack.Formatters.IMessagePackFormatter { - public void Serialize(ref global::MessagePack.MessagePackWriter writer, global::TestData2.Nest1.IdType value, global::MessagePack.MessagePackSerializerOptions options) { if (value is null) @@ -533,12 +490,12 @@ public void Serialize(ref global::MessagePack.MessagePackWriter writer, global:: return; } - IFormatterResolver formatterResolver = options.Resolver; + var formatterResolver = options.Resolver; writer.WriteMapHeader(2); writer.WriteRaw(GetSpan_EnumId()); - formatterResolver.GetFormatterWithVerify().Serialize(ref writer, value.EnumId, options); + global::MessagePack.FormatterResolverExtensions.GetFormatterWithVerify(formatterResolver).Serialize(ref writer, value.EnumId, options); writer.WriteRaw(GetSpan_ClassId()); - formatterResolver.GetFormatterWithVerify().Serialize(ref writer, value.ClassId, options); + global::MessagePack.FormatterResolverExtensions.GetFormatterWithVerify(formatterResolver).Serialize(ref writer, value.ClassId, options); } public global::TestData2.Nest2 Deserialize(ref global::MessagePack.MessagePackReader reader, global::MessagePack.MessagePackSerializerOptions options) @@ -549,14 +506,13 @@ public void Serialize(ref global::MessagePack.MessagePackWriter writer, global:: } options.Security.DepthStep(ref reader); - IFormatterResolver formatterResolver = options.Resolver; + var formatterResolver = options.Resolver; var length = reader.ReadMapHeader(); - var __EnumId__ = default(global::TestData2.Nest2.Id); - var __ClassId__ = default(global::TestData2.Nest2.IdType); + var ____result = new global::TestData2.Nest2(); for (int i = 0; i < length; i++) { - ReadOnlySpan stringKey = global::MessagePack.Internal.CodeGenHelpers.ReadStringSpan(ref reader); + var stringKey = global::MessagePack.Internal.CodeGenHelpers.ReadStringSpan(ref reader); switch (stringKey.Length) { default: @@ -566,23 +522,17 @@ public void Serialize(ref global::MessagePack.MessagePackWriter writer, global:: case 6: if (global::MessagePack.Internal.AutomataKeyGen.GetKey(ref stringKey) != 110266531802693UL) { goto FAIL; } - __EnumId__ = formatterResolver.GetFormatterWithVerify().Deserialize(ref reader, options); + ____result.EnumId = global::MessagePack.FormatterResolverExtensions.GetFormatterWithVerify(formatterResolver).Deserialize(ref reader, options); continue; case 7: if (global::MessagePack.Internal.AutomataKeyGen.GetKey(ref stringKey) != 28228257876896835UL) { goto FAIL; } - __ClassId__ = formatterResolver.GetFormatterWithVerify().Deserialize(ref reader, options); + ____result.ClassId = global::MessagePack.FormatterResolverExtensions.GetFormatterWithVerify(formatterResolver).Deserialize(ref reader, options); continue; } } - var ____result = new global::TestData2.Nest2() - { - EnumId = __EnumId__, - ClassId = __ClassId__, - }; - reader.Depth--; return ____result; } @@ -590,7 +540,6 @@ public void Serialize(ref global::MessagePack.MessagePackWriter writer, global:: public sealed class Nest2_IdTypeFormatter : global::MessagePack.Formatters.IMessagePackFormatter { - public void Serialize(ref global::MessagePack.MessagePackWriter writer, global::TestData2.Nest2.IdType value, global::MessagePack.MessagePackSerializerOptions options) { if (value is null) @@ -630,12 +579,12 @@ public void Serialize(ref global::MessagePack.MessagePackWriter writer, global:: return; } - IFormatterResolver formatterResolver = options.Resolver; + var formatterResolver = options.Resolver; writer.WriteMapHeader(2); writer.WriteRaw(GetSpan_MyProperty1()); - formatterResolver.GetFormatterWithVerify().Serialize(ref writer, value.MyProperty1, options); + global::MessagePack.FormatterResolverExtensions.GetFormatterWithVerify(formatterResolver).Serialize(ref writer, value.MyProperty1, options); writer.WriteRaw(GetSpan_MyProperty2()); - formatterResolver.GetFormatterWithVerify().Serialize(ref writer, value.MyProperty2, options); + global::MessagePack.FormatterResolverExtensions.GetFormatterWithVerify(formatterResolver).Serialize(ref writer, value.MyProperty2, options); } public global::TestData2.PropNameCheck1 Deserialize(ref global::MessagePack.MessagePackReader reader, global::MessagePack.MessagePackSerializerOptions options) @@ -646,14 +595,13 @@ public void Serialize(ref global::MessagePack.MessagePackWriter writer, global:: } options.Security.DepthStep(ref reader); - IFormatterResolver formatterResolver = options.Resolver; + var formatterResolver = options.Resolver; var length = reader.ReadMapHeader(); - var __MyProperty1__ = default(string); - var __MyProperty2__ = default(string); + var ____result = new global::TestData2.PropNameCheck1(); for (int i = 0; i < length; i++) { - ReadOnlySpan stringKey = global::MessagePack.Internal.CodeGenHelpers.ReadStringSpan(ref reader); + var stringKey = global::MessagePack.Internal.CodeGenHelpers.ReadStringSpan(ref reader); switch (stringKey.Length) { default: @@ -669,10 +617,10 @@ public void Serialize(ref global::MessagePack.MessagePackWriter writer, global:: { default: goto FAIL; case 3242356UL: - __MyProperty1__ = formatterResolver.GetFormatterWithVerify().Deserialize(ref reader, options); + ____result.MyProperty1 = global::MessagePack.FormatterResolverExtensions.GetFormatterWithVerify(formatterResolver).Deserialize(ref reader, options); continue; case 3307892UL: - __MyProperty2__ = formatterResolver.GetFormatterWithVerify().Deserialize(ref reader, options); + ____result.MyProperty2 = global::MessagePack.FormatterResolverExtensions.GetFormatterWithVerify(formatterResolver).Deserialize(ref reader, options); continue; } @@ -681,12 +629,6 @@ public void Serialize(ref global::MessagePack.MessagePackWriter writer, global:: } } - var ____result = new global::TestData2.PropNameCheck1() - { - MyProperty1 = __MyProperty1__, - MyProperty2 = __MyProperty2__, - }; - reader.Depth--; return ____result; } @@ -707,12 +649,12 @@ public void Serialize(ref global::MessagePack.MessagePackWriter writer, global:: return; } - IFormatterResolver formatterResolver = options.Resolver; + var formatterResolver = options.Resolver; writer.WriteMapHeader(2); writer.WriteRaw(GetSpan_MyProperty1()); - formatterResolver.GetFormatterWithVerify().Serialize(ref writer, value.MyProperty1, options); + global::MessagePack.FormatterResolverExtensions.GetFormatterWithVerify(formatterResolver).Serialize(ref writer, value.MyProperty1, options); writer.WriteRaw(GetSpan_MyProperty2()); - formatterResolver.GetFormatterWithVerify().Serialize(ref writer, value.MyProperty2, options); + global::MessagePack.FormatterResolverExtensions.GetFormatterWithVerify(formatterResolver).Serialize(ref writer, value.MyProperty2, options); } public global::TestData2.PropNameCheck2 Deserialize(ref global::MessagePack.MessagePackReader reader, global::MessagePack.MessagePackSerializerOptions options) @@ -723,14 +665,13 @@ public void Serialize(ref global::MessagePack.MessagePackWriter writer, global:: } options.Security.DepthStep(ref reader); - IFormatterResolver formatterResolver = options.Resolver; + var formatterResolver = options.Resolver; var length = reader.ReadMapHeader(); - var __MyProperty1__ = default(string); - var __MyProperty2__ = default(string); + var ____result = new global::TestData2.PropNameCheck2(); for (int i = 0; i < length; i++) { - ReadOnlySpan stringKey = global::MessagePack.Internal.CodeGenHelpers.ReadStringSpan(ref reader); + var stringKey = global::MessagePack.Internal.CodeGenHelpers.ReadStringSpan(ref reader); switch (stringKey.Length) { default: @@ -746,10 +687,10 @@ public void Serialize(ref global::MessagePack.MessagePackWriter writer, global:: { default: goto FAIL; case 3242356UL: - __MyProperty1__ = formatterResolver.GetFormatterWithVerify().Deserialize(ref reader, options); + ____result.MyProperty1 = global::MessagePack.FormatterResolverExtensions.GetFormatterWithVerify(formatterResolver).Deserialize(ref reader, options); continue; case 3307892UL: - __MyProperty2__ = formatterResolver.GetFormatterWithVerify().Deserialize(ref reader, options); + ____result.MyProperty2 = global::MessagePack.FormatterResolverExtensions.GetFormatterWithVerify(formatterResolver).Deserialize(ref reader, options); continue; } @@ -758,15 +699,76 @@ public void Serialize(ref global::MessagePack.MessagePackWriter writer, global:: } } - var ____result = new global::TestData2.PropNameCheck2() + reader.Depth--; + return ____result; + } + } + + public sealed class RecordFormatter : global::MessagePack.Formatters.IMessagePackFormatter + { + // SomeProperty + private static global::System.ReadOnlySpan GetSpan_SomeProperty() => new byte[1 + 12] { 172, 83, 111, 109, 101, 80, 114, 111, 112, 101, 114, 116, 121 }; + + public void Serialize(ref global::MessagePack.MessagePackWriter writer, global::TestData2.Record value, global::MessagePack.MessagePackSerializerOptions options) + { + if (value is null) { - MyProperty1 = __MyProperty1__, - MyProperty2 = __MyProperty2__, - }; + writer.WriteNil(); + return; + } + var formatterResolver = options.Resolver; + writer.WriteMapHeader(1); + writer.WriteRaw(GetSpan_SomeProperty()); + global::MessagePack.FormatterResolverExtensions.GetFormatterWithVerify(formatterResolver).Serialize(ref writer, value.SomeProperty, options); + } + + public global::TestData2.Record Deserialize(ref global::MessagePack.MessagePackReader reader, global::MessagePack.MessagePackSerializerOptions options) + { + if (reader.TryReadNil()) + { + return null; + } + + options.Security.DepthStep(ref reader); + var formatterResolver = options.Resolver; + var length = reader.ReadMapHeader(); + var __SomeProperty__ = default(string); + + for (int i = 0; i < length; i++) + { + var stringKey = global::MessagePack.Internal.CodeGenHelpers.ReadStringSpan(ref reader); + switch (stringKey.Length) + { + default: + FAIL: + reader.Skip(); + continue; + case 12: + if (!global::System.MemoryExtensions.SequenceEqual(stringKey, GetSpan_SomeProperty().Slice(1))) { goto FAIL; } + + __SomeProperty__ = global::MessagePack.FormatterResolverExtensions.GetFormatterWithVerify(formatterResolver).Deserialize(ref reader, options); + continue; + + } + } + + var ____result = new global::TestData2.Record(__SomeProperty__); reader.Depth--; return ____result; } } + } +#pragma warning restore 168 +#pragma warning restore 414 +#pragma warning restore 618 +#pragma warning restore 612 + +#pragma warning restore SA1129 // Do not use default value type constructor +#pragma warning restore SA1309 // Field names should not begin with underscore +#pragma warning restore SA1312 // Variable names should begin with lower-case letter +#pragma warning restore SA1403 // File may only contain a single namespace +#pragma warning restore SA1649 // File name should match first type name + diff --git a/sandbox/TestData2/Record.cs b/sandbox/TestData2/Record.cs new file mode 100644 index 000000000..b48bf693c --- /dev/null +++ b/sandbox/TestData2/Record.cs @@ -0,0 +1,10 @@ +// Copyright (c) All contributors. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +using MessagePack; + +namespace TestData2 +{ + [MessagePackObject] + public record Record([property: Key("SomeProperty")] string SomeProperty); +} diff --git a/sandbox/TestData2/TestData2.csproj b/sandbox/TestData2/TestData2.csproj index 966e801de..a73130494 100644 --- a/sandbox/TestData2/TestData2.csproj +++ b/sandbox/TestData2/TestData2.csproj @@ -1,10 +1,16 @@  net461 + 10 + + + + + diff --git a/sandbox/TestData2/codegen.ps1 b/sandbox/TestData2/codegen.ps1 index 17ec27b26..6781688ed 100644 --- a/sandbox/TestData2/codegen.ps1 +++ b/sandbox/TestData2/codegen.ps1 @@ -1 +1 @@ -dotnet run -p "$PSScriptRoot/../../src/MessagePack.Generator/MessagePack.Generator.csproj" -- -i "$PSScriptRoot/TestData2.csproj" -o "$PSScriptRoot/Generated.cs" +dotnet run -f "net6.0" --project "$PSScriptRoot/../../src/MessagePack.Generator/MessagePack.Generator.csproj" -- -i "$PSScriptRoot/TestData2.csproj" -o "$PSScriptRoot/Generated.cs" diff --git a/src/MessagePack.AspNetCoreMvcFormatter/MessagePack.AspNetCoreMvcFormatter.csproj b/src/MessagePack.AspNetCoreMvcFormatter/MessagePack.AspNetCoreMvcFormatter.csproj index 32229c1d7..d68ddacda 100644 --- a/src/MessagePack.AspNetCoreMvcFormatter/MessagePack.AspNetCoreMvcFormatter.csproj +++ b/src/MessagePack.AspNetCoreMvcFormatter/MessagePack.AspNetCoreMvcFormatter.csproj @@ -1,6 +1,6 @@  - netstandard2.0;netcoreapp3.0 + netstandard2.0;netcoreapp3.1 true ASP.NET Core MVC Input/Output MessagePack formatter ASP.NET Core MVC Input/Output MessagePack formatter. @@ -8,14 +8,14 @@ - + - + diff --git a/src/MessagePack.AspNetCoreMvcFormatter/MessagePackInputFormatter.cs b/src/MessagePack.AspNetCoreMvcFormatter/MessagePackInputFormatter.cs index 95edae0ef..59c49a998 100644 --- a/src/MessagePack.AspNetCoreMvcFormatter/MessagePackInputFormatter.cs +++ b/src/MessagePack.AspNetCoreMvcFormatter/MessagePackInputFormatter.cs @@ -6,7 +6,7 @@ namespace MessagePack.AspNetCoreMvcFormatter { - public class MessagePackInputFormatter : IInputFormatter + public class MessagePackInputFormatter : InputFormatter { private const string ContentType = "application/x-msgpack"; private readonly MessagePackSerializerOptions options; @@ -19,12 +19,11 @@ public MessagePackInputFormatter() public MessagePackInputFormatter(MessagePackSerializerOptions options) { this.options = options; - } - public bool CanRead(InputFormatterContext context) => - context.HttpContext.Request.ContentType == ContentType; + SupportedMediaTypes.Add(ContentType); + } - public async Task ReadAsync(InputFormatterContext context) + public override async Task ReadRequestBodyAsync(InputFormatterContext context) { var request = context.HttpContext.Request; var result = await MessagePackSerializer.DeserializeAsync(context.ModelType, request.Body, this.options, context.HttpContext.RequestAborted).ConfigureAwait(false); diff --git a/src/MessagePack.AspNetCoreMvcFormatter/MessagePackOutputFormatter.cs b/src/MessagePack.AspNetCoreMvcFormatter/MessagePackOutputFormatter.cs index ec9940c6d..409981148 100644 --- a/src/MessagePack.AspNetCoreMvcFormatter/MessagePackOutputFormatter.cs +++ b/src/MessagePack.AspNetCoreMvcFormatter/MessagePackOutputFormatter.cs @@ -3,11 +3,10 @@ using System.Threading.Tasks; using Microsoft.AspNetCore.Mvc.Formatters; -using Microsoft.Extensions.Primitives; namespace MessagePack.AspNetCoreMvcFormatter { - public class MessagePackOutputFormatter : IOutputFormatter + public class MessagePackOutputFormatter : OutputFormatter { private const string ContentType = "application/x-msgpack"; private readonly MessagePackSerializerOptions options; @@ -20,23 +19,12 @@ public MessagePackOutputFormatter() public MessagePackOutputFormatter(MessagePackSerializerOptions options) { this.options = options; - } - - public bool CanWriteResult(OutputFormatterCanWriteContext context) - { - if (!context.ContentType.HasValue) - { - context.ContentType = new StringSegment(ContentType); - return true; - } - return context.ContentType.Value == ContentType; + SupportedMediaTypes.Add(ContentType); } - public Task WriteAsync(OutputFormatterWriteContext context) + public override Task WriteResponseBodyAsync(OutputFormatterWriteContext context) { - context.HttpContext.Response.ContentType = ContentType; - if (context.ObjectType == typeof(object)) { if (context.Object == null) @@ -46,6 +34,12 @@ public Task WriteAsync(OutputFormatterWriteContext context) return Task.CompletedTask; #else var writer = context.HttpContext.Response.BodyWriter; + if (writer == null) + { + context.HttpContext.Response.Body.WriteByte(MessagePackCode.Nil); + return Task.CompletedTask; + } + var span = writer.GetSpan(1); span[0] = MessagePackCode.Nil; writer.Advance(1); @@ -58,6 +52,11 @@ public Task WriteAsync(OutputFormatterWriteContext context) return MessagePackSerializer.SerializeAsync(context.Object.GetType(), context.HttpContext.Response.Body, context.Object, this.options, context.HttpContext.RequestAborted); #else var writer = context.HttpContext.Response.BodyWriter; + if (writer == null) + { + return MessagePackSerializer.SerializeAsync(context.Object.GetType(), context.HttpContext.Response.Body, context.Object, this.options, context.HttpContext.RequestAborted); + } + MessagePackSerializer.Serialize(context.Object.GetType(), writer, context.Object, this.options, context.HttpContext.RequestAborted); return writer.FlushAsync().AsTask(); #endif @@ -69,6 +68,11 @@ public Task WriteAsync(OutputFormatterWriteContext context) return MessagePackSerializer.SerializeAsync(context.ObjectType, context.HttpContext.Response.Body, context.Object, this.options, context.HttpContext.RequestAborted); #else var writer = context.HttpContext.Response.BodyWriter; + if (writer == null) + { + return MessagePackSerializer.SerializeAsync(context.ObjectType, context.HttpContext.Response.Body, context.Object, this.options, context.HttpContext.RequestAborted); + } + MessagePackSerializer.Serialize(context.ObjectType, writer, context.Object, this.options, context.HttpContext.RequestAborted); return writer.FlushAsync().AsTask(); #endif diff --git a/src/MessagePack.Generator/MessagePack.Generator.csproj b/src/MessagePack.Generator/MessagePack.Generator.csproj index bde486a06..42b02f30f 100644 --- a/src/MessagePack.Generator/MessagePack.Generator.csproj +++ b/src/MessagePack.Generator/MessagePack.Generator.csproj @@ -3,12 +3,13 @@ mpc Exe - netcoreapp3.1 - 8 + netcoreapp3.1;net6.0 + 10 enable true true mpc + Major MessagePack.Generator @@ -18,11 +19,11 @@ - - - - - + + + + + diff --git a/src/MessagePack.Generator/PseudoCompilation.cs b/src/MessagePack.Generator/PseudoCompilation.cs index a8daeacb8..80d5a1ed2 100644 --- a/src/MessagePack.Generator/PseudoCompilation.cs +++ b/src/MessagePack.Generator/PseudoCompilation.cs @@ -91,7 +91,7 @@ private static List GetStandardReferences() .Distinct() .ToList(); - var dir = new FileInfo(typeof(object).Assembly.Location).Directory; + var dir = new FileInfo(typeof(object).Assembly.Location).Directory ?? throw new NullReferenceException("Assembly location directory not found!"); { var path = Path.Combine(dir.FullName, "netstandard.dll"); if (File.Exists(path)) diff --git a/src/MessagePack.GeneratorCore/CodeAnalysis/Definitions.cs b/src/MessagePack.GeneratorCore/CodeAnalysis/Definitions.cs index ab0534429..30aaedb98 100644 --- a/src/MessagePack.GeneratorCore/CodeAnalysis/Definitions.cs +++ b/src/MessagePack.GeneratorCore/CodeAnalysis/Definitions.cs @@ -9,6 +9,11 @@ namespace MessagePackCompiler.CodeAnalysis { + public interface INamespaceInfo + { + string? Namespace { get; } + } + public interface IResolverRegisterInfo { string FullName { get; } @@ -16,43 +21,40 @@ public interface IResolverRegisterInfo string FormatterName { get; } } - public class ObjectSerializationInfo : IResolverRegisterInfo + public class ObjectSerializationInfo : IResolverRegisterInfo, INamespaceInfo { - public string Name { get; set; } + public string Name { get; } - public string FullName { get; set; } + public string FullName { get; } - public string Namespace { get; set; } + public string? Namespace { get; } - public GenericTypeParameterInfo[] GenericTypeParameters { get; set; } + public GenericTypeParameterInfo[] GenericTypeParameters { get; } - public bool IsOpenGenericType { get; set; } + public bool IsOpenGenericType { get; } - public bool IsIntKey { get; set; } + public bool IsIntKey { get; } public bool IsStringKey { get { return !this.IsIntKey; } } - public bool IsClass { get; set; } + public bool IsClass { get; } - public bool IsStruct - { - get { return !this.IsClass; } - } + public MemberSerializationInfo[] ConstructorParameters { get; } - public MemberSerializationInfo[] ConstructorParameters { get; set; } + public MemberSerializationInfo[] Members { get; } - public MemberSerializationInfo[] Members { get; set; } + public bool HasIMessagePackSerializationCallbackReceiver { get; } - public bool HasIMessagePackSerializationCallbackReceiver { get; set; } + public bool NeedsCastOnBefore { get; } - public bool NeedsCastOnBefore { get; set; } + public bool NeedsCastOnAfter { get; } - public bool NeedsCastOnAfter { get; set; } + public string FormatterName => this.Namespace == null ? FormatterNameWithoutNameSpace : this.Namespace + "." + FormatterNameWithoutNameSpace; - public string FormatterName => (this.Namespace == null ? this.Name : this.Namespace + "." + this.Name) + "Formatter" + (this.IsOpenGenericType ? $"<{string.Join(",", this.GenericTypeParameters.Select(x => x.Name))}>" : string.Empty); + public string FormatterNameWithoutNameSpace => this.Name + "Formatter" + (this.IsOpenGenericType ? $"<{string.Join(", ", this.GenericTypeParameters.Select(x => x.Name))}>" : string.Empty); public int WriteCount { @@ -77,7 +79,7 @@ public int MaxKey } } - public MemberSerializationInfo GetMember(int index) + public MemberSerializationInfo? GetMember(int index) { return this.Members.FirstOrDefault(x => x.IntKey == index); } @@ -87,6 +89,22 @@ public string GetConstructorString() var args = string.Join(", ", this.ConstructorParameters.Select(x => "__" + x.Name + "__")); return $"{this.FullName}({args})"; } + + public ObjectSerializationInfo(bool isClass, bool isOpenGenericType, GenericTypeParameterInfo[] genericTypeParameterInfos, MemberSerializationInfo[] constructorParameters, bool isIntKey, MemberSerializationInfo[] members, string name, string fullName, string? @namespace, bool hasSerializationConstructor, bool needsCastOnAfter, bool needsCastOnBefore) + { + IsClass = isClass; + IsOpenGenericType = isOpenGenericType; + GenericTypeParameters = genericTypeParameterInfos; + ConstructorParameters = constructorParameters; + IsIntKey = isIntKey; + Members = members; + Name = name; + FullName = fullName; + Namespace = @namespace; + HasIMessagePackSerializationCallbackReceiver = hasSerializationConstructor; + NeedsCastOnAfter = needsCastOnAfter; + NeedsCastOnBefore = needsCastOnBefore; + } } public class GenericTypeParameterInfo @@ -101,33 +119,44 @@ public GenericTypeParameterInfo(string name, string constraints) { Name = name ?? throw new ArgumentNullException(nameof(name)); Constraints = constraints ?? throw new ArgumentNullException(nameof(name)); - HasConstraints = !string.IsNullOrEmpty(constraints); + HasConstraints = constraints != string.Empty; } } public class MemberSerializationInfo { - public bool IsProperty { get; set; } + public bool IsProperty { get; } - public bool IsField { get; set; } + public bool IsWritable { get; } - public bool IsWritable { get; set; } + public bool IsReadable { get; } - public bool IsReadable { get; set; } + public int IntKey { get; } - public int IntKey { get; set; } + public string StringKey { get; } - public string StringKey { get; set; } + public string Type { get; } - public string Type { get; set; } + public string Name { get; } - public string Name { get; set; } + public string ShortTypeName { get; } - public string ShortTypeName { get; set; } + public string? CustomFormatterTypeName { get; } - public string CustomFormatterTypeName { get; set; } + private readonly HashSet primitiveTypes = new(Generator.ShouldUseFormatterResolverHelper.PrimitiveTypes); - private readonly HashSet primitiveTypes = new HashSet(Generator.ShouldUseFormatterResolverHelper.PrimitiveTypes); + public MemberSerializationInfo(bool isProperty, bool isWritable, bool isReadable, int intKey, string stringKey, string name, string type, string shortTypeName, string? customFormatterTypeName) + { + IsProperty = isProperty; + IsWritable = isWritable; + IsReadable = isReadable; + IntKey = intKey; + StringKey = stringKey; + Type = type; + Name = name; + ShortTypeName = shortTypeName; + CustomFormatterTypeName = customFormatterTypeName; + } public string GetSerializeMethodString() { @@ -137,11 +166,11 @@ public string GetSerializeMethodString() } else if (this.primitiveTypes.Contains(this.Type)) { - return $"writer.Write(value.{this.Name})"; + return "writer.Write(value." + this.Name + ")"; } else { - return $"formatterResolver.GetFormatterWithVerify<{this.Type}>().Serialize(ref writer, value.{this.Name}, options)"; + return $"global::MessagePack.FormatterResolverExtensions.GetFormatterWithVerify<{this.Type}>(formatterResolver).Serialize(ref writer, value.{this.Name}, options)"; } } @@ -153,65 +182,100 @@ public string GetDeserializeMethodString() } else if (this.primitiveTypes.Contains(this.Type)) { - string suffix = this.Type == "byte[]" ? "?.ToArray()" : string.Empty; - return $"reader.Read{this.ShortTypeName.Replace("[]", "s")}()" + suffix; + if (this.Type == "byte[]") + { + return "global::MessagePack.Internal.CodeGenHelpers.GetArrayFromNullableSequence(reader.ReadBytes())"; + } + else + { + return $"reader.Read{this.ShortTypeName!.Replace("[]", "s")}()"; + } } else { - return $"formatterResolver.GetFormatterWithVerify<{this.Type}>().Deserialize(ref reader, options)"; + return $"global::MessagePack.FormatterResolverExtensions.GetFormatterWithVerify<{this.Type}>(formatterResolver).Deserialize(ref reader, options)"; } } } - public class EnumSerializationInfo : IResolverRegisterInfo + public class EnumSerializationInfo : IResolverRegisterInfo, INamespaceInfo { - public string Namespace { get; set; } + public EnumSerializationInfo(string? @namespace, string name, string fullName, string underlyingType) + { + Namespace = @namespace; + Name = name; + FullName = fullName; + UnderlyingType = underlyingType; + } + + public string? Namespace { get; } - public string Name { get; set; } + public string Name { get; } - public string FullName { get; set; } + public string FullName { get; } - public string UnderlyingType { get; set; } + public string UnderlyingType { get; } public string FormatterName => (this.Namespace == null ? this.Name : this.Namespace + "." + this.Name) + "Formatter"; } public class GenericSerializationInfo : IResolverRegisterInfo, IEquatable { - public string FullName { get; set; } + public string FullName { get; } - public string FormatterName { get; set; } + public string FormatterName { get; } - public bool IsOpenGenericType { get; set; } + public bool IsOpenGenericType { get; } - public bool Equals(GenericSerializationInfo other) + public bool Equals(GenericSerializationInfo? other) { - return this.FullName.Equals(other.FullName); + return this.FullName.Equals(other?.FullName); } public override int GetHashCode() { return this.FullName.GetHashCode(); } + + public GenericSerializationInfo(string fullName, string formatterName, bool isOpenGenericType) + { + FullName = fullName; + FormatterName = formatterName; + IsOpenGenericType = isOpenGenericType; + } } - public class UnionSerializationInfo : IResolverRegisterInfo + public class UnionSerializationInfo : IResolverRegisterInfo, INamespaceInfo { - public string Namespace { get; set; } + public string? Namespace { get; } - public string Name { get; set; } + public string Name { get; } - public string FullName { get; set; } + public string FullName { get; } public string FormatterName => (this.Namespace == null ? this.Name : this.Namespace + "." + this.Name) + "Formatter"; - public UnionSubTypeInfo[] SubTypes { get; set; } + public UnionSubTypeInfo[] SubTypes { get; } + + public UnionSerializationInfo(string? @namespace, string name, string fullName, UnionSubTypeInfo[] subTypes) + { + Namespace = @namespace; + Name = name; + FullName = fullName; + SubTypes = subTypes; + } } public class UnionSubTypeInfo { - public string Type { get; set; } + public UnionSubTypeInfo(int key, string type) + { + Key = key; + Type = type; + } + + public int Key { get; } - public int Key { get; set; } + public string Type { get; } } } diff --git a/src/MessagePack.GeneratorCore/CodeAnalysis/TypeCollector.cs b/src/MessagePack.GeneratorCore/CodeAnalysis/TypeCollector.cs index b65a9f7d3..eeedbdadc 100644 --- a/src/MessagePack.GeneratorCore/CodeAnalysis/TypeCollector.cs +++ b/src/MessagePack.GeneratorCore/CodeAnalysis/TypeCollector.cs @@ -5,6 +5,7 @@ using System; using System.Collections.Generic; +using System.Collections.Immutable; using System.Linq; using System.Text; using System.Text.RegularExpressions; @@ -23,14 +24,14 @@ public MessagePackGeneratorResolveFailedException(string message) internal class ReferenceSymbols { #pragma warning disable SA1401 // Fields should be private - internal readonly INamedTypeSymbol Task; - internal readonly INamedTypeSymbol TaskOfT; + internal readonly INamedTypeSymbol? Task; + internal readonly INamedTypeSymbol? TaskOfT; internal readonly INamedTypeSymbol MessagePackObjectAttribute; internal readonly INamedTypeSymbol UnionAttribute; internal readonly INamedTypeSymbol SerializationConstructorAttribute; internal readonly INamedTypeSymbol KeyAttribute; internal readonly INamedTypeSymbol IgnoreAttribute; - internal readonly INamedTypeSymbol IgnoreDataMemberAttribute; + internal readonly INamedTypeSymbol? IgnoreDataMemberAttribute; internal readonly INamedTypeSymbol IMessagePackSerializationCallbackReceiver; internal readonly INamedTypeSymbol MessagePackFormatterAttribute; #pragma warning restore SA1401 // Fields should be private @@ -49,35 +50,20 @@ public ReferenceSymbols(Compilation compilation, Action logger) logger("failed to get metadata of System.Threading.Tasks.Task"); } - MessagePackObjectAttribute = compilation.GetTypeByMetadataName("MessagePack.MessagePackObjectAttribute"); - if (MessagePackObjectAttribute == null) - { - throw new InvalidOperationException("failed to get metadata of MessagePack.MessagePackObjectAttribute"); - } + MessagePackObjectAttribute = compilation.GetTypeByMetadataName("MessagePack.MessagePackObjectAttribute") + ?? throw new InvalidOperationException("failed to get metadata of MessagePack.MessagePackObjectAttribute"); - UnionAttribute = compilation.GetTypeByMetadataName("MessagePack.UnionAttribute"); - if (UnionAttribute == null) - { - throw new InvalidOperationException("failed to get metadata of MessagePack.UnionAttribute"); - } + UnionAttribute = compilation.GetTypeByMetadataName("MessagePack.UnionAttribute") + ?? throw new InvalidOperationException("failed to get metadata of MessagePack.UnionAttribute"); - SerializationConstructorAttribute = compilation.GetTypeByMetadataName("MessagePack.SerializationConstructorAttribute"); - if (SerializationConstructorAttribute == null) - { - throw new InvalidOperationException("failed to get metadata of MessagePack.SerializationConstructorAttribute"); - } + SerializationConstructorAttribute = compilation.GetTypeByMetadataName("MessagePack.SerializationConstructorAttribute") + ?? throw new InvalidOperationException("failed to get metadata of MessagePack.SerializationConstructorAttribute"); - KeyAttribute = compilation.GetTypeByMetadataName("MessagePack.KeyAttribute"); - if (KeyAttribute == null) - { - throw new InvalidOperationException("failed to get metadata of MessagePack.KeyAttribute"); - } + KeyAttribute = compilation.GetTypeByMetadataName("MessagePack.KeyAttribute") + ?? throw new InvalidOperationException("failed to get metadata of MessagePack.KeyAttribute"); - IgnoreAttribute = compilation.GetTypeByMetadataName("MessagePack.IgnoreMemberAttribute"); - if (IgnoreAttribute == null) - { - throw new InvalidOperationException("failed to get metadata of MessagePack.IgnoreMemberAttribute"); - } + IgnoreAttribute = compilation.GetTypeByMetadataName("MessagePack.IgnoreMemberAttribute") + ?? throw new InvalidOperationException("failed to get metadata of MessagePack.IgnoreMemberAttribute"); IgnoreDataMemberAttribute = compilation.GetTypeByMetadataName("System.Runtime.Serialization.IgnoreDataMemberAttribute"); if (IgnoreDataMemberAttribute == null) @@ -85,24 +71,16 @@ public ReferenceSymbols(Compilation compilation, Action logger) logger("failed to get metadata of System.Runtime.Serialization.IgnoreDataMemberAttribute"); } - IMessagePackSerializationCallbackReceiver = compilation.GetTypeByMetadataName("MessagePack.IMessagePackSerializationCallbackReceiver"); - if (IMessagePackSerializationCallbackReceiver == null) - { - throw new InvalidOperationException("failed to get metadata of MessagePack.IMessagePackSerializationCallbackReceiver"); - } + IMessagePackSerializationCallbackReceiver = compilation.GetTypeByMetadataName("MessagePack.IMessagePackSerializationCallbackReceiver") + ?? throw new InvalidOperationException("failed to get metadata of MessagePack.IMessagePackSerializationCallbackReceiver"); - MessagePackFormatterAttribute = compilation.GetTypeByMetadataName("MessagePack.MessagePackFormatterAttribute"); - if (MessagePackFormatterAttribute == null) - { - throw new InvalidOperationException("failed to get metadata of MessagePack.MessagePackFormatterAttribute"); - } + MessagePackFormatterAttribute = compilation.GetTypeByMetadataName("MessagePack.MessagePackFormatterAttribute") + ?? throw new InvalidOperationException("failed to get metadata of MessagePack.MessagePackFormatterAttribute"); } } public class TypeCollector { - private const string CodegeneratorOnlyPreprocessorSymbol = "INCLUDE_ONLY_CODE_GENERATION"; - private static readonly SymbolDisplayFormat BinaryWriteFormat = new SymbolDisplayFormat( genericsOptions: SymbolDisplayGenericsOptions.IncludeTypeParameters, miscellaneousOptions: SymbolDisplayMiscellaneousOptions.ExpandNullable, @@ -114,7 +92,7 @@ public class TypeCollector private readonly bool isForceUseMap; private readonly ReferenceSymbols typeReferences; private readonly INamedTypeSymbol[] targetTypes; - private readonly HashSet embeddedTypes = new HashSet(new string[] + private readonly HashSet embeddedTypes = new(new[] { "short", "int", @@ -185,7 +163,7 @@ public class TypeCollector "System.Reactive.Unit", }); - private readonly Dictionary knownGenericTypes = new Dictionary + private readonly Dictionary knownGenericTypes = new() { #pragma warning disable SA1509 // Opening braces should not be preceded by blank line { "System.Collections.Generic.List<>", "global::MessagePack.Formatters.ListFormatter" }, @@ -261,22 +239,21 @@ public class TypeCollector #pragma warning restore SA1509 // Opening braces should not be preceded by blank line }; - private readonly Action logger; - private readonly bool disallowInternal; - private HashSet externalIgnoreTypeNames; + private readonly HashSet externalIgnoreTypeNames; // visitor workspace: - private HashSet alreadyCollected; - private List collectedObjectInfo; - private List collectedEnumInfo; - private List collectedGenericInfo; - private List collectedUnionInfo; - - public TypeCollector(Compilation compilation, bool disallowInternal, bool isForceUseMap, string[] ignoreTypeNames, Action logger) +#pragma warning disable RS1024 // Compare symbols correctly (https://github.com/dotnet/roslyn-analyzers/issues/5246) + private readonly HashSet alreadyCollected = new(SymbolEqualityComparer.Default); +#pragma warning restore RS1024 // Compare symbols correctly + private readonly List collectedObjectInfo = new(); + private readonly List collectedEnumInfo = new(); + private readonly List collectedGenericInfo = new(); + private readonly List collectedUnionInfo = new(); + + public TypeCollector(Compilation compilation, bool disallowInternal, bool isForceUseMap, string[]? ignoreTypeNames, Action logger) { - this.logger = logger; this.typeReferences = new ReferenceSymbols(compilation, logger); this.disallowInternal = disallowInternal; this.isForceUseMap = isForceUseMap; @@ -307,11 +284,11 @@ public TypeCollector(Compilation compilation, bool disallowInternal, bool isForc private void ResetWorkspace() { - this.alreadyCollected = new HashSet(); - this.collectedObjectInfo = new List(); - this.collectedEnumInfo = new List(); - this.collectedGenericInfo = new List(); - this.collectedUnionInfo = new List(); + this.alreadyCollected.Clear(); + this.collectedObjectInfo.Clear(); + this.collectedEnumInfo.Clear(); + this.collectedGenericInfo.Clear(); + this.collectedUnionInfo.Clear(); } // EntryPoint @@ -339,19 +316,20 @@ private void CollectCore(ITypeSymbol typeSymbol) return; } - if (this.embeddedTypes.Contains(typeSymbol.ToString())) + var typeSymbolString = typeSymbol.ToString() ?? throw new InvalidOperationException(); + if (this.embeddedTypes.Contains(typeSymbolString)) { return; } - if (this.externalIgnoreTypeNames.Contains(typeSymbol.ToString())) + if (this.externalIgnoreTypeNames.Contains(typeSymbolString)) { return; } - if (typeSymbol.TypeKind == TypeKind.Array) + if (typeSymbol is IArrayTypeSymbol arrayTypeSymbol) { - this.CollectArray(typeSymbol as IArrayTypeSymbol); + this.CollectArray(arrayTypeSymbol); return; } @@ -371,9 +349,9 @@ private void CollectCore(ITypeSymbol typeSymbol) return; } - if (typeSymbol.TypeKind == TypeKind.Enum) + if (type.EnumUnderlyingType != null) { - this.CollectEnum(type); + this.CollectEnum(type, type.EnumUnderlyingType); return; } @@ -401,62 +379,57 @@ private void CollectCore(ITypeSymbol typeSymbol) } this.CollectObject(type); - return; } - private void CollectEnum(INamedTypeSymbol type) + private void CollectEnum(INamedTypeSymbol type, ISymbol enumUnderlyingType) { - var info = new EnumSerializationInfo - { - Name = type.ToDisplayString(ShortTypeNameFormat).Replace(".", "_"), - Namespace = type.ContainingNamespace.IsGlobalNamespace ? null : type.ContainingNamespace.ToDisplayString(), - FullName = type.ToDisplayString(SymbolDisplayFormat.FullyQualifiedFormat), - UnderlyingType = type.EnumUnderlyingType.ToDisplayString(BinaryWriteFormat), - }; - + var info = new EnumSerializationInfo(type.ContainingNamespace.IsGlobalNamespace ? null : type.ContainingNamespace.ToDisplayString(), type.ToDisplayString(ShortTypeNameFormat).Replace(".", "_"), type.ToDisplayString(SymbolDisplayFormat.FullyQualifiedFormat), enumUnderlyingType.ToDisplayString(BinaryWriteFormat)); this.collectedEnumInfo.Add(info); } private void CollectUnion(INamedTypeSymbol type) { - System.Collections.Immutable.ImmutableArray[] unionAttrs = type.GetAttributes().Where(x => x.AttributeClass.ApproximatelyEqual(this.typeReferences.UnionAttribute)).Select(x => x.ConstructorArguments).ToArray(); + ImmutableArray[] unionAttrs = type.GetAttributes().Where(x => x.AttributeClass.ApproximatelyEqual(this.typeReferences.UnionAttribute)).Select(x => x.ConstructorArguments).ToArray(); if (unionAttrs.Length == 0) { throw new MessagePackGeneratorResolveFailedException("Serialization Type must mark UnionAttribute." + " type: " + type.ToDisplayString(SymbolDisplayFormat.FullyQualifiedFormat)); } // 0, Int 1, SubType - var info = new UnionSerializationInfo + UnionSubTypeInfo UnionSubTypeInfoSelector(ImmutableArray x) { - Name = type.Name, - Namespace = type.ContainingNamespace.IsGlobalNamespace ? null : type.ContainingNamespace.ToDisplayString(), - FullName = type.ToDisplayString(SymbolDisplayFormat.FullyQualifiedFormat), - SubTypes = unionAttrs.Select(x => new UnionSubTypeInfo + if (!(x[0] is { Value: int key }) || !(x[1] is { Value: ITypeSymbol typeSymbol })) { - Key = (int)x[0].Value, - Type = x[1].Value is ITypeSymbol typeSymbol ? typeSymbol.ToDisplayString(SymbolDisplayFormat.FullyQualifiedFormat) : throw new NotSupportedException($"AOT code generation only supports UnionAttribute that uses a Type parameter, but the {type.ToDisplayString(SymbolDisplayFormat.CSharpErrorMessageFormat)} type uses an unsupported parameter."), - }).OrderBy(x => x.Key).ToArray(), - }; + throw new NotSupportedException("AOT code generation only supports UnionAttribute that uses a Type parameter, but the " + type.ToDisplayString(SymbolDisplayFormat.CSharpErrorMessageFormat) + " type uses an unsupported parameter."); + } + + var typeName = typeSymbol.ToDisplayString(SymbolDisplayFormat.FullyQualifiedFormat); + return new UnionSubTypeInfo(key, typeName); + } + + var info = new UnionSerializationInfo(type.ContainingNamespace.IsGlobalNamespace ? null : type.ContainingNamespace.ToDisplayString(), type.Name, type.ToDisplayString(SymbolDisplayFormat.FullyQualifiedFormat), unionAttrs.Select(UnionSubTypeInfoSelector).OrderBy(x => x.Key).ToArray()); this.collectedUnionInfo.Add(info); } private void CollectGenericUnion(INamedTypeSymbol type) { - System.Collections.Immutable.ImmutableArray[] unionAttrs = type.GetAttributes().Where(x => x.AttributeClass.ApproximatelyEqual(this.typeReferences.UnionAttribute)).Select(x => x.ConstructorArguments).ToArray(); - if (unionAttrs.Length == 0) + var unionAttrs = type.GetAttributes().Where(x => x.AttributeClass.ApproximatelyEqual(this.typeReferences.UnionAttribute)).Select(x => x.ConstructorArguments); + using var enumerator = unionAttrs.GetEnumerator(); + if (!enumerator.MoveNext()) { return; } - var subTypes = unionAttrs.Select(x => x[1].Value).OfType().ToArray(); - foreach (var unionType in subTypes) + do { - if (alreadyCollected.Contains(unionType) == false) + var x = enumerator.Current; + if (x[1] is { Value: INamedTypeSymbol unionType } && alreadyCollected.Contains(unionType) == false) { CollectCore(unionType); } } + while (enumerator.MoveNext()); } private void CollectArray(IArrayTypeSymbol array) @@ -464,36 +437,26 @@ private void CollectArray(IArrayTypeSymbol array) ITypeSymbol elemType = array.ElementType; this.CollectCore(elemType); - var info = new GenericSerializationInfo - { - FullName = array.ToDisplayString(SymbolDisplayFormat.FullyQualifiedFormat), - IsOpenGenericType = elemType is ITypeParameterSymbol, - }; - + var fullName = array.ToDisplayString(SymbolDisplayFormat.FullyQualifiedFormat); + var elementTypeDisplayName = elemType.ToDisplayString(SymbolDisplayFormat.FullyQualifiedFormat); + string formatterName; if (array.IsSZArray) { - info.FormatterName = $"global::MessagePack.Formatters.ArrayFormatter<{elemType.ToDisplayString(SymbolDisplayFormat.FullyQualifiedFormat)}>"; - } - else if (array.Rank == 2) - { - info.FormatterName = $"global::MessagePack.Formatters.TwoDimensionalArrayFormatter<{elemType.ToDisplayString(SymbolDisplayFormat.FullyQualifiedFormat)}>"; - } - else if (array.Rank == 3) - { - info.FormatterName = $"global::MessagePack.Formatters.ThreeDimensionalArrayFormatter<{elemType.ToDisplayString(SymbolDisplayFormat.FullyQualifiedFormat)}>"; - } - else if (array.Rank == 4) - { - info.FormatterName = $"global::MessagePack.Formatters.FourDimensionalArrayFormatter<{elemType.ToDisplayString(SymbolDisplayFormat.FullyQualifiedFormat)}>"; + formatterName = "global::MessagePack.Formatters.ArrayFormatter<" + elementTypeDisplayName + ">"; } else { - throw new InvalidOperationException("does not supports array dimension, " + info.FullName); + formatterName = array.Rank switch + { + 2 => "global::MessagePack.Formatters.TwoDimensionalArrayFormatter<" + elementTypeDisplayName + ">", + 3 => "global::MessagePack.Formatters.ThreeDimensionalArrayFormatter<" + elementTypeDisplayName + ">", + 4 => "global::MessagePack.Formatters.FourDimensionalArrayFormatter<" + elementTypeDisplayName + ">", + _ => throw new InvalidOperationException("does not supports array dimension, " + fullName), + }; } + var info = new GenericSerializationInfo(fullName, formatterName, elemType is ITypeParameterSymbol); this.collectedGenericInfo.Add(info); - - return; } private void CollectGeneric(INamedTypeSymbol type) @@ -512,20 +475,16 @@ private void CollectGeneric(INamedTypeSymbol type) // nullable if (genericTypeString == "T?") { - this.CollectCore(type.TypeArguments[0]); + var firstTypeArgument = type.TypeArguments[0]; + this.CollectCore(firstTypeArgument); - if (!this.embeddedTypes.Contains(type.TypeArguments[0].ToString())) + if (this.embeddedTypes.Contains(firstTypeArgument.ToString()!)) { - var info = new GenericSerializationInfo - { - FormatterName = $"global::MessagePack.Formatters.NullableFormatter<{type.TypeArguments[0].ToDisplayString(SymbolDisplayFormat.FullyQualifiedFormat)}>", - FullName = type.ToDisplayString(SymbolDisplayFormat.FullyQualifiedFormat), - IsOpenGenericType = isOpenGenericType, - }; - - this.collectedGenericInfo.Add(info); + return; } + var info = new GenericSerializationInfo(type.ToDisplayString(SymbolDisplayFormat.FullyQualifiedFormat), "global::MessagePack.Formatters.NullableFormatter<" + firstTypeArgument.ToDisplayString(SymbolDisplayFormat.FullyQualifiedFormat) + ">", isOpenGenericType); + this.collectedGenericInfo.Add(info); return; } @@ -540,43 +499,27 @@ private void CollectGeneric(INamedTypeSymbol type) var typeArgs = string.Join(", ", type.TypeArguments.Select(x => x.ToDisplayString(SymbolDisplayFormat.FullyQualifiedFormat))); var f = formatter.Replace("TREPLACE", typeArgs); - var info = new GenericSerializationInfo - { - FormatterName = f, - FullName = type.ToDisplayString(SymbolDisplayFormat.FullyQualifiedFormat), - IsOpenGenericType = isOpenGenericType, - }; + var info = new GenericSerializationInfo(type.ToDisplayString(SymbolDisplayFormat.FullyQualifiedFormat), f, isOpenGenericType); this.collectedGenericInfo.Add(info); - if (genericTypeString == "System.Linq.ILookup<,>") + if (genericTypeString != "System.Linq.ILookup<,>") { - formatter = this.knownGenericTypes["System.Linq.IGrouping<,>"]; - f = formatter.Replace("TREPLACE", typeArgs); - - var groupingInfo = new GenericSerializationInfo - { - FormatterName = f, - FullName = $"global::System.Linq.IGrouping<{typeArgs}>", - IsOpenGenericType = isOpenGenericType, - }; - - this.collectedGenericInfo.Add(groupingInfo); + return; + } - formatter = this.knownGenericTypes["System.Collections.Generic.IEnumerable<>"]; - typeArgs = type.TypeArguments[1].ToDisplayString(SymbolDisplayFormat.FullyQualifiedFormat); - f = formatter.Replace("TREPLACE", typeArgs); + formatter = this.knownGenericTypes["System.Linq.IGrouping<,>"]; + f = formatter.Replace("TREPLACE", typeArgs); - var enumerableInfo = new GenericSerializationInfo - { - FormatterName = f, - FullName = $"global::System.Collections.Generic.IEnumerable<{typeArgs}>", - IsOpenGenericType = isOpenGenericType, - }; + var groupingInfo = new GenericSerializationInfo("global::System.Linq.IGrouping<" + typeArgs + ">", f, isOpenGenericType); + this.collectedGenericInfo.Add(groupingInfo); - this.collectedGenericInfo.Add(enumerableInfo); - } + formatter = this.knownGenericTypes["System.Collections.Generic.IEnumerable<>"]; + typeArgs = type.TypeArguments[1].ToDisplayString(SymbolDisplayFormat.FullyQualifiedFormat); + f = formatter.Replace("TREPLACE", typeArgs); + var enumerableInfo = new GenericSerializationInfo("global::System.Collections.Generic.IEnumerable<" + typeArgs + ">", f, isOpenGenericType); + this.collectedGenericInfo.Add(enumerableInfo); return; } @@ -593,6 +536,9 @@ private void CollectGeneric(INamedTypeSymbol type) // NOTE: It is used to register formatters from nested generic type. // However, closed generic types such as `Foo` are not registered as a formatter. GetObjectInfo(type); + + // Collect generic type definition, that is not collected when it is defined outside target project. + CollectCore(type.OriginalDefinition); } // Collect substituted types for the type parameters (e.g. Bar in Foo) @@ -609,16 +555,23 @@ private void CollectGeneric(INamedTypeSymbol type) formatterBuilder.Append(type.Name); formatterBuilder.Append("Formatter<"); - formatterBuilder.Append(string.Join(", ", type.TypeArguments.Select(x => x.ToDisplayString(SymbolDisplayFormat.FullyQualifiedFormat)))); - formatterBuilder.Append(">"); - - var genericSerializationInfo = new GenericSerializationInfo + var typeArgumentIterator = type.TypeArguments.GetEnumerator(); { - FullName = type.ToDisplayString(SymbolDisplayFormat.FullyQualifiedFormat), - FormatterName = formatterBuilder.ToString(), - IsOpenGenericType = isOpenGenericType, - }; + if (typeArgumentIterator.MoveNext()) + { + formatterBuilder.Append(typeArgumentIterator.Current.ToDisplayString(SymbolDisplayFormat.FullyQualifiedFormat)); + } + + while (typeArgumentIterator.MoveNext()) + { + formatterBuilder.Append(", "); + formatterBuilder.Append(typeArgumentIterator.Current.ToDisplayString(SymbolDisplayFormat.FullyQualifiedFormat)); + } + } + formatterBuilder.Append('>'); + + var genericSerializationInfo = new GenericSerializationInfo(type.ToDisplayString(SymbolDisplayFormat.FullyQualifiedFormat), formatterBuilder.ToString(), isOpenGenericType); this.collectedGenericInfo.Add(genericSerializationInfo); } @@ -633,17 +586,14 @@ private ObjectSerializationInfo GetObjectInfo(INamedTypeSymbol type) var isClass = !type.IsValueType; var isOpenGenericType = type.IsGenericType; - AttributeData contractAttr = type.GetAttributes().FirstOrDefault(x => x.AttributeClass.ApproximatelyEqual(this.typeReferences.MessagePackObjectAttribute)); - if (contractAttr == null) - { - throw new MessagePackGeneratorResolveFailedException("Serialization Object must mark MessagePackObjectAttribute." + " type: " + type.ToDisplayString(SymbolDisplayFormat.FullyQualifiedFormat)); - } + AttributeData contractAttr = type.GetAttributes().FirstOrDefault(x => x.AttributeClass.ApproximatelyEqual(this.typeReferences.MessagePackObjectAttribute)) + ?? throw new MessagePackGeneratorResolveFailedException("Serialization Object must mark MessagePackObjectAttribute." + " type: " + type.ToDisplayString(SymbolDisplayFormat.FullyQualifiedFormat)); var isIntKey = true; var intMembers = new Dictionary(); var stringMembers = new Dictionary(); - if (this.isForceUseMap || (bool)contractAttr.ConstructorArguments[0].Value) + if (this.isForceUseMap || (contractAttr.ConstructorArguments[0] is { Value: bool firstConstructorArgument } && firstConstructorArgument)) { // All public members are serialize target except [Ignore] member. isIntKey = false; @@ -652,31 +602,20 @@ private ObjectSerializationInfo GetObjectInfo(INamedTypeSymbol type) foreach (IPropertySymbol item in type.GetAllMembers().OfType().Where(x => !x.IsOverride)) { - if (item.GetAttributes().Any(x => x.AttributeClass.ApproximatelyEqual(this.typeReferences.IgnoreAttribute) || x.AttributeClass.Name == this.typeReferences.IgnoreDataMemberAttribute.Name)) + if (item.GetAttributes().Any(x => (x.AttributeClass.ApproximatelyEqual(this.typeReferences.IgnoreAttribute) || x.AttributeClass?.Name == this.typeReferences.IgnoreDataMemberAttribute?.Name))) { continue; } - var customFormatterAttr = item.GetAttributes().FirstOrDefault(x => x.AttributeClass.ApproximatelyEqual(this.typeReferences.MessagePackFormatterAttribute))?.ConstructorArguments[0].Value as INamedTypeSymbol; - - var member = new MemberSerializationInfo - { - IsReadable = (item.GetMethod != null) && item.GetMethod.DeclaredAccessibility == Accessibility.Public && !item.IsStatic, - IsWritable = (item.SetMethod != null) && item.SetMethod.DeclaredAccessibility == Accessibility.Public && !item.IsStatic, - StringKey = item.Name, - IsProperty = true, - IsField = false, - Name = item.Name, - Type = item.Type.ToDisplayString(SymbolDisplayFormat.FullyQualifiedFormat), - ShortTypeName = item.Type.ToDisplayString(BinaryWriteFormat), - CustomFormatterTypeName = customFormatterAttr?.ToDisplayString(SymbolDisplayFormat.FullyQualifiedFormat), - }; - if (!member.IsReadable && !member.IsWritable) + var isReadable = item.GetMethod != null && item.GetMethod.DeclaredAccessibility == Accessibility.Public && !item.IsStatic; + var isWritable = item.SetMethod != null && item.SetMethod.DeclaredAccessibility == Accessibility.Public && !item.IsStatic; + if (!isReadable && !isWritable) { continue; } - member.IntKey = hiddenIntKey++; + var customFormatterAttr = item.GetAttributes().FirstOrDefault(x => x.AttributeClass.ApproximatelyEqual(this.typeReferences.MessagePackFormatterAttribute))?.ConstructorArguments[0].Value as INamedTypeSymbol; + var member = new MemberSerializationInfo(true, isWritable, isReadable, hiddenIntKey++, item.Name, item.Name, item.Type.ToDisplayString(SymbolDisplayFormat.FullyQualifiedFormat), item.Type.ToDisplayString(BinaryWriteFormat), customFormatterAttr?.ToDisplayString(SymbolDisplayFormat.FullyQualifiedFormat)); stringMembers.Add(member.StringKey, member); this.CollectCore(item.Type); // recursive collect @@ -684,7 +623,7 @@ private ObjectSerializationInfo GetObjectInfo(INamedTypeSymbol type) foreach (IFieldSymbol item in type.GetAllMembers().OfType()) { - if (item.GetAttributes().Any(x => x.AttributeClass.ApproximatelyEqual(this.typeReferences.IgnoreAttribute) || x.AttributeClass.Name == this.typeReferences.IgnoreDataMemberAttribute.Name)) + if (item.GetAttributes().Any(x => (x.AttributeClass.ApproximatelyEqual(this.typeReferences.IgnoreAttribute) || x.AttributeClass?.Name == this.typeReferences.IgnoreDataMemberAttribute?.Name))) { continue; } @@ -694,26 +633,15 @@ private ObjectSerializationInfo GetObjectInfo(INamedTypeSymbol type) continue; } - var customFormatterAttr = item.GetAttributes().FirstOrDefault(x => x.AttributeClass.ApproximatelyEqual(this.typeReferences.MessagePackFormatterAttribute))?.ConstructorArguments[0].Value as INamedTypeSymbol; - - var member = new MemberSerializationInfo - { - IsReadable = item.DeclaredAccessibility == Accessibility.Public && !item.IsStatic, - IsWritable = item.DeclaredAccessibility == Accessibility.Public && !item.IsReadOnly && !item.IsStatic, - StringKey = item.Name, - IsProperty = false, - IsField = true, - Name = item.Name, - Type = item.Type.ToDisplayString(SymbolDisplayFormat.FullyQualifiedFormat), - ShortTypeName = item.Type.ToDisplayString(BinaryWriteFormat), - CustomFormatterTypeName = customFormatterAttr?.ToDisplayString(SymbolDisplayFormat.FullyQualifiedFormat), - }; - if (!member.IsReadable && !member.IsWritable) + var isReadable = item.DeclaredAccessibility == Accessibility.Public && !item.IsStatic; + var isWritable = item.DeclaredAccessibility == Accessibility.Public && !item.IsReadOnly && !item.IsStatic; + if (!isReadable && !isWritable) { continue; } - member.IntKey = hiddenIntKey++; + var customFormatterAttr = item.GetAttributes().FirstOrDefault(x => x.AttributeClass.ApproximatelyEqual(this.typeReferences.MessagePackFormatterAttribute))?.ConstructorArguments[0].Value as INamedTypeSymbol; + var member = new MemberSerializationInfo(false, isWritable, isReadable, hiddenIntKey++, item.Name, item.Name, item.Type.ToDisplayString(SymbolDisplayFormat.FullyQualifiedFormat), item.Type.ToDisplayString(BinaryWriteFormat), customFormatterAttr?.ToDisplayString(SymbolDisplayFormat.FullyQualifiedFormat)); stringMembers.Add(member.StringKey, member); this.CollectCore(item.Type); // recursive collect } @@ -731,37 +659,28 @@ private ObjectSerializationInfo GetObjectInfo(INamedTypeSymbol type) continue; // .tt files don't generate good code for this yet: https://github.com/neuecc/MessagePack-CSharp/issues/390 } - if (item.GetAttributes().Any(x => x.AttributeClass.ApproximatelyEqual(this.typeReferences.IgnoreAttribute) || x.AttributeClass.ApproximatelyEqual(this.typeReferences.IgnoreDataMemberAttribute))) + if (item.GetAttributes().Any(x => + { + var typeReferencesIgnoreDataMemberAttribute = this.typeReferences.IgnoreDataMemberAttribute; + return typeReferencesIgnoreDataMemberAttribute != null && (x.AttributeClass.ApproximatelyEqual(this.typeReferences.IgnoreAttribute) || x.AttributeClass.ApproximatelyEqual(typeReferencesIgnoreDataMemberAttribute)); + })) { continue; } - var customFormatterAttr = item.GetAttributes().FirstOrDefault(x => x.AttributeClass.ApproximatelyEqual(this.typeReferences.MessagePackFormatterAttribute))?.ConstructorArguments[0].Value as INamedTypeSymbol; - - var member = new MemberSerializationInfo - { - IsReadable = (item.GetMethod != null) && item.GetMethod.DeclaredAccessibility == Accessibility.Public && !item.IsStatic, - IsWritable = (item.SetMethod != null) && item.SetMethod.DeclaredAccessibility == Accessibility.Public && !item.IsStatic, - IsProperty = true, - IsField = false, - Name = item.Name, - Type = item.Type.ToDisplayString(SymbolDisplayFormat.FullyQualifiedFormat), - ShortTypeName = item.Type.ToDisplayString(BinaryWriteFormat), - CustomFormatterTypeName = customFormatterAttr?.ToDisplayString(SymbolDisplayFormat.FullyQualifiedFormat), - }; - if (!member.IsReadable && !member.IsWritable) + var isReadable = item.GetMethod != null && item.GetMethod.DeclaredAccessibility == Accessibility.Public && !item.IsStatic; + var isWritable = item.SetMethod != null && item.SetMethod.DeclaredAccessibility == Accessibility.Public && !item.IsStatic; + if (!isReadable && !isWritable) { continue; } - TypedConstant? key = item.GetAttributes().FirstOrDefault(x => x.AttributeClass.ApproximatelyEqual(this.typeReferences.KeyAttribute))?.ConstructorArguments[0]; - if (key == null) - { - throw new MessagePackGeneratorResolveFailedException("all public members must mark KeyAttribute or IgnoreMemberAttribute." + " type: " + type.ToDisplayString(SymbolDisplayFormat.FullyQualifiedFormat) + " member:" + item.Name); - } + var customFormatterAttr = item.GetAttributes().FirstOrDefault(x => x.AttributeClass.ApproximatelyEqual(this.typeReferences.MessagePackFormatterAttribute))?.ConstructorArguments[0].Value as INamedTypeSymbol; + var key = item.GetAttributes().FirstOrDefault(x => x.AttributeClass.ApproximatelyEqual(this.typeReferences.KeyAttribute))?.ConstructorArguments[0] + ?? throw new MessagePackGeneratorResolveFailedException("all public members must mark KeyAttribute or IgnoreMemberAttribute." + " type: " + type.ToDisplayString(SymbolDisplayFormat.FullyQualifiedFormat) + " member:" + item.Name); - var intKey = (key.Value.Value is int) ? (int)key.Value.Value : (int?)null; - var stringKey = (key.Value.Value is string) ? (string)key.Value.Value : (string)null; + var intKey = key is { Value: int intKeyValue } ? intKeyValue : default(int?); + var stringKey = key is { Value: string stringKeyValue } ? stringKeyValue : default; if (intKey == null && stringKey == null) { throw new MessagePackGeneratorResolveFailedException("both IntKey and StringKey are null." + " type: " + type.ToDisplayString(SymbolDisplayFormat.FullyQualifiedFormat) + " member:" + item.Name); @@ -782,27 +701,31 @@ private ObjectSerializationInfo GetObjectInfo(INamedTypeSymbol type) if (isIntKey) { - member.IntKey = (int)intKey; - if (intMembers.ContainsKey(member.IntKey)) + if (intMembers.ContainsKey(intKey!.Value)) { throw new MessagePackGeneratorResolveFailedException("key is duplicated, all members key must be unique." + " type: " + type.ToDisplayString(SymbolDisplayFormat.FullyQualifiedFormat) + " member:" + item.Name); } + var member = new MemberSerializationInfo(true, isWritable, isReadable, intKey!.Value, item.Name, item.Name, item.Type.ToDisplayString(SymbolDisplayFormat.FullyQualifiedFormat), item.Type.ToDisplayString(BinaryWriteFormat), customFormatterAttr?.ToDisplayString(SymbolDisplayFormat.FullyQualifiedFormat)); intMembers.Add(member.IntKey, member); } else { - member.StringKey = (string)stringKey; - if (stringMembers.ContainsKey(member.StringKey)) + if (stringMembers.ContainsKey(stringKey!)) { throw new MessagePackGeneratorResolveFailedException("key is duplicated, all members key must be unique." + " type: " + type.ToDisplayString(SymbolDisplayFormat.FullyQualifiedFormat) + " member:" + item.Name); } - member.IntKey = hiddenIntKey++; + var member = new MemberSerializationInfo(true, isWritable, isReadable, hiddenIntKey++, stringKey!, item.Name, item.Type.ToDisplayString(SymbolDisplayFormat.FullyQualifiedFormat), item.Type.ToDisplayString(BinaryWriteFormat), customFormatterAttr?.ToDisplayString(SymbolDisplayFormat.FullyQualifiedFormat)); stringMembers.Add(member.StringKey, member); } - this.CollectCore(item.Type); // recursive collect + var messagePackFormatter = item.GetAttributes().FirstOrDefault(x => x.AttributeClass.ApproximatelyEqual(this.typeReferences.MessagePackFormatterAttribute))?.ConstructorArguments[0]; + + if (messagePackFormatter == null) + { + this.CollectCore(item.Type); // recursive collect + } } foreach (IFieldSymbol item in type.GetAllMembers().OfType()) @@ -817,32 +740,19 @@ private ObjectSerializationInfo GetObjectInfo(INamedTypeSymbol type) continue; } - var customFormatterAttr = item.GetAttributes().FirstOrDefault(x => x.AttributeClass.ApproximatelyEqual(this.typeReferences.MessagePackFormatterAttribute))?.ConstructorArguments[0].Value as INamedTypeSymbol; - - var member = new MemberSerializationInfo - { - IsReadable = item.DeclaredAccessibility == Accessibility.Public && !item.IsStatic, - IsWritable = item.DeclaredAccessibility == Accessibility.Public && !item.IsReadOnly && !item.IsStatic, - IsProperty = true, - IsField = false, - Name = item.Name, - Type = item.Type.ToDisplayString(SymbolDisplayFormat.FullyQualifiedFormat), - ShortTypeName = item.Type.ToDisplayString(BinaryWriteFormat), - CustomFormatterTypeName = customFormatterAttr?.ToDisplayString(SymbolDisplayFormat.FullyQualifiedFormat), - }; - if (!member.IsReadable && !member.IsWritable) + var isReadable = item.DeclaredAccessibility == Accessibility.Public && !item.IsStatic; + var isWritable = item.DeclaredAccessibility == Accessibility.Public && !item.IsReadOnly && !item.IsStatic; + if (!isReadable && !isWritable) { continue; } - TypedConstant? key = item.GetAttributes().FirstOrDefault(x => x.AttributeClass.ApproximatelyEqual(this.typeReferences.KeyAttribute))?.ConstructorArguments[0]; - if (key == null) - { - throw new MessagePackGeneratorResolveFailedException("all public members must mark KeyAttribute or IgnoreMemberAttribute." + " type: " + type.ToDisplayString(SymbolDisplayFormat.FullyQualifiedFormat) + " member:" + item.Name); - } + var customFormatterAttr = item.GetAttributes().FirstOrDefault(x => x.AttributeClass.ApproximatelyEqual(this.typeReferences.MessagePackFormatterAttribute))?.ConstructorArguments[0].Value as INamedTypeSymbol; + var key = item.GetAttributes().FirstOrDefault(x => x.AttributeClass.ApproximatelyEqual(this.typeReferences.KeyAttribute))?.ConstructorArguments[0] + ?? throw new MessagePackGeneratorResolveFailedException("all public members must mark KeyAttribute or IgnoreMemberAttribute." + " type: " + type.ToDisplayString(SymbolDisplayFormat.FullyQualifiedFormat) + " member:" + item.Name); - var intKey = (key.Value.Value is int) ? (int)key.Value.Value : (int?)null; - var stringKey = (key.Value.Value is string) ? (string)key.Value.Value : (string)null; + var intKey = key is { Value: int intKeyValue } ? intKeyValue : default(int?); + var stringKey = key is { Value: string stringKeyValue } ? stringKeyValue : default; if (intKey == null && stringKey == null) { throw new MessagePackGeneratorResolveFailedException("both IntKey and StringKey are null." + " type: " + type.ToDisplayString(SymbolDisplayFormat.FullyQualifiedFormat) + " member:" + item.Name); @@ -863,23 +773,22 @@ private ObjectSerializationInfo GetObjectInfo(INamedTypeSymbol type) if (isIntKey) { - member.IntKey = (int)intKey; - if (intMembers.ContainsKey(member.IntKey)) + if (intMembers.ContainsKey(intKey!.Value)) { throw new MessagePackGeneratorResolveFailedException("key is duplicated, all members key must be unique." + " type: " + type.ToDisplayString(SymbolDisplayFormat.FullyQualifiedFormat) + " member:" + item.Name); } + var member = new MemberSerializationInfo(true, isWritable, isReadable, intKey!.Value, item.Name, item.Name, item.Type.ToDisplayString(SymbolDisplayFormat.FullyQualifiedFormat), item.Type.ToDisplayString(BinaryWriteFormat), customFormatterAttr?.ToDisplayString(SymbolDisplayFormat.FullyQualifiedFormat)); intMembers.Add(member.IntKey, member); } else { - member.StringKey = (string)stringKey; - if (stringMembers.ContainsKey(member.StringKey)) + if (stringMembers.ContainsKey(stringKey!)) { throw new MessagePackGeneratorResolveFailedException("key is duplicated, all members key must be unique." + " type: " + type.ToDisplayString(SymbolDisplayFormat.FullyQualifiedFormat) + " member:" + item.Name); } - member.IntKey = hiddenIntKey++; + var member = new MemberSerializationInfo(true, isWritable, isReadable, hiddenIntKey++, stringKey!, item.Name, item.Type.ToDisplayString(SymbolDisplayFormat.FullyQualifiedFormat), item.Type.ToDisplayString(BinaryWriteFormat), customFormatterAttr?.ToDisplayString(SymbolDisplayFormat.FullyQualifiedFormat)); stringMembers.Add(member.StringKey, member); } @@ -888,8 +797,8 @@ private ObjectSerializationInfo GetObjectInfo(INamedTypeSymbol type) } // GetConstructor - IEnumerator ctorEnumerator = null; - IMethodSymbol ctor = type.Constructors.Where(x => x.DeclaredAccessibility == Accessibility.Public).SingleOrDefault(x => x.GetAttributes().Any(y => y.AttributeClass.ApproximatelyEqual(this.typeReferences.SerializationConstructorAttribute))); + var ctorEnumerator = default(IEnumerator); + var ctor = type.Constructors.Where(x => x.DeclaredAccessibility == Accessibility.Public).SingleOrDefault(x => x.GetAttributes().Any(y => y.AttributeClass != null && y.AttributeClass.ApproximatelyEqual(this.typeReferences.SerializationConstructorAttribute))); if (ctor == null) { ctorEnumerator = type.Constructors.Where(x => x.DeclaredAccessibility == Accessibility.Public).OrderByDescending(x => x.Parameters.Length).GetEnumerator(); @@ -909,17 +818,17 @@ private ObjectSerializationInfo GetObjectInfo(INamedTypeSymbol type) var constructorParameters = new List(); if (ctor != null) { - ILookup> constructorLookupDictionary = stringMembers.ToLookup(x => x.Key, x => x, StringComparer.OrdinalIgnoreCase); + var constructorLookupDictionary = stringMembers.ToLookup(x => x.Key, x => x, StringComparer.OrdinalIgnoreCase); do { constructorParameters.Clear(); var ctorParamIndex = 0; - foreach (IParameterSymbol item in ctor.Parameters) + foreach (IParameterSymbol item in ctor!.Parameters) { MemberSerializationInfo paramMember; if (isIntKey) { - if (intMembers.TryGetValue(ctorParamIndex, out paramMember)) + if (intMembers.TryGetValue(ctorParamIndex, out paramMember!)) { if (item.Type.ToDisplayString(SymbolDisplayFormat.FullyQualifiedFormat) == paramMember.Type && paramMember.IsReadable) { @@ -954,51 +863,46 @@ private ObjectSerializationInfo GetObjectInfo(INamedTypeSymbol type) else { IEnumerable> hasKey = constructorLookupDictionary[item.Name]; - var len = hasKey.Count(); - if (len != 0) + using var enumerator = hasKey.GetEnumerator(); + // hasKey.Count() == 0 + if (!enumerator.MoveNext()) { - if (len != 1) + if (ctorEnumerator == null) { - if (ctorEnumerator != null) - { - ctor = null; - continue; - } - else - { - throw new MessagePackGeneratorResolveFailedException("duplicate matched constructor parameter name:" + type.ToDisplayString(SymbolDisplayFormat.FullyQualifiedFormat) + " parameterName:" + item.Name + " paramterType:" + item.Type.Name); - } + throw new MessagePackGeneratorResolveFailedException("can't find matched constructor parameter, index not found. type:" + type.ToDisplayString(SymbolDisplayFormat.FullyQualifiedFormat) + " parameterName:" + item.Name); } - paramMember = hasKey.First().Value; - if (item.Type.ToDisplayString(SymbolDisplayFormat.FullyQualifiedFormat) == paramMember.Type && paramMember.IsReadable) - { - constructorParameters.Add(paramMember); - } - else + ctor = null; + continue; + } + + var first = enumerator.Current.Value; + // hasKey.Count() != 1 + if (enumerator.MoveNext()) + { + if (ctorEnumerator == null) { - if (ctorEnumerator != null) - { - ctor = null; - continue; - } - else - { - throw new MessagePackGeneratorResolveFailedException("can't find matched constructor parameter, parameterType mismatch. type:" + type.ToDisplayString(SymbolDisplayFormat.FullyQualifiedFormat) + " parameterName:" + item.Name + " paramterType:" + item.Type.Name); - } + throw new MessagePackGeneratorResolveFailedException("duplicate matched constructor parameter name:" + type.ToDisplayString(SymbolDisplayFormat.FullyQualifiedFormat) + " parameterName:" + item.Name + " paramterType:" + item.Type.Name); } + + ctor = null; + continue; + } + + paramMember = first; + if (item.Type.ToDisplayString(SymbolDisplayFormat.FullyQualifiedFormat) == paramMember.Type && paramMember.IsReadable) + { + constructorParameters.Add(paramMember); } else { - if (ctorEnumerator != null) + if (ctorEnumerator == null) { - ctor = null; - continue; - } - else - { - throw new MessagePackGeneratorResolveFailedException("can't find matched constructor parameter, index not found. type:" + type.ToDisplayString(SymbolDisplayFormat.FullyQualifiedFormat) + " parameterName:" + item.Name); + throw new MessagePackGeneratorResolveFailedException("can't find matched constructor parameter, parameterType mismatch. type:" + type.ToDisplayString(SymbolDisplayFormat.FullyQualifiedFormat) + " parameterName:" + item.Name + " paramterType:" + item.Type.Name); } + + ctor = null; + continue; } } @@ -1022,23 +926,7 @@ private ObjectSerializationInfo GetObjectInfo(INamedTypeSymbol type) needsCastOnAfter = !type.GetMembers("OnAfterDeserialize").Any(); } - var info = new ObjectSerializationInfo - { - IsClass = isClass, - IsOpenGenericType = isOpenGenericType, - GenericTypeParameters = isOpenGenericType - ? type.TypeParameters.Select(ToGenericTypeParameterInfo).ToArray() - : Array.Empty(), - ConstructorParameters = constructorParameters.ToArray(), - IsIntKey = isIntKey, - Members = isIntKey ? intMembers.Values.ToArray() : stringMembers.Values.ToArray(), - Name = isOpenGenericType ? GetGenericFormatterClassName(type) : GetMinimallyQualifiedClassName(type), - FullName = type.ToDisplayString(SymbolDisplayFormat.FullyQualifiedFormat), - Namespace = type.ContainingNamespace.IsGlobalNamespace ? null : type.ContainingNamespace.ToDisplayString(), - HasIMessagePackSerializationCallbackReceiver = hasSerializationConstructor, - NeedsCastOnAfter = needsCastOnAfter, - NeedsCastOnBefore = needsCastOnBefore, - }; + var info = new ObjectSerializationInfo(isClass, isOpenGenericType, isOpenGenericType ? type.TypeParameters.Select(ToGenericTypeParameterInfo).ToArray() : Array.Empty(), constructorParameters.ToArray(), isIntKey, isIntKey ? intMembers.Values.ToArray() : stringMembers.Values.ToArray(), isOpenGenericType ? GetGenericFormatterClassName(type) : GetMinimallyQualifiedClassName(type), type.ToDisplayString(SymbolDisplayFormat.FullyQualifiedFormat), type.ContainingNamespace.IsGlobalNamespace ? null : type.ContainingNamespace.ToDisplayString(), hasSerializationConstructor, needsCastOnAfter, needsCastOnBefore); return info; } @@ -1055,26 +943,12 @@ private static GenericTypeParameterInfo ToGenericTypeParameterInfo(ITypeParamete if (typeParameter.HasReferenceTypeConstraint) { - if (typeParameter.ReferenceTypeConstraintNullableAnnotation == NullableAnnotation.Annotated) - { - constraints.Add("class?"); - } - else - { - constraints.Add("class"); - } + constraints.Add(typeParameter.ReferenceTypeConstraintNullableAnnotation == NullableAnnotation.Annotated ? "class?" : "class"); } if (typeParameter.HasValueTypeConstraint) { - if (typeParameter.HasUnmanagedTypeConstraint) - { - constraints.Add("unmanaged"); - } - else - { - constraints.Add("struct"); - } + constraints.Add(typeParameter.HasUnmanagedTypeConstraint ? "unmanaged" : "struct"); } // constraint types (IDisposable, IEnumerable ...) @@ -1102,14 +976,15 @@ private static string GetMinimallyQualifiedClassName(INamedTypeSymbol type) { var name = type.ContainingType is object ? GetMinimallyQualifiedClassName(type.ContainingType) + "_" : string.Empty; name += type.ToDisplayString(SymbolDisplayFormat.MinimallyQualifiedFormat); - name = name.Replace(".", "_"); - name = name.Replace("<", "_"); - name = name.Replace(">", "_"); + name = name.Replace('.', '_'); + name = name.Replace('<', '_'); + name = name.Replace('>', '_'); name = Regex.Replace(name, @"\[([,])*\]", match => $"Array{match.Length - 1}"); + name = name.Replace("?", string.Empty); return name; } - private static bool TryGetNextConstructor(IEnumerator ctorEnumerator, ref IMethodSymbol ctor) + private static bool TryGetNextConstructor(IEnumerator? ctorEnumerator, ref IMethodSymbol? ctor) { if (ctorEnumerator == null || ctor != null) { diff --git a/src/MessagePack.GeneratorCore/CodeGenerator.cs b/src/MessagePack.GeneratorCore/CodeGenerator.cs index f4dd3d35c..1f48973e3 100644 --- a/src/MessagePack.GeneratorCore/CodeGenerator.cs +++ b/src/MessagePack.GeneratorCore/CodeGenerator.cs @@ -2,6 +2,7 @@ // Licensed under the MIT license. See LICENSE file in the project root for full license information. using System; +using System.Collections.Generic; using System.Diagnostics; using System.IO; using System.Linq; @@ -16,15 +17,15 @@ namespace MessagePackCompiler { public class CodeGenerator { + private static readonly HashSet InvalidFileCharSet = new(Path.GetInvalidFileNameChars()); + private static readonly Encoding NoBomUtf8 = new UTF8Encoding(false); - private Action logger; - private CancellationToken cancellationToken; + private readonly Action logger; public CodeGenerator(Action logger, CancellationToken cancellationToken) { this.logger = logger; - this.cancellationToken = cancellationToken; } /// @@ -42,21 +43,21 @@ public async Task GenerateFileAsync( Compilation compilation, string output, string resolverName, - string @namespace, + string? @namespace, bool useMapMode, - string multipleIfDirectiveOutputSymbols, - string[] externalIgnoreTypeNames) + string? multipleIfDirectiveOutputSymbols, + string[]? externalIgnoreTypeNames) { var namespaceDot = string.IsNullOrWhiteSpace(@namespace) ? string.Empty : @namespace + "."; var multipleOutputSymbols = multipleIfDirectiveOutputSymbols?.Split(',') ?? Array.Empty(); var sw = Stopwatch.StartNew(); - foreach (var multioutSymbol in multipleOutputSymbols.Length == 0 ? new[] { string.Empty } : multipleOutputSymbols) + foreach (var multiOutputSymbol in multipleOutputSymbols.Length == 0 ? new[] { string.Empty } : multipleOutputSymbols) { logger("Project Compilation Start:" + compilation.AssemblyName); - var collector = new TypeCollector(compilation, true, useMapMode, externalIgnoreTypeNames, x => Console.WriteLine(x)); + var collector = new TypeCollector(compilation, true, useMapMode, externalIgnoreTypeNames, Console.WriteLine); logger("Project Compilation Complete:" + sw.Elapsed.ToString()); @@ -73,152 +74,220 @@ public async Task GenerateFileAsync( if (Path.GetExtension(output) == ".cs") { // SingleFile Output - var objectFormatterTemplates = objectInfo - .GroupBy(x => (x.Namespace, x.IsStringKey)) - .Select(x => - { - var (nameSpace, isStringKey) = x.Key; - var objectSerializationInfos = x.ToArray(); - var template = isStringKey ? new StringKeyFormatterTemplate() : (IFormatterTemplate)new FormatterTemplate(); + var fullGeneratedProgramText = GenerateSingleFileSync(resolverName, namespaceDot, objectInfo, enumInfo, unionInfo, genericInfo); + if (multiOutputSymbol == string.Empty) + { + await OutputAsync(output, fullGeneratedProgramText); + } + else + { + var fname = Path.GetFileNameWithoutExtension(output) + "." + MultiSymbolToSafeFilePath(multiOutputSymbol) + ".cs"; + var text = $"#if {multiOutputSymbol}" + Environment.NewLine + fullGeneratedProgramText + Environment.NewLine + "#endif"; + await OutputAsync(Path.Combine(Path.GetDirectoryName(output) ?? string.Empty, fname), text); + } + } + else + { + // Multiple File output + await GenerateMultipleFileAsync(output, resolverName, objectInfo, enumInfo, unionInfo, namespaceDot, multiOutputSymbol, genericInfo); + } - template.Namespace = namespaceDot + "Formatters" + (nameSpace is null ? string.Empty : "." + nameSpace); - template.ObjectSerializationInfos = objectSerializationInfos; + if (objectInfo.Length == 0 && enumInfo.Length == 0 && genericInfo.Length == 0 && unionInfo.Length == 0) + { + logger("Generated result is empty, unexpected result?"); + } + } - return template; - }) - .ToArray(); + logger("Output Generation Complete:" + sw.Elapsed.ToString()); + } - var enumFormatterTemplates = enumInfo - .GroupBy(x => x.Namespace) - .Select(x => new EnumTemplate() - { - Namespace = namespaceDot + "Formatters" + ((x.Key == null) ? string.Empty : "." + x.Key), - EnumSerializationInfos = x.ToArray(), - }) - .ToArray(); - - var unionFormatterTemplates = unionInfo - .GroupBy(x => x.Namespace) - .Select(x => new UnionTemplate() - { - Namespace = namespaceDot + "Formatters" + ((x.Key == null) ? string.Empty : "." + x.Key), - UnionSerializationInfos = x.ToArray(), - }) - .ToArray(); + /// + /// Generates the specialized resolver and formatters for the types that require serialization in a given compilation. + /// + /// The resolver name. + /// The namespace for the generated type to be created in. + /// The ObjectSerializationInfo array which TypeCollector.Collect returns. + /// The EnumSerializationInfo array which TypeCollector.Collect returns. + /// The UnionSerializationInfo array which TypeCollector.Collect returns. + /// The GenericSerializationInfo array which TypeCollector.Collect returns. + public static string GenerateSingleFileSync(string resolverName, string namespaceDot, ObjectSerializationInfo[] objectInfo, EnumSerializationInfo[] enumInfo, UnionSerializationInfo[] unionInfo, GenericSerializationInfo[] genericInfo) + { + var objectFormatterTemplates = objectInfo + .GroupBy(x => (x.Namespace, x.IsStringKey)) + .Select(x => + { + var (nameSpace, isStringKey) = x.Key; + var objectSerializationInfos = x.ToArray(); + var ns = namespaceDot + "Formatters" + (nameSpace is null ? string.Empty : "." + nameSpace); + var template = isStringKey ? new StringKeyFormatterTemplate(ns, objectSerializationInfos) : (IFormatterTemplate)new FormatterTemplate(ns, objectSerializationInfos); + return template; + }) + .ToArray(); + + string GetNamespace(IGrouping x) + { + if (x.Key == null) + { + return namespaceDot + "Formatters"; + } - var resolverTemplate = new ResolverTemplate() - { - Namespace = namespaceDot + "Resolvers", - FormatterNamespace = namespaceDot + "Formatters", - ResolverName = resolverName, - RegisterInfos = genericInfo.Where(x => !x.IsOpenGenericType).Cast().Concat(enumInfo).Concat(unionInfo).Concat(objectInfo.Where(x => !x.IsOpenGenericType)).ToArray(), - }; - - var sb = new StringBuilder(); - sb.AppendLine(resolverTemplate.TransformText()); - sb.AppendLine(); - foreach (var item in enumFormatterTemplates) - { - var text = item.TransformText(); - sb.AppendLine(text); - } + return namespaceDot + "Formatters." + x.Key; + } - sb.AppendLine(); - foreach (var item in unionFormatterTemplates) - { - var text = item.TransformText(); - sb.AppendLine(text); - } + var enumFormatterTemplates = enumInfo + .GroupBy(x => x.Namespace) + .Select(x => new EnumTemplate(GetNamespace(x), x.ToArray())) + .ToArray(); - sb.AppendLine(); - foreach (var item in objectFormatterTemplates) - { - var text = item.TransformText(); - sb.AppendLine(text); - } + var unionFormatterTemplates = unionInfo + .GroupBy(x => x.Namespace) + .Select(x => new UnionTemplate(GetNamespace(x), x.ToArray())) + .ToArray(); - if (multioutSymbol == string.Empty) - { - await OutputAsync(output, sb.ToString(), cancellationToken); - } - else + var resolverTemplate = new ResolverTemplate(namespaceDot + "Resolvers", namespaceDot + "Formatters", resolverName, genericInfo.Where(x => !x.IsOpenGenericType).Cast().Concat(enumInfo).Concat(unionInfo).Concat(objectInfo.Where(x => !x.IsOpenGenericType)).ToArray()); + + var sb = new StringBuilder(); + sb.AppendLine(resolverTemplate.TransformText()); + sb.AppendLine(); + foreach (var item in enumFormatterTemplates) + { + var text = item.TransformText(); + sb.AppendLine(text); + } + + sb.AppendLine(); + foreach (var item in unionFormatterTemplates) + { + var text = item.TransformText(); + sb.AppendLine(text); + } + + sb.AppendLine(); + foreach (var item in objectFormatterTemplates) + { + var text = item.TransformText(); + sb.AppendLine(text); + } + + return sb.ToString(); + } + + private Task GenerateMultipleFileAsync(string output, string resolverName, ObjectSerializationInfo[] objectInfo, EnumSerializationInfo[] enumInfo, UnionSerializationInfo[] unionInfo, string namespaceDot, string multioutSymbol, GenericSerializationInfo[] genericInfo) + { + string GetNamespace(INamespaceInfo x) + { + if (x.Namespace == null) + { + return namespaceDot + "Formatters"; + } + + return namespaceDot + "Formatters." + x.Namespace; + } + + var waitingTasks = new Task[objectInfo.Length + enumInfo.Length + unionInfo.Length + 1]; + var waitingIndex = 0; + foreach (var x in objectInfo) + { + var ns = namespaceDot + "Formatters" + (x.Namespace is null ? string.Empty : "." + x.Namespace); + var template = x.IsStringKey ? new StringKeyFormatterTemplate(ns, new[] { x }) : (IFormatterTemplate)new FormatterTemplate(ns, new[] { x }); + var text = template.TransformText(); + waitingTasks[waitingIndex++] = OutputToDirAsync(output, template.Namespace, x.Name + "Formatter", multioutSymbol, text); + } + + foreach (var x in enumInfo) + { + var template = new EnumTemplate(GetNamespace(x), new[] { x }); + var text = template.TransformText(); + waitingTasks[waitingIndex++] = OutputToDirAsync(output, template.Namespace, x.Name + "Formatter", multioutSymbol, text); + } + + foreach (var x in unionInfo) + { + var template = new UnionTemplate(GetNamespace(x), new[] { x }); + var text = template.TransformText(); + waitingTasks[waitingIndex++] = OutputToDirAsync(output, template.Namespace, x.Name + "Formatter", multioutSymbol, text); + } + + var resolverTemplate = new ResolverTemplate(namespaceDot + "Resolvers", namespaceDot + "Formatters", resolverName, genericInfo.Where(x => !x.IsOpenGenericType).Cast().Concat(enumInfo).Concat(unionInfo).Concat(objectInfo.Where(x => !x.IsOpenGenericType)).ToArray()); + waitingTasks[waitingIndex] = OutputToDirAsync(output, resolverTemplate.Namespace, resolverTemplate.ResolverName, multioutSymbol, resolverTemplate.TransformText()); + return Task.WhenAll(waitingTasks); + } + + private Task OutputToDirAsync(string dir, string ns, string name, string multipleOutSymbol, string text) + { + var builder = new StringBuilder(); + void AppendDir(string dir) + { + if (dir.Length != 0) + { + builder.Append(dir); + if (dir[dir.Length - 1] != Path.DirectorySeparatorChar && dir[dir.Length - 1] != Path.AltDirectorySeparatorChar) { - var fname = Path.GetFileNameWithoutExtension(output) + "." + MultiSymbolToSafeFilePath(multioutSymbol) + ".cs"; - var text = $"#if {multioutSymbol}" + Environment.NewLine + sb.ToString() + Environment.NewLine + "#endif"; - await OutputAsync(Path.Combine(Path.GetDirectoryName(output), fname), text, cancellationToken); + builder.Append(Path.DirectorySeparatorChar); } } + } + + void AppendChar(char c) + { + if (c == '.' || InvalidFileCharSet.Contains(c)) + { + builder.Append('_'); + } else { - // Multiple File output - foreach (var x in objectInfo) - { - var template = x.IsStringKey ? new StringKeyFormatterTemplate() : (IFormatterTemplate)new FormatterTemplate(); - template.Namespace = namespaceDot + "Formatters" + (x.Namespace is null ? string.Empty : "." + x.Namespace); - template.ObjectSerializationInfos = new[] { x }; - - var text = template.TransformText(); - await OutputToDirAsync(output, template.Namespace, x.Name + "Formatter", multioutSymbol, text, cancellationToken); - } + builder.Append(c); + } + } - foreach (var x in enumInfo) + void Append(string text) + { + var span = text.AsSpan(); + while (!span.IsEmpty) + { + var index = span.IndexOf("global::".AsSpan()); + if (index == -1) { - var template = new EnumTemplate() + foreach (var c in span) { - Namespace = namespaceDot + "Formatters" + ((x.Namespace == null) ? string.Empty : "." + x.Namespace), - EnumSerializationInfos = new[] { x }, - }; + AppendChar(c); + } - var text = template.TransformText(); - await OutputToDirAsync(output, template.Namespace, x.Name + "Formatter", multioutSymbol, text, cancellationToken); + break; } - foreach (var x in unionInfo) + if (index == 0) { - var template = new UnionTemplate() - { - Namespace = namespaceDot + "Formatters" + ((x.Namespace == null) ? string.Empty : "." + x.Namespace), - UnionSerializationInfos = new[] { x }, - }; - - var text = template.TransformText(); - await OutputToDirAsync(output, template.Namespace, x.Name + "Formatter", multioutSymbol, text, cancellationToken); + span = span.Slice("global::".Length); + continue; } - var resolverTemplate = new ResolverTemplate() + foreach (var c in span.Slice(0, index)) { - Namespace = namespaceDot + "Resolvers", - FormatterNamespace = namespaceDot + "Formatters", - ResolverName = resolverName, - RegisterInfos = genericInfo.Where(x => !x.IsOpenGenericType).Cast().Concat(enumInfo).Concat(unionInfo).Concat(objectInfo.Where(x => !x.IsOpenGenericType)).ToArray(), - }; - - await OutputToDirAsync(output, resolverTemplate.Namespace, resolverTemplate.ResolverName, multioutSymbol, resolverTemplate.TransformText(), cancellationToken); - } + AppendChar(c); + } - if (objectInfo.Length == 0 && enumInfo.Length == 0 && genericInfo.Length == 0 && unionInfo.Length == 0) - { - logger("Generated result is empty, unexpected result?"); + span = span.Slice(index + "global::".Length); } } - logger("Output Generation Complete:" + sw.Elapsed.ToString()); - } + AppendDir(dir); - private Task OutputToDirAsync(string dir, string ns, string name, string multipleOutSymbol, string text, CancellationToken cancellationToken) - { - if (multipleOutSymbol == string.Empty) - { - return OutputAsync(Path.Combine(dir, $"{ns}_{name}".Replace(".", "_").Replace("global::", string.Empty) + ".cs"), text, cancellationToken); - } - else + if (!string.IsNullOrWhiteSpace(multipleOutSymbol)) { text = $"#if {multipleOutSymbol}" + Environment.NewLine + text + Environment.NewLine + "#endif"; - return OutputAsync(Path.Combine(dir, MultiSymbolToSafeFilePath(multipleOutSymbol), $"{ns}_{name}".Replace(".", "_").Replace("global::", string.Empty) + ".cs"), text, cancellationToken); + AppendDir(MultiSymbolToSafeFilePath(multipleOutSymbol)); } + + Append(ns); + builder.Append('_'); + Append(name); + builder.Append(".cs"); + + return OutputAsync(builder.ToString(), text); } - private Task OutputAsync(string path, string text, CancellationToken cancellationToken) + private Task OutputAsync(string path, string text) { path = path.Replace("global::", string.Empty); @@ -226,12 +295,12 @@ private Task OutputAsync(string path, string text, CancellationToken cancellatio logger(prefix + path); var fi = new FileInfo(path); - if (!fi.Directory.Exists) + if (fi.Directory != null && !fi.Directory.Exists) { fi.Directory.Create(); } - System.IO.File.WriteAllText(path, NormalizeNewLines(text), NoBomUtf8); + File.WriteAllText(path, NormalizeNewLines(text), NoBomUtf8); return Task.CompletedTask; } diff --git a/src/MessagePack.GeneratorCore/Generator/EnumTemplate.cs b/src/MessagePack.GeneratorCore/Generator/EnumTemplate.cs index b64b4912f..382112a3b 100644 --- a/src/MessagePack.GeneratorCore/Generator/EnumTemplate.cs +++ b/src/MessagePack.GeneratorCore/Generator/EnumTemplate.cs @@ -1,10 +1,10 @@ // ------------------------------------------------------------------------------ // -// このコードはツールによって生成されました。 -// ランタイム バージョン: 16.0.0.0 +// This code was generated by a tool. +// Runtime Version: 17.0.0.0 // -// このファイルへの変更は、正しくない動作の原因になる可能性があり、 -// コードが再生成されると失われます。 +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. // // ------------------------------------------------------------------------------ namespace MessagePackCompiler.Generator @@ -17,7 +17,7 @@ namespace MessagePackCompiler.Generator /// /// Class to produce the template output /// - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.TextTemplating", "16.0.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.TextTemplating", "17.0.0.0")] public partial class EnumTemplate : EnumTemplateBase { /// @@ -33,28 +33,29 @@ public virtual string TransformText() #pragma warning disable 612 #pragma warning disable 414 #pragma warning disable 168 +#pragma warning disable CS1591 // document public APIs -#pragma warning disable SA1200 // Using directives should be placed correctly #pragma warning disable SA1403 // File may only contain a single namespace #pragma warning disable SA1649 // File name should match first type name namespace "); this.Write(this.ToStringHelper.ToStringWithCulture(Namespace)); - this.Write("\r\n{\r\n using System;\r\n using System.Buffers;\r\n using MessagePack;\r\n"); + this.Write("\r\n{\r\n"); foreach(var info in EnumSerializationInfos) { this.Write("\r\n public sealed class "); this.Write(this.ToStringHelper.ToStringWithCulture(info.Name)); this.Write("Formatter : global::MessagePack.Formatters.IMessagePackFormatter<"); this.Write(this.ToStringHelper.ToStringWithCulture(info.FullName)); - this.Write(">\r\n {\r\n public void Serialize(ref MessagePackWriter writer, "); + this.Write(">\r\n {\r\n public void Serialize(ref global::MessagePack.MessagePackWriter" + + " writer, "); this.Write(this.ToStringHelper.ToStringWithCulture(info.FullName)); this.Write(" value, global::MessagePack.MessagePackSerializerOptions options)\r\n {\r\n " + - " writer.Write(("); + " writer.Write((global::System."); this.Write(this.ToStringHelper.ToStringWithCulture(info.UnderlyingType)); this.Write(")value);\r\n }\r\n\r\n public "); this.Write(this.ToStringHelper.ToStringWithCulture(info.FullName)); - this.Write(" Deserialize(ref MessagePackReader reader, global::MessagePack.MessagePackSeriali" + - "zerOptions options)\r\n {\r\n return ("); + this.Write(" Deserialize(ref global::MessagePack.MessagePackReader reader, global::MessagePac" + + "k.MessagePackSerializerOptions options)\r\n {\r\n return ("); this.Write(this.ToStringHelper.ToStringWithCulture(info.FullName)); this.Write(")reader.Read"); this.Write(this.ToStringHelper.ToStringWithCulture(info.UnderlyingType)); @@ -67,7 +68,6 @@ namespace "); #pragma warning restore 618 #pragma warning restore 612 -#pragma warning restore SA1200 // Using directives should be placed correctly #pragma warning restore SA1403 // File may only contain a single namespace #pragma warning restore SA1649 // File name should match first type name "); @@ -78,7 +78,7 @@ namespace "); /// /// Base class for this transformation /// - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.TextTemplating", "16.0.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.TextTemplating", "17.0.0.0")] public class EnumTemplateBase { #region Fields diff --git a/src/MessagePack.GeneratorCore/Generator/EnumTemplate.tt b/src/MessagePack.GeneratorCore/Generator/EnumTemplate.tt index 28d34550e..74214c6c1 100644 --- a/src/MessagePack.GeneratorCore/Generator/EnumTemplate.tt +++ b/src/MessagePack.GeneratorCore/Generator/EnumTemplate.tt @@ -11,26 +11,23 @@ #pragma warning disable 612 #pragma warning disable 414 #pragma warning disable 168 +#pragma warning disable CS1591 // document public APIs -#pragma warning disable SA1200 // Using directives should be placed correctly #pragma warning disable SA1403 // File may only contain a single namespace #pragma warning disable SA1649 // File name should match first type name namespace <#= Namespace #> { - using System; - using System.Buffers; - using MessagePack; <# foreach(var info in EnumSerializationInfos) { #> public sealed class <#= info.Name #>Formatter : global::MessagePack.Formatters.IMessagePackFormatter<<#= info.FullName #>> { - public void Serialize(ref MessagePackWriter writer, <#= info.FullName #> value, global::MessagePack.MessagePackSerializerOptions options) + public void Serialize(ref global::MessagePack.MessagePackWriter writer, <#= info.FullName #> value, global::MessagePack.MessagePackSerializerOptions options) { - writer.Write((<#= info.UnderlyingType #>)value); + writer.Write((global::System.<#= info.UnderlyingType #>)value); } - public <#= info.FullName #> Deserialize(ref MessagePackReader reader, global::MessagePack.MessagePackSerializerOptions options) + public <#= info.FullName #> Deserialize(ref global::MessagePack.MessagePackReader reader, global::MessagePack.MessagePackSerializerOptions options) { return (<#= info.FullName #>)reader.Read<#= info.UnderlyingType #>(); } @@ -43,6 +40,5 @@ namespace <#= Namespace #> #pragma warning restore 618 #pragma warning restore 612 -#pragma warning restore SA1200 // Using directives should be placed correctly #pragma warning restore SA1403 // File may only contain a single namespace #pragma warning restore SA1649 // File name should match first type name diff --git a/src/MessagePack.GeneratorCore/Generator/FormatterTemplate.cs b/src/MessagePack.GeneratorCore/Generator/FormatterTemplate.cs index 121b17f4e..396d6a52d 100644 --- a/src/MessagePack.GeneratorCore/Generator/FormatterTemplate.cs +++ b/src/MessagePack.GeneratorCore/Generator/FormatterTemplate.cs @@ -1,7 +1,7 @@ // ------------------------------------------------------------------------------ // // This code was generated by a tool. -// Runtime Version: 16.0.0.0 +// Runtime Version: 17.0.0.0 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. @@ -17,7 +17,7 @@ namespace MessagePackCompiler.Generator /// /// Class to produce the template output /// - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.TextTemplating", "16.0.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.TextTemplating", "17.0.0.0")] public partial class FormatterTemplate : FormatterTemplateBase { /// @@ -33,9 +33,9 @@ public virtual string TransformText() #pragma warning disable 612 #pragma warning disable 414 #pragma warning disable 168 +#pragma warning disable CS1591 // document public APIs #pragma warning disable SA1129 // Do not use default value type constructor -#pragma warning disable SA1200 // Using directives should be placed correctly #pragma warning disable SA1309 // Field names should not begin with underscore #pragma warning disable SA1312 // Variable names should begin with lower-case letter #pragma warning disable SA1403 // File may only contain a single namespace @@ -43,17 +43,15 @@ public virtual string TransformText() namespace "); this.Write(this.ToStringHelper.ToStringWithCulture(Namespace)); - this.Write("\r\n{\r\n using System;\r\n using System.Buffers;\r\n using MessagePack;\r\n"); - foreach(var objInfo in ObjectSerializationInfos) { + this.Write("\r\n{\r\n"); + foreach (var objInfo in ObjectSerializationInfos) { bool isFormatterResolverNecessary = ShouldUseFormatterResolverHelper.ShouldUseFormatterResolver(objInfo.Members); - this.Write("\r\n public sealed class "); - this.Write(this.ToStringHelper.ToStringWithCulture(objInfo.Name)); - this.Write("Formatter"); - this.Write(this.ToStringHelper.ToStringWithCulture((objInfo.IsOpenGenericType ? $"<{string.Join(",", objInfo.GenericTypeParameters.Select(x => x.Name))}>" : ""))); + this.Write(" public sealed class "); + this.Write(this.ToStringHelper.ToStringWithCulture(objInfo.FormatterNameWithoutNameSpace)); this.Write(" : global::MessagePack.Formatters.IMessagePackFormatter<"); this.Write(this.ToStringHelper.ToStringWithCulture(objInfo.FullName)); this.Write(">\r\n"); - foreach(var typeArg in objInfo.GenericTypeParameters.Where(x => x.HasConstraints)) { + foreach (var typeArg in objInfo.GenericTypeParameters.Where(x => x.HasConstraints)) { this.Write(" where "); this.Write(this.ToStringHelper.ToStringWithCulture(typeArg.Name)); this.Write(" : "); @@ -61,9 +59,9 @@ namespace "); this.Write("\r\n"); } this.Write(" {\r\n"); - foreach(var item in objInfo.Members) { - if(item.CustomFormatterTypeName != null) { - this.Write(" "); + foreach (var item in objInfo.Members) { + if (item.CustomFormatterTypeName != null) { + this.Write(" private readonly "); this.Write(this.ToStringHelper.ToStringWithCulture(item.CustomFormatterTypeName)); this.Write(" __"); this.Write(this.ToStringHelper.ToStringWithCulture(item.Name)); @@ -72,88 +70,142 @@ namespace "); this.Write("();\r\n"); } } - this.Write("\r\n public void Serialize(ref MessagePackWriter writer, "); + this.Write("\r\n public void Serialize(ref global::MessagePack.MessagePackWriter writer," + + " "); this.Write(this.ToStringHelper.ToStringWithCulture(objInfo.FullName)); this.Write(" value, global::MessagePack.MessagePackSerializerOptions options)\r\n {\r\n"); - if( objInfo.IsClass) { + if (objInfo.IsClass) { this.Write(" if (value == null)\r\n {\r\n writer.WriteNil();" + "\r\n return;\r\n }\r\n\r\n"); } if (isFormatterResolverNecessary) { - this.Write(" IFormatterResolver formatterResolver = options.Resolver;\r\n"); -} + this.Write(" global::MessagePack.IFormatterResolver formatterResolver = options.Re" + + "solver;\r\n"); + } - if(objInfo.HasIMessagePackSerializationCallbackReceiver && objInfo.NeedsCastOnBefore) { - this.Write(" ((IMessagePackSerializationCallbackReceiver)value).OnBeforeSerialize(" + - ");\r\n"); - } else if(objInfo.HasIMessagePackSerializationCallbackReceiver) { + if (objInfo.HasIMessagePackSerializationCallbackReceiver) { + if (objInfo.NeedsCastOnBefore) { + this.Write(" ((global::MessagePack.IMessagePackSerializationCallbackReceiver)value" + + ").OnBeforeSerialize();\r\n"); + } else { this.Write(" value.OnBeforeSerialize();\r\n"); + } } this.Write(" writer.WriteArrayHeader("); this.Write(this.ToStringHelper.ToStringWithCulture(objInfo.MaxKey + 1)); this.Write(");\r\n"); - for(var i =0; i<= objInfo.MaxKey; i++) { var member = objInfo.GetMember(i); - if( member == null) { + for (var i = 0; i <= objInfo.MaxKey; i++) { + var member = objInfo.GetMember(i); + if (member == null) { this.Write(" writer.WriteNil();\r\n"); } else { this.Write(" "); this.Write(this.ToStringHelper.ToStringWithCulture(member.GetSerializeMethodString())); this.Write(";\r\n"); - } } + } + } this.Write(" }\r\n\r\n public "); this.Write(this.ToStringHelper.ToStringWithCulture(objInfo.FullName)); - this.Write(" Deserialize(ref MessagePackReader reader, global::MessagePack.MessagePackSeriali" + - "zerOptions options)\r\n {\r\n if (reader.TryReadNil())\r\n " + - " {\r\n"); - if( objInfo.IsClass) { + this.Write(" Deserialize(ref global::MessagePack.MessagePackReader reader, global::MessagePac" + + "k.MessagePackSerializerOptions options)\r\n {\r\n if (reader.TryRe" + + "adNil())\r\n {\r\n"); + if (objInfo.IsClass) { this.Write(" return null;\r\n"); } else { - this.Write(" throw new InvalidOperationException(\"typecode is null, struct not" + - " supported\");\r\n"); + this.Write(" throw new global::System.InvalidOperationException(\"typecode is n" + + "ull, struct not supported\");\r\n"); } - this.Write(" }\r\n\r\n options.Security.DepthStep(ref reader);\r\n"); + this.Write(" }\r\n\r\n"); + if (objInfo.MaxKey == -1 && !objInfo.HasIMessagePackSerializationCallbackReceiver) { + this.Write(" reader.Skip();\r\n return new "); + this.Write(this.ToStringHelper.ToStringWithCulture(objInfo.GetConstructorString())); + this.Write(";\r\n"); + } else { + this.Write(" options.Security.DepthStep(ref reader);\r\n"); if (isFormatterResolverNecessary) { - this.Write(" IFormatterResolver formatterResolver = options.Resolver;\r\n"); + this.Write(" global::MessagePack.IFormatterResolver formatterResolver = options.Re" + + "solver;\r\n"); } this.Write(" var length = reader.ReadArrayHeader();\r\n"); - foreach(var x in objInfo.Members) { + var canOverwrite = objInfo.ConstructorParameters.Length == 0; + if (canOverwrite) { + this.Write(" var ____result = new "); + this.Write(this.ToStringHelper.ToStringWithCulture(objInfo.GetConstructorString())); + this.Write(";\r\n"); + } else { foreach (var member in objInfo.Members) { this.Write(" var __"); - this.Write(this.ToStringHelper.ToStringWithCulture(x.Name)); + this.Write(this.ToStringHelper.ToStringWithCulture(member.Name)); this.Write("__ = default("); - this.Write(this.ToStringHelper.ToStringWithCulture(x.Type)); + this.Write(this.ToStringHelper.ToStringWithCulture(member.Type)); this.Write(");\r\n"); + } } this.Write("\r\n for (int i = 0; i < length; i++)\r\n {\r\n sw" + "itch (i)\r\n {\r\n"); - foreach(var x in objInfo.Members) { + for (var memberIndex = 0; memberIndex <= objInfo.MaxKey; memberIndex++) { + var member = objInfo.GetMember(memberIndex); + if (member == null) { continue; } this.Write(" case "); - this.Write(this.ToStringHelper.ToStringWithCulture(x.IntKey)); - this.Write(":\r\n __"); - this.Write(this.ToStringHelper.ToStringWithCulture(x.Name)); + this.Write(this.ToStringHelper.ToStringWithCulture(member.IntKey)); + this.Write(":\r\n"); + if (canOverwrite) { + if (member.IsWritable) { + this.Write(" ____result."); + this.Write(this.ToStringHelper.ToStringWithCulture(member.Name)); + this.Write(" = "); + this.Write(this.ToStringHelper.ToStringWithCulture(member.GetDeserializeMethodString())); + this.Write(";\r\n"); + } else { + this.Write(" "); + this.Write(this.ToStringHelper.ToStringWithCulture(member.GetDeserializeMethodString())); + this.Write(";\r\n"); + } + } else { + this.Write(" __"); + this.Write(this.ToStringHelper.ToStringWithCulture(member.Name)); this.Write("__ = "); - this.Write(this.ToStringHelper.ToStringWithCulture(x.GetDeserializeMethodString())); - this.Write(";\r\n break;\r\n"); + this.Write(this.ToStringHelper.ToStringWithCulture(member.GetDeserializeMethodString())); + this.Write(";\r\n"); + } + this.Write(" break;\r\n"); } this.Write(" default:\r\n reader.Skip();\r\n " + - " break;\r\n }\r\n }\r\n\r\n var ____res" + - "ult = new "); + " break;\r\n }\r\n }\r\n\r\n"); + if (!canOverwrite) { + this.Write(" var ____result = new "); this.Write(this.ToStringHelper.ToStringWithCulture(objInfo.GetConstructorString())); this.Write(";\r\n"); - foreach(var x in objInfo.Members.Where(x => x.IsWritable)) { - this.Write(" ____result."); - this.Write(this.ToStringHelper.ToStringWithCulture(x.Name)); + bool memberAssignExists = false; + for (var memberIndex = 0; memberIndex <= objInfo.MaxKey; memberIndex++) { + var member = objInfo.GetMember(memberIndex); + if (member == null || !member.IsWritable || objInfo.ConstructorParameters.Any(p => p.Equals(member))) { continue; } + memberAssignExists = true; + this.Write(" if (length <= "); + this.Write(this.ToStringHelper.ToStringWithCulture(memberIndex)); + this.Write(")\r\n {\r\n goto MEMBER_ASSIGNMENT_END;\r\n }\r\n\r\n " + + " ____result."); + this.Write(this.ToStringHelper.ToStringWithCulture(member.Name)); this.Write(" = __"); - this.Write(this.ToStringHelper.ToStringWithCulture(x.Name)); + this.Write(this.ToStringHelper.ToStringWithCulture(member.Name)); this.Write("__;\r\n"); } -if(objInfo.HasIMessagePackSerializationCallbackReceiver && objInfo.NeedsCastOnAfter) { - this.Write(" ((IMessagePackSerializationCallbackReceiver)____result).OnAfterDeseri" + - "alize();\r\n"); - } else if(objInfo.HasIMessagePackSerializationCallbackReceiver) { + if (memberAssignExists) { + this.Write("\r\n MEMBER_ASSIGNMENT_END:\r\n"); + } + } + + if (objInfo.HasIMessagePackSerializationCallbackReceiver) { + if (objInfo.NeedsCastOnAfter) { + this.Write(" ((global::MessagePack.IMessagePackSerializationCallbackReceiver)____r" + + "esult).OnAfterDeserialize();\r\n"); + } else { this.Write(" ____result.OnAfterDeserialize();\r\n"); } - this.Write(" reader.Depth--;\r\n return ____result;\r\n }\r\n }\r\n"); + } + this.Write(" reader.Depth--;\r\n return ____result;\r\n"); + } + this.Write(" }\r\n }\r\n\r\n"); } this.Write(@"} @@ -163,7 +215,6 @@ namespace "); #pragma warning restore 612 #pragma warning restore SA1129 // Do not use default value type constructor -#pragma warning restore SA1200 // Using directives should be placed correctly #pragma warning restore SA1309 // Field names should not begin with underscore #pragma warning restore SA1312 // Variable names should begin with lower-case letter #pragma warning restore SA1403 // File may only contain a single namespace @@ -176,7 +227,7 @@ namespace "); /// /// Base class for this transformation /// - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.TextTemplating", "16.0.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.TextTemplating", "17.0.0.0")] public class FormatterTemplateBase { #region Fields diff --git a/src/MessagePack.GeneratorCore/Generator/FormatterTemplate.tt b/src/MessagePack.GeneratorCore/Generator/FormatterTemplate.tt index 8c285c010..240b107fc 100644 --- a/src/MessagePack.GeneratorCore/Generator/FormatterTemplate.tt +++ b/src/MessagePack.GeneratorCore/Generator/FormatterTemplate.tt @@ -11,9 +11,9 @@ #pragma warning disable 612 #pragma warning disable 414 #pragma warning disable 168 +#pragma warning disable CS1591 // document public APIs #pragma warning disable SA1129 // Do not use default value type constructor -#pragma warning disable SA1200 // Using directives should be placed correctly #pragma warning disable SA1309 // Field names should not begin with underscore #pragma warning disable SA1312 // Variable names should begin with lower-case letter #pragma warning disable SA1403 // File may only contain a single namespace @@ -21,26 +21,22 @@ namespace <#= Namespace #> { - using System; - using System.Buffers; - using MessagePack; -<# foreach(var objInfo in ObjectSerializationInfos) { +<# foreach (var objInfo in ObjectSerializationInfos) { bool isFormatterResolverNecessary = ShouldUseFormatterResolverHelper.ShouldUseFormatterResolver(objInfo.Members);#> - - public sealed class <#= objInfo.Name #>Formatter<#= (objInfo.IsOpenGenericType ? $"<{string.Join(",", objInfo.GenericTypeParameters.Select(x => x.Name))}>" : "") #> : global::MessagePack.Formatters.IMessagePackFormatter<<#= objInfo.FullName #>> -<# foreach(var typeArg in objInfo.GenericTypeParameters.Where(x => x.HasConstraints)) { #> + public sealed class <#= objInfo.FormatterNameWithoutNameSpace #> : global::MessagePack.Formatters.IMessagePackFormatter<<#= objInfo.FullName #>> +<# foreach (var typeArg in objInfo.GenericTypeParameters.Where(x => x.HasConstraints)) { #> where <#= typeArg.Name #> : <#= typeArg.Constraints #> <# } #> { -<# foreach(var item in objInfo.Members) { #> -<# if(item.CustomFormatterTypeName != null) { #> - <#= item.CustomFormatterTypeName #> __<#= item.Name #>CustomFormatter__ = new <#= item.CustomFormatterTypeName #>(); +<# foreach (var item in objInfo.Members) { #> +<# if (item.CustomFormatterTypeName != null) { #> + private readonly <#= item.CustomFormatterTypeName #> __<#= item.Name #>CustomFormatter__ = new <#= item.CustomFormatterTypeName #>(); <# } #> <# } #> - public void Serialize(ref MessagePackWriter writer, <#= objInfo.FullName #> value, global::MessagePack.MessagePackSerializerOptions options) + public void Serialize(ref global::MessagePack.MessagePackWriter writer, <#= objInfo.FullName #> value, global::MessagePack.MessagePackSerializerOptions options) { -<# if( objInfo.IsClass) { #> +<# if (objInfo.IsClass) { #> if (value == null) { writer.WriteNil(); @@ -50,50 +46,72 @@ namespace <#= Namespace #> <# } if (isFormatterResolverNecessary) { #> - IFormatterResolver formatterResolver = options.Resolver; -<#} + global::MessagePack.IFormatterResolver formatterResolver = options.Resolver; +<# } - if(objInfo.HasIMessagePackSerializationCallbackReceiver && objInfo.NeedsCastOnBefore) { #> - ((IMessagePackSerializationCallbackReceiver)value).OnBeforeSerialize(); -<# } else if(objInfo.HasIMessagePackSerializationCallbackReceiver) { #> + if (objInfo.HasIMessagePackSerializationCallbackReceiver) { + if (objInfo.NeedsCastOnBefore) { #> + ((global::MessagePack.IMessagePackSerializationCallbackReceiver)value).OnBeforeSerialize(); +<# } else { #> value.OnBeforeSerialize(); +<# } #> <# } #> writer.WriteArrayHeader(<#= objInfo.MaxKey + 1 #>); -<# for(var i =0; i<= objInfo.MaxKey; i++) { var member = objInfo.GetMember(i); #> -<# if( member == null) { #> +<# for (var i = 0; i <= objInfo.MaxKey; i++) { + var member = objInfo.GetMember(i); + if (member == null) { #> writer.WriteNil(); <# } else { #> <#= member.GetSerializeMethodString() #>; -<# } } #> +<# } #> +<# } #> } - public <#= objInfo.FullName #> Deserialize(ref MessagePackReader reader, global::MessagePack.MessagePackSerializerOptions options) + public <#= objInfo.FullName #> Deserialize(ref global::MessagePack.MessagePackReader reader, global::MessagePack.MessagePackSerializerOptions options) { if (reader.TryReadNil()) { -<# if( objInfo.IsClass) { #> +<# if (objInfo.IsClass) { #> return null; <# } else { #> - throw new InvalidOperationException("typecode is null, struct not supported"); + throw new global::System.InvalidOperationException("typecode is null, struct not supported"); <# } #> } +<# if (objInfo.MaxKey == -1 && !objInfo.HasIMessagePackSerializationCallbackReceiver) { #> + reader.Skip(); + return new <#= objInfo.GetConstructorString() #>; +<# } else { #> options.Security.DepthStep(ref reader); <# if (isFormatterResolverNecessary) { #> - IFormatterResolver formatterResolver = options.Resolver; + global::MessagePack.IFormatterResolver formatterResolver = options.Resolver; <# } #> var length = reader.ReadArrayHeader(); -<# foreach(var x in objInfo.Members) { #> - var __<#= x.Name #>__ = default(<#= x.Type #>); +<# var canOverwrite = objInfo.ConstructorParameters.Length == 0; + if (canOverwrite) { #> + var ____result = new <#= objInfo.GetConstructorString() #>; +<# } else { foreach (var member in objInfo.Members) { #> + var __<#= member.Name #>__ = default(<#= member.Type #>); +<# } #> <# } #> for (int i = 0; i < length; i++) { switch (i) { -<# foreach(var x in objInfo.Members) { #> - case <#= x.IntKey #>: - __<#= x.Name #>__ = <#= x.GetDeserializeMethodString() #>; +<# for (var memberIndex = 0; memberIndex <= objInfo.MaxKey; memberIndex++) { + var member = objInfo.GetMember(memberIndex); + if (member == null) { continue; } #> + case <#= member.IntKey #>: +<# if (canOverwrite) { + if (member.IsWritable) { #> + ____result.<#= member.Name #> = <#= member.GetDeserializeMethodString() #>; +<# } else { #> + <#= member.GetDeserializeMethodString() #>; +<# } #> +<# } else {#> + __<#= member.Name #>__ = <#= member.GetDeserializeMethodString() #>; +<# } #> break; <# } #> default: @@ -102,21 +120,40 @@ namespace <#= Namespace #> } } +<# if (!canOverwrite) { #> var ____result = new <#= objInfo.GetConstructorString() #>; -<# foreach(var x in objInfo.Members.Where(x => x.IsWritable)) { #> - ____result.<#= x.Name #> = __<#= x.Name #>__; +<# bool memberAssignExists = false; + for (var memberIndex = 0; memberIndex <= objInfo.MaxKey; memberIndex++) { + var member = objInfo.GetMember(memberIndex); + if (member == null || !member.IsWritable || objInfo.ConstructorParameters.Any(p => p.Equals(member))) { continue; } + memberAssignExists = true;#> + if (length <= <#= memberIndex #>) + { + goto MEMBER_ASSIGNMENT_END; + } + + ____result.<#= member.Name #> = __<#= member.Name #>__; <# } #> -<#if(objInfo.HasIMessagePackSerializationCallbackReceiver && objInfo.NeedsCastOnAfter) { #> - ((IMessagePackSerializationCallbackReceiver)____result).OnAfterDeserialize(); -<# } else if(objInfo.HasIMessagePackSerializationCallbackReceiver) { #> +<# if (memberAssignExists) { #> + + MEMBER_ASSIGNMENT_END: +<# } + } + + if (objInfo.HasIMessagePackSerializationCallbackReceiver) { + if (objInfo.NeedsCastOnAfter) { #> + ((global::MessagePack.IMessagePackSerializationCallbackReceiver)____result).OnAfterDeserialize(); +<# } else { #> ____result.OnAfterDeserialize(); +<# } #> <# } #> reader.Depth--; return ____result; +<# } #> } } -<# } #> -} + +<# } #>} #pragma warning restore 168 #pragma warning restore 414 @@ -124,7 +161,6 @@ namespace <#= Namespace #> #pragma warning restore 612 #pragma warning restore SA1129 // Do not use default value type constructor -#pragma warning restore SA1200 // Using directives should be placed correctly #pragma warning restore SA1309 // Field names should not begin with underscore #pragma warning restore SA1312 // Variable names should begin with lower-case letter #pragma warning restore SA1403 // File may only contain a single namespace diff --git a/src/MessagePack.GeneratorCore/Generator/IFormatterTemplate.cs b/src/MessagePack.GeneratorCore/Generator/IFormatterTemplate.cs index 188f79954..ea3363a6e 100644 --- a/src/MessagePack.GeneratorCore/Generator/IFormatterTemplate.cs +++ b/src/MessagePack.GeneratorCore/Generator/IFormatterTemplate.cs @@ -7,9 +7,9 @@ namespace MessagePackCompiler.Generator { public interface IFormatterTemplate { - string Namespace { get; set; } + string Namespace { get; } - ObjectSerializationInfo[] ObjectSerializationInfos { get; set; } + ObjectSerializationInfo[] ObjectSerializationInfos { get; } string TransformText(); } diff --git a/src/MessagePack.GeneratorCore/Generator/ResolverTemplate.cs b/src/MessagePack.GeneratorCore/Generator/ResolverTemplate.cs index 48e4df6bd..58f207114 100644 --- a/src/MessagePack.GeneratorCore/Generator/ResolverTemplate.cs +++ b/src/MessagePack.GeneratorCore/Generator/ResolverTemplate.cs @@ -1,7 +1,7 @@ // ------------------------------------------------------------------------------ // // This code was generated by a tool. -// Runtime Version: 16.0.0.0 +// Runtime Version: 17.0.0.0 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. @@ -17,7 +17,7 @@ namespace MessagePackCompiler.Generator /// /// Class to produce the template output /// - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.TextTemplating", "16.0.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.TextTemplating", "17.0.0.0")] public partial class ResolverTemplate : ResolverTemplateBase { /// @@ -33,14 +33,14 @@ public virtual string TransformText() #pragma warning disable 612 #pragma warning disable 414 #pragma warning disable 168 +#pragma warning disable CS1591 // document public APIs -#pragma warning disable SA1200 // Using directives should be placed correctly #pragma warning disable SA1312 // Variable names should begin with lower-case letter #pragma warning disable SA1649 // File name should match first type name namespace "); this.Write(this.ToStringHelper.ToStringWithCulture(Namespace)); - this.Write("\r\n{\r\n using System;\r\n\r\n public class "); + this.Write("\r\n{\r\n public class "); this.Write(this.ToStringHelper.ToStringWithCulture(ResolverName)); this.Write(" : global::MessagePack.IFormatterResolver\r\n {\r\n public static readonly " + "global::MessagePack.IFormatterResolver Instance = new "); @@ -76,10 +76,10 @@ static FormatterCache() internal static class "); this.Write(this.ToStringHelper.ToStringWithCulture(ResolverName)); this.Write("GetFormatterHelper\r\n {\r\n private static readonly global::System.Collect" + - "ions.Generic.Dictionary lookup;\r\n\r\n static "); + "ions.Generic.Dictionary lookup;\r\n\r\n static "); this.Write(this.ToStringHelper.ToStringWithCulture(ResolverName)); this.Write("GetFormatterHelper()\r\n {\r\n lookup = new global::System.Collecti" + - "ons.Generic.Dictionary("); + "ons.Generic.Dictionary("); this.Write(this.ToStringHelper.ToStringWithCulture(RegisterInfos.Length)); this.Write(")\r\n {\r\n"); for(var i = 0; i < RegisterInfos.Length; i++) { var x = RegisterInfos[i]; @@ -92,7 +92,7 @@ internal static class "); this.Write(@" }; } - internal static object GetFormatter(Type t) + internal static object GetFormatter(global::System.Type t) { int key; if (!lookup.TryGetValue(t, out key)) @@ -122,7 +122,6 @@ internal static object GetFormatter(Type t) #pragma warning restore 612 #pragma warning restore SA1312 // Variable names should begin with lower-case letter -#pragma warning restore SA1200 // Using directives should be placed correctly #pragma warning restore SA1649 // File name should match first type name "); return this.GenerationEnvironment.ToString(); @@ -132,7 +131,7 @@ internal static object GetFormatter(Type t) /// /// Base class for this transformation /// - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.TextTemplating", "16.0.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.TextTemplating", "17.0.0.0")] public class ResolverTemplateBase { #region Fields diff --git a/src/MessagePack.GeneratorCore/Generator/ResolverTemplate.tt b/src/MessagePack.GeneratorCore/Generator/ResolverTemplate.tt index e61688a1f..6837185df 100644 --- a/src/MessagePack.GeneratorCore/Generator/ResolverTemplate.tt +++ b/src/MessagePack.GeneratorCore/Generator/ResolverTemplate.tt @@ -11,17 +11,13 @@ #pragma warning disable 612 #pragma warning disable 414 #pragma warning disable 168 +#pragma warning disable CS1591 // document public APIs -#pragma warning disable SA1200 // Using directives should be placed correctly #pragma warning disable SA1312 // Variable names should begin with lower-case letter #pragma warning disable SA1649 // File name should match first type name namespace <#= Namespace #> { - using System; - using System.Buffers; - using MessagePack; - public class <#= ResolverName #> : global::MessagePack.IFormatterResolver { public static readonly global::MessagePack.IFormatterResolver Instance = new <#= ResolverName #>(); @@ -52,11 +48,11 @@ namespace <#= Namespace #> internal static class <#= ResolverName #>GetFormatterHelper { - private static readonly global::System.Collections.Generic.Dictionary lookup; + private static readonly global::System.Collections.Generic.Dictionary lookup; static <#= ResolverName #>GetFormatterHelper() { - lookup = new global::System.Collections.Generic.Dictionary(<#= RegisterInfos.Length #>) + lookup = new global::System.Collections.Generic.Dictionary(<#= RegisterInfos.Length #>) { <# for(var i = 0; i < RegisterInfos.Length; i++) { var x = RegisterInfos[i]; #> { typeof(<#= x.FullName #>), <#= i #> }, @@ -64,7 +60,7 @@ namespace <#= Namespace #> }; } - internal static object GetFormatter(Type t) + internal static object GetFormatter(global::System.Type t) { int key; if (!lookup.TryGetValue(t, out key)) @@ -75,7 +71,7 @@ namespace <#= Namespace #> switch (key) { <# for(var i = 0; i < RegisterInfos.Length; i++) { var x = RegisterInfos[i]; #> - case <#= i #>: return new <#= x.FormatterName.StartsWith("global::") ? x.FormatterName: (!string.IsNullOrEmpty(FormatterNamespace) ? FormatterNamespace + "." : FormatterNamespace) + x.FormatterName#>(); + case <#= i #>: return new <#= x.FormatterName.StartsWith("global::") ? x.FormatterName: (!string.IsNullOrEmpty(FormatterNamespace) ? FormatterNamespace + "." : FormatterNamespace) + x.FormatterName #>(); <# } #> default: return null; } @@ -89,5 +85,4 @@ namespace <#= Namespace #> #pragma warning restore 612 #pragma warning restore SA1312 // Variable names should begin with lower-case letter -#pragma warning restore SA1200 // Using directives should be placed correctly #pragma warning restore SA1649 // File name should match first type name diff --git a/src/MessagePack.GeneratorCore/Generator/StringKey/StringKeyFormatterDeserializeHelper.cs b/src/MessagePack.GeneratorCore/Generator/StringKey/StringKeyFormatterDeserializeHelper.cs index f8b46ce7f..f65bed0b3 100644 --- a/src/MessagePack.GeneratorCore/Generator/StringKey/StringKeyFormatterDeserializeHelper.cs +++ b/src/MessagePack.GeneratorCore/Generator/StringKey/StringKeyFormatterDeserializeHelper.cs @@ -12,28 +12,67 @@ namespace MessagePackCompiler.Generator { internal static class StringKeyFormatterDeserializeHelper { - public static string Classify(MemberSerializationInfo[] memberArray, string indent) + public static string Classify(ObjectSerializationInfo objectSerializationInfo, string indent, bool canOverwrite) { + var memberArray = objectSerializationInfo.Members; var buffer = new StringBuilder(); - foreach (var memberInfoTuples in memberArray.Select(member => new MemberInfoTuple(member)).GroupBy(member => member.Binary.Length)) + foreach (var memberInfoTuples in memberArray.Select(member => new MemberInfoTuple(member, IsConstructorParameter(objectSerializationInfo, member))).GroupBy(member => member.Binary.Length)) { var binaryLength = memberInfoTuples.Key; var keyLength = binaryLength >> 3; keyLength += keyLength << 3 == binaryLength ? 0 : 1; buffer.Append(indent).Append("case ").Append(binaryLength).Append(":\r\n"); - ClassifyRecursion(buffer, indent, 1, keyLength, memberInfoTuples); + ClassifyRecursion(buffer, indent, 1, keyLength, memberInfoTuples, canOverwrite); } return buffer.ToString(); } - private static void Assign(StringBuilder buffer, in MemberInfoTuple member) + private static bool IsConstructorParameter(ObjectSerializationInfo objectSerializationInfo, MemberSerializationInfo member) { - buffer.Append("__").Append(member.Info.Name).Append("__ = ").Append(member.Info.GetDeserializeMethodString()).Append(";\r\n"); + foreach (var parameter in objectSerializationInfo.ConstructorParameters) + { + if (parameter.Equals(member)) + { + return true; + } + } + + return false; + } + + private static void Assign(StringBuilder buffer, in MemberInfoTuple member, bool canOverwrite, string indent, string tab, int tabCount) + { + if (member.Info.IsWritable || member.IsConstructorParameter) + { + if (canOverwrite) + { + buffer.Append("____result.").Append(member.Info.Name).Append(" = "); + } + else + { + if (!member.IsConstructorParameter) + { + buffer.Append("__").Append(member.Info.Name).Append("__IsInitialized = true;\r\n").Append(indent); + for (var i = 0; i < tabCount; i++) + { + buffer.Append(tab); + } + } + + buffer.Append("__").Append(member.Info.Name).Append("__ = "); + } + + buffer.Append(member.Info.GetDeserializeMethodString()).Append(";\r\n"); + } + else + { + buffer.Append("reader.Skip();\r\n"); + } } - private static void ClassifyRecursion(StringBuilder buffer, string indent, int tabCount, int keyLength, IEnumerable memberCollection) + private static void ClassifyRecursion(StringBuilder buffer, string indent, int tabCount, int keyLength, IEnumerable memberCollection, bool canOverwrite) { const string Tab = " "; buffer.Append(indent); @@ -46,7 +85,7 @@ private static void ClassifyRecursion(StringBuilder buffer, string indent, int t if (memberArray.Length == 1) { var member = memberArray[0]; - EmbedOne(buffer, indent, tabCount, member); + EmbedOne(buffer, indent, tabCount, member, canOverwrite); return; } @@ -83,7 +122,7 @@ private static void ClassifyRecursion(StringBuilder buffer, string indent, int t } var member = grouping.Single(); - Assign(buffer, member); + Assign(buffer, member, canOverwrite, indent, Tab, tabCount + 2); buffer.Append(Tab + Tab).Append(indent); for (var i = 0; i < tabCount; i++) { @@ -94,7 +133,7 @@ private static void ClassifyRecursion(StringBuilder buffer, string indent, int t continue; } - ClassifyRecursion(buffer, indent + Tab, tabCount + 1, keyLength, grouping); + ClassifyRecursion(buffer, indent + Tab, tabCount + 1, keyLength, grouping, canOverwrite); } buffer.Append("\r\n").Append(indent); @@ -106,7 +145,7 @@ private static void ClassifyRecursion(StringBuilder buffer, string indent, int t buffer.Append("}\r\n"); } - private static void EmbedOne(StringBuilder buffer, string indent, int tabCount, in MemberInfoTuple member) + private static void EmbedOne(StringBuilder buffer, string indent, int tabCount, in MemberInfoTuple member, bool canOverwrite) { const string Tab = " "; var binary = member.Binary.AsSpan((tabCount - 1) << 3); @@ -136,7 +175,7 @@ private static void EmbedOne(StringBuilder buffer, string indent, int tabCount, buffer.Append(Tab); } - Assign(buffer, member); + Assign(buffer, member, canOverwrite, indent, Tab, tabCount); buffer.Append(indent); for (var i = 0; i < tabCount; i++) { @@ -166,12 +205,14 @@ private static void EmbedSequenceEqual(StringBuilder buffer, MemberInfoTuple mem internal readonly struct MemberInfoTuple : IComparable { public readonly MemberSerializationInfo Info; + public readonly bool IsConstructorParameter; public readonly byte[] Binary; public readonly ulong[] Key; - public MemberInfoTuple(MemberSerializationInfo info) + public MemberInfoTuple(MemberSerializationInfo info, bool isConstructorParameter) { Info = info; + IsConstructorParameter = isConstructorParameter; Binary = EmbedStringHelper.Utf8.GetBytes(info.StringKey); ReadOnlySpan span = Binary; var keyLength = Binary.Length >> 3; diff --git a/src/MessagePack.GeneratorCore/Generator/StringKey/StringKeyFormatterTemplate.cs b/src/MessagePack.GeneratorCore/Generator/StringKey/StringKeyFormatterTemplate.cs index 40b3e83c5..abc89f788 100644 --- a/src/MessagePack.GeneratorCore/Generator/StringKey/StringKeyFormatterTemplate.cs +++ b/src/MessagePack.GeneratorCore/Generator/StringKey/StringKeyFormatterTemplate.cs @@ -1,7 +1,7 @@ // ------------------------------------------------------------------------------ // // This code was generated by a tool. -// Runtime Version: 16.0.0.0 +// Runtime Version: 17.0.0.0 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. @@ -17,7 +17,7 @@ namespace MessagePackCompiler.Generator /// /// Class to produce the template output /// - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.TextTemplating", "16.0.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.TextTemplating", "17.0.0.0")] public partial class StringKeyFormatterTemplate : StringKeyFormatterTemplateBase { /// @@ -33,9 +33,9 @@ public virtual string TransformText() #pragma warning disable 612 #pragma warning disable 414 #pragma warning disable 168 +#pragma warning disable CS1591 // document public APIs #pragma warning disable SA1129 // Do not use default value type constructor -#pragma warning disable SA1200 // Using directives should be placed correctly #pragma warning disable SA1309 // Field names should not begin with underscore #pragma warning disable SA1312 // Variable names should begin with lower-case letter #pragma warning disable SA1403 // File may only contain a single namespace @@ -43,24 +43,18 @@ public virtual string TransformText() namespace "); this.Write(this.ToStringHelper.ToStringWithCulture(Namespace)); - this.Write("\r\n{\r\n using System;\r\n using System.Buffers;\r\n using System.Runtime.Inter" + - "opServices;\r\n using MessagePack;\r\n"); - -var list = new List>(); -foreach (var objInfo in ObjectSerializationInfos) -{ + this.Write("\r\n{\r\n"); + var list = new List>(); +foreach (var objInfo in ObjectSerializationInfos) { list.Clear(); - foreach (var member in objInfo.Members) - { + foreach (var member in objInfo.Members) { var binary = EmbedStringHelper.Utf8.GetBytes(member.StringKey); list.Add(new ValueTuple(member, binary)); } - string formatterName = objInfo.Name + (objInfo.IsOpenGenericType ? $"Formatter<{string.Join(", ", objInfo.GenericTypeParameters.Select(x => x.Name))}>" : "Formatter"); - bool isFormatterResolverNecessary = ShouldUseFormatterResolverHelper.ShouldUseFormatterResolver(objInfo.Members); - - this.Write("\r\n public sealed class "); - this.Write(this.ToStringHelper.ToStringWithCulture(formatterName)); + bool isFormatterResolverNecessary = ShouldUseFormatterResolverHelper.ShouldUseFormatterResolver(objInfo.Members); + this.Write(" public sealed class "); + this.Write(this.ToStringHelper.ToStringWithCulture(objInfo.FormatterNameWithoutNameSpace)); this.Write(" : global::MessagePack.Formatters.IMessagePackFormatter<"); this.Write(this.ToStringHelper.ToStringWithCulture(objInfo.FullName)); this.Write(">\r\n"); @@ -72,12 +66,9 @@ namespace "); this.Write("\r\n"); } this.Write(" {\r\n"); - - foreach (var memberAndBinary in list) - { - var member = memberAndBinary.Item1; - var binary = memberAndBinary.Item2; - + for (var i = 0; i < list.Count; i++) { + var member = list[i].Item1; + var binary = list[i].Item2; this.Write(" // "); this.Write(this.ToStringHelper.ToStringWithCulture(member.StringKey)); this.Write("\r\n private static global::System.ReadOnlySpan GetSpan_"); @@ -85,121 +76,86 @@ namespace "); this.Write("() => "); this.Write(this.ToStringHelper.ToStringWithCulture(EmbedStringHelper.ToByteArrayString(binary))); this.Write(";\r\n"); - - } - - this.Write("\r\n public void Serialize(ref global::MessagePack.MessagePackWriter writer," + - " "); + } + if (list.Count != 0) { + this.Write("\r\n"); + } + this.Write(" public void Serialize(ref global::MessagePack.MessagePackWriter writer, "); this.Write(this.ToStringHelper.ToStringWithCulture(objInfo.FullName)); this.Write(" value, global::MessagePack.MessagePackSerializerOptions options)\r\n {\r\n"); - - if (objInfo.IsClass) - { - + if (objInfo.IsClass) { this.Write(" if (value is null)\r\n {\r\n writer.WriteNil();" + "\r\n return;\r\n }\r\n\r\n"); + } - } - - if (isFormatterResolverNecessary) - { - - this.Write(" IFormatterResolver formatterResolver = options.Resolver;\r\n"); - - } - - if (objInfo.HasIMessagePackSerializationCallbackReceiver) - { - if (objInfo.NeedsCastOnBefore) - { + if (isFormatterResolverNecessary) { + this.Write(" var formatterResolver = options.Resolver;\r\n"); + } + if (objInfo.HasIMessagePackSerializationCallbackReceiver) { + if (objInfo.NeedsCastOnBefore) { this.Write(" ((global::MessagePack.IMessagePackSerializationCallbackReceiver)value" + ").OnBeforeSerialize();\r\n"); - - } - else - { - + } else { this.Write(" value.OnBeforeSerialize();\r\n"); - - } - } - + } + } this.Write(" writer.WriteMapHeader("); this.Write(this.ToStringHelper.ToStringWithCulture(list.Count)); this.Write(");\r\n"); - - foreach (var memberAndBinary in list) - { - var member = memberAndBinary.Item1; - + foreach (var memberAndBinary in list) { + var member = memberAndBinary.Item1; this.Write(" writer.WriteRaw(GetSpan_"); this.Write(this.ToStringHelper.ToStringWithCulture(member.Name)); this.Write("());\r\n "); this.Write(this.ToStringHelper.ToStringWithCulture(member.GetSerializeMethodString())); this.Write(";\r\n"); - - } - + } this.Write(" }\r\n\r\n public "); this.Write(this.ToStringHelper.ToStringWithCulture(objInfo.FullName)); this.Write(" Deserialize(ref global::MessagePack.MessagePackReader reader, global::MessagePac" + "k.MessagePackSerializerOptions options)\r\n {\r\n if (reader.TryRe" + "adNil())\r\n {\r\n"); - - if (objInfo.IsClass) - { - + if (objInfo.IsClass) { this.Write(" return null;\r\n"); - - } - else - { - + } else { this.Write(" throw new global::System.InvalidOperationException(\"typecode is n" + "ull, struct not supported\");\r\n"); - - } - + } this.Write(" }\r\n\r\n"); - - if (objInfo.Members.Length == 0) - { - + if (objInfo.Members.Length == 0) { this.Write(" reader.Skip();\r\n var ____result = new "); this.Write(this.ToStringHelper.ToStringWithCulture(objInfo.GetConstructorString())); this.Write(";\r\n"); - - } - else - { - + } else { this.Write(" options.Security.DepthStep(ref reader);\r\n"); - - if (isFormatterResolverNecessary) - { - - this.Write(" IFormatterResolver formatterResolver = options.Resolver;\r\n"); - - } - + if (isFormatterResolverNecessary) { + this.Write(" var formatterResolver = options.Resolver;\r\n"); + } this.Write(" var length = reader.ReadMapHeader();\r\n"); - - foreach (var memberInfo in objInfo.Members) - { - + var canOverwrite = objInfo.ConstructorParameters.Length == 0; + if (canOverwrite) { + this.Write(" var ____result = new "); + this.Write(this.ToStringHelper.ToStringWithCulture(objInfo.GetConstructorString())); + this.Write(";\r\n"); + } else { + foreach (var member in objInfo.Members.Where(x => x.IsWritable || objInfo.ConstructorParameters.Any(p => p.Equals(x)))) { + if (objInfo.ConstructorParameters.All(p => !p.Equals(member))) { + this.Write(" var __"); + this.Write(this.ToStringHelper.ToStringWithCulture(member.Name)); + this.Write("__IsInitialized = false;\r\n"); + } this.Write(" var __"); - this.Write(this.ToStringHelper.ToStringWithCulture(memberInfo.Name)); + this.Write(this.ToStringHelper.ToStringWithCulture(member.Name)); this.Write("__ = default("); - this.Write(this.ToStringHelper.ToStringWithCulture(memberInfo.Type)); + this.Write(this.ToStringHelper.ToStringWithCulture(member.Type)); this.Write(");\r\n"); - - } - + } + } this.Write(@" for (int i = 0; i < length; i++) { - ReadOnlySpan stringKey = global::MessagePack.Internal.CodeGenHelpers.ReadStringSpan(ref reader); + var stringKey = global::MessagePack.Internal.CodeGenHelpers.ReadStringSpan(ref reader); switch (stringKey.Length) { default: @@ -207,56 +163,49 @@ namespace "); reader.Skip(); continue; "); - this.Write(this.ToStringHelper.ToStringWithCulture(StringKeyFormatterDeserializeHelper.Classify(objInfo.Members, " "))); - this.Write("\r\n }\r\n }\r\n\r\n var ____result = new "); + this.Write(this.ToStringHelper.ToStringWithCulture(StringKeyFormatterDeserializeHelper.Classify(objInfo, " ", canOverwrite))); + this.Write("\r\n }\r\n }\r\n\r\n"); + if (!canOverwrite) { + this.Write(" var ____result = new "); this.Write(this.ToStringHelper.ToStringWithCulture(objInfo.GetConstructorString())); - this.Write("\r\n {\r\n"); - - // Preparation for C#9 Record class - foreach (var member in objInfo.Members.Where(x => x.IsWritable)) - { - - this.Write(" "); + this.Write(";\r\n"); + foreach (var member in objInfo.Members.Where(x => x.IsWritable && !objInfo.ConstructorParameters.Any(p => p.Equals(x)))) { + this.Write(" if (__"); + this.Write(this.ToStringHelper.ToStringWithCulture(member.Name)); + this.Write("__IsInitialized)\r\n {\r\n ____result."); this.Write(this.ToStringHelper.ToStringWithCulture(member.Name)); this.Write(" = __"); this.Write(this.ToStringHelper.ToStringWithCulture(member.Name)); - this.Write("__,\r\n"); - - } - - this.Write(" };\r\n\r\n"); - - } - - if (objInfo.HasIMessagePackSerializationCallbackReceiver) - { - if (objInfo.NeedsCastOnAfter) - { - + this.Write("__;\r\n }\r\n\r\n"); + } + } + } + if (objInfo.HasIMessagePackSerializationCallbackReceiver) { + if (objInfo.NeedsCastOnAfter) { this.Write(" ((global::MessagePack.IMessagePackSerializationCallbackReceiver)____r" + "esult).OnAfterDeserialize();\r\n"); - - } - else - { - + } else { this.Write(" ____result.OnAfterDeserialize();\r\n"); - - } - } - - if (objInfo.Members.Length != 0) - { - + } + } + if (objInfo.Members.Length != 0) { this.Write(" reader.Depth--;\r\n"); - - } - - this.Write(" return ____result;\r\n }\r\n }\r\n"); - -} - - this.Write("}\r\n"); + } + this.Write(" return ____result;\r\n }\r\n }\r\n\r\n"); + } + this.Write(@"} + +#pragma warning restore 168 +#pragma warning restore 414 +#pragma warning restore 618 +#pragma warning restore 612 + +#pragma warning restore SA1129 // Do not use default value type constructor +#pragma warning restore SA1309 // Field names should not begin with underscore +#pragma warning restore SA1312 // Variable names should begin with lower-case letter +#pragma warning restore SA1403 // File may only contain a single namespace +#pragma warning restore SA1649 // File name should match first type name +"); return this.GenerationEnvironment.ToString(); } } @@ -264,7 +213,7 @@ namespace "); /// /// Base class for this transformation /// - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.TextTemplating", "16.0.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.TextTemplating", "17.0.0.0")] public class StringKeyFormatterTemplateBase { #region Fields diff --git a/src/MessagePack.GeneratorCore/Generator/StringKey/StringKeyFormatterTemplate.tt b/src/MessagePack.GeneratorCore/Generator/StringKey/StringKeyFormatterTemplate.tt index dc146e5b3..9f0dac873 100644 --- a/src/MessagePack.GeneratorCore/Generator/StringKey/StringKeyFormatterTemplate.tt +++ b/src/MessagePack.GeneratorCore/Generator/StringKey/StringKeyFormatterTemplate.tt @@ -12,9 +12,9 @@ #pragma warning disable 612 #pragma warning disable 414 #pragma warning disable 168 +#pragma warning disable CS1591 // document public APIs #pragma warning disable SA1129 // Do not use default value type constructor -#pragma warning disable SA1200 // Using directives should be placed correctly #pragma warning disable SA1309 // Field names should not begin with underscore #pragma warning disable SA1312 // Variable names should begin with lower-case letter #pragma warning disable SA1403 // File may only contain a single namespace @@ -22,199 +22,138 @@ namespace <#= Namespace #> { - using System; - using System.Buffers; - using System.Runtime.InteropServices; - using MessagePack; -<# -var list = new List>(); -foreach (var objInfo in ObjectSerializationInfos) -{ +<# var list = new List>(); +foreach (var objInfo in ObjectSerializationInfos) { list.Clear(); - foreach (var member in objInfo.Members) - { + foreach (var member in objInfo.Members) { var binary = EmbedStringHelper.Utf8.GetBytes(member.StringKey); list.Add(new ValueTuple(member, binary)); } - string formatterName = objInfo.Name + (objInfo.IsOpenGenericType ? $"Formatter<{string.Join(", ", objInfo.GenericTypeParameters.Select(x => x.Name))}>" : "Formatter"); - bool isFormatterResolverNecessary = ShouldUseFormatterResolverHelper.ShouldUseFormatterResolver(objInfo.Members); -#> - - public sealed class <#= formatterName #> : global::MessagePack.Formatters.IMessagePackFormatter<<#= objInfo.FullName #>> + bool isFormatterResolverNecessary = ShouldUseFormatterResolverHelper.ShouldUseFormatterResolver(objInfo.Members); #> + public sealed class <#= objInfo.FormatterNameWithoutNameSpace #> : global::MessagePack.Formatters.IMessagePackFormatter<<#= objInfo.FullName #>> <# foreach (var typeArg in objInfo.GenericTypeParameters.Where(x => x.HasConstraints)) {#> where <#= typeArg.Name #> : <#= typeArg.Constraints #> <# }#> { -<# - foreach (var memberAndBinary in list) - { - var member = memberAndBinary.Item1; - var binary = memberAndBinary.Item2; -#> +<# for (var i = 0; i < list.Count; i++) { + var member = list[i].Item1; + var binary = list[i].Item2; #> // <#= member.StringKey #> private static global::System.ReadOnlySpan GetSpan_<#= member.Name #>() => <#= EmbedStringHelper.ToByteArrayString(binary) #>; -<# - } -#> +<# } #> +<# if (list.Count != 0) { #> +<# } #> public void Serialize(ref global::MessagePack.MessagePackWriter writer, <#= objInfo.FullName #> value, global::MessagePack.MessagePackSerializerOptions options) { -<# - if (objInfo.IsClass) - { -#> +<# if (objInfo.IsClass) { #> if (value is null) { writer.WriteNil(); return; } -<# - } +<# } - if (isFormatterResolverNecessary) - { -#> - IFormatterResolver formatterResolver = options.Resolver; -<# - } + if (isFormatterResolverNecessary) { #> + var formatterResolver = options.Resolver; +<# } - if (objInfo.HasIMessagePackSerializationCallbackReceiver) - { - if (objInfo.NeedsCastOnBefore) - { -#> + if (objInfo.HasIMessagePackSerializationCallbackReceiver) { + if (objInfo.NeedsCastOnBefore) { #> ((global::MessagePack.IMessagePackSerializationCallbackReceiver)value).OnBeforeSerialize(); -<# - } - else - { -#> +<# } else { #> value.OnBeforeSerialize(); -<# - } - } -#> +<# } #> +<# } #> writer.WriteMapHeader(<#= list.Count #>); -<# - foreach (var memberAndBinary in list) - { - var member = memberAndBinary.Item1; -#> +<# foreach (var memberAndBinary in list) { + var member = memberAndBinary.Item1; #> writer.WriteRaw(GetSpan_<#= member.Name #>()); <#= member.GetSerializeMethodString() #>; -<# - } -#> +<# } #> } public <#= objInfo.FullName #> Deserialize(ref global::MessagePack.MessagePackReader reader, global::MessagePack.MessagePackSerializerOptions options) { if (reader.TryReadNil()) { -<# - if (objInfo.IsClass) - { -#> +<# if (objInfo.IsClass) { #> return null; -<# - } - else - { -#> +<# } else { #> throw new global::System.InvalidOperationException("typecode is null, struct not supported"); -<# - } -#> +<# } #> } -<# - if (objInfo.Members.Length == 0) - { -#> +<# if (objInfo.Members.Length == 0) { #> reader.Skip(); var ____result = new <#= objInfo.GetConstructorString() #>; -<# - } - else - { -#> +<# } else { #> options.Security.DepthStep(ref reader); -<# - if (isFormatterResolverNecessary) - { -#> - IFormatterResolver formatterResolver = options.Resolver; -<# - } -#> +<# if (isFormatterResolverNecessary) { #> + var formatterResolver = options.Resolver; +<# } #> var length = reader.ReadMapHeader(); -<# - foreach (var memberInfo in objInfo.Members) - { -#> - var __<#= memberInfo.Name #>__ = default(<#= memberInfo.Type #>); -<# - } -#> +<# var canOverwrite = objInfo.ConstructorParameters.Length == 0; + if (canOverwrite) { #> + var ____result = new <#= objInfo.GetConstructorString() #>; +<# } else { + foreach (var member in objInfo.Members.Where(x => x.IsWritable || objInfo.ConstructorParameters.Any(p => p.Equals(x)))) { #> +<# if (objInfo.ConstructorParameters.All(p => !p.Equals(member))) { #> + var __<#= member.Name #>__IsInitialized = false; +<# } #> + var __<#= member.Name #>__ = default(<#= member.Type #>); +<# } #> +<# } #> for (int i = 0; i < length; i++) { - ReadOnlySpan stringKey = global::MessagePack.Internal.CodeGenHelpers.ReadStringSpan(ref reader); + var stringKey = global::MessagePack.Internal.CodeGenHelpers.ReadStringSpan(ref reader); switch (stringKey.Length) { default: FAIL: reader.Skip(); continue; -<#= StringKeyFormatterDeserializeHelper.Classify(objInfo.Members, " ") #> +<#= StringKeyFormatterDeserializeHelper.Classify(objInfo, " ", canOverwrite) #> } } - var ____result = new <#= objInfo.GetConstructorString() #> +<# if (!canOverwrite) { #> + var ____result = new <#= objInfo.GetConstructorString() #>; +<# foreach (var member in objInfo.Members.Where(x => x.IsWritable && !objInfo.ConstructorParameters.Any(p => p.Equals(x)))) { #> + if (__<#= member.Name #>__IsInitialized) { -<# - // Preparation for C#9 Record class - foreach (var member in objInfo.Members.Where(x => x.IsWritable)) - { -#> - <#= member.Name #> = __<#= member.Name #>__, -<# - } -#> - }; - -<# - } + ____result.<#= member.Name #> = __<#= member.Name #>__; + } - if (objInfo.HasIMessagePackSerializationCallbackReceiver) - { - if (objInfo.NeedsCastOnAfter) - { -#> +<# } #> +<# } #> +<# } #> +<# if (objInfo.HasIMessagePackSerializationCallbackReceiver) { + if (objInfo.NeedsCastOnAfter) { #> ((global::MessagePack.IMessagePackSerializationCallbackReceiver)____result).OnAfterDeserialize(); -<# - } - else - { -#> +<# } else { #> ____result.OnAfterDeserialize(); -<# - } - } - - if (objInfo.Members.Length != 0) - { -#> +<# } #> +<# } #> +<# if (objInfo.Members.Length != 0) { #> reader.Depth--; -<# - } -#> +<# } #> return ____result; } } -<# -} -#> -} + +<# } #>} + +#pragma warning restore 168 +#pragma warning restore 414 +#pragma warning restore 618 +#pragma warning restore 612 + +#pragma warning restore SA1129 // Do not use default value type constructor +#pragma warning restore SA1309 // Field names should not begin with underscore +#pragma warning restore SA1312 // Variable names should begin with lower-case letter +#pragma warning restore SA1403 // File may only contain a single namespace +#pragma warning restore SA1649 // File name should match first type name diff --git a/src/MessagePack.GeneratorCore/Generator/TemplatePartials.cs b/src/MessagePack.GeneratorCore/Generator/TemplatePartials.cs index 6ab80bf5a..bca5c5876 100644 --- a/src/MessagePack.GeneratorCore/Generator/TemplatePartials.cs +++ b/src/MessagePack.GeneratorCore/Generator/TemplatePartials.cs @@ -7,40 +7,72 @@ namespace MessagePackCompiler.Generator { public partial class FormatterTemplate : IFormatterTemplate { - public string Namespace { get; set; } + public FormatterTemplate(string @namespace, ObjectSerializationInfo[] objectSerializationInfos) + { + Namespace = @namespace; + ObjectSerializationInfos = objectSerializationInfos; + } - public ObjectSerializationInfo[] ObjectSerializationInfos { get; set; } + public string Namespace { get; } + + public ObjectSerializationInfo[] ObjectSerializationInfos { get; } } public partial class StringKeyFormatterTemplate : IFormatterTemplate { - public string Namespace { get; set; } + public StringKeyFormatterTemplate(string @namespace, ObjectSerializationInfo[] objectSerializationInfos) + { + Namespace = @namespace; + ObjectSerializationInfos = objectSerializationInfos; + } + + public string Namespace { get; } - public ObjectSerializationInfo[] ObjectSerializationInfos { get; set; } + public ObjectSerializationInfo[] ObjectSerializationInfos { get; } } public partial class ResolverTemplate { - public string Namespace { get; set; } + public ResolverTemplate(string @namespace, string formatterNamespace, string resolverName, IResolverRegisterInfo[] registerInfos) + { + Namespace = @namespace; + FormatterNamespace = formatterNamespace; + ResolverName = resolverName; + RegisterInfos = registerInfos; + } + + public string Namespace { get; } - public string FormatterNamespace { get; set; } + public string FormatterNamespace { get; } - public string ResolverName { get; set; } = "GeneratedResolver"; + public string ResolverName { get; } - public IResolverRegisterInfo[] RegisterInfos { get; set; } + public IResolverRegisterInfo[] RegisterInfos { get; } } public partial class EnumTemplate { - public string Namespace { get; set; } + public EnumTemplate(string @namespace, EnumSerializationInfo[] enumSerializationInfos) + { + Namespace = @namespace; + EnumSerializationInfos = enumSerializationInfos; + } - public EnumSerializationInfo[] EnumSerializationInfos { get; set; } + public string Namespace { get; } + + public EnumSerializationInfo[] EnumSerializationInfos { get; } } public partial class UnionTemplate { - public string Namespace { get; set; } + public UnionTemplate(string @namespace, UnionSerializationInfo[] unionSerializationInfos) + { + Namespace = @namespace; + UnionSerializationInfos = unionSerializationInfos; + } + + public string Namespace { get; } - public UnionSerializationInfo[] UnionSerializationInfos { get; set; } + public UnionSerializationInfo[] UnionSerializationInfos { get; } } } diff --git a/src/MessagePack.GeneratorCore/Generator/UnionTemplate.cs b/src/MessagePack.GeneratorCore/Generator/UnionTemplate.cs index 1106f1cb8..b7a639bf7 100644 --- a/src/MessagePack.GeneratorCore/Generator/UnionTemplate.cs +++ b/src/MessagePack.GeneratorCore/Generator/UnionTemplate.cs @@ -1,7 +1,7 @@ // ------------------------------------------------------------------------------ // // This code was generated by a tool. -// Runtime Version: 16.0.0.0 +// Runtime Version: 17.0.0.0 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. @@ -17,7 +17,7 @@ namespace MessagePackCompiler.Generator /// /// Class to produce the template output /// - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.TextTemplating", "16.0.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.TextTemplating", "17.0.0.0")] public partial class UnionTemplate : UnionTemplateBase { /// @@ -33,39 +33,43 @@ public virtual string TransformText() #pragma warning disable 612 #pragma warning disable 414 #pragma warning disable 168 +#pragma warning disable CS1591 // document public APIs -#pragma warning disable SA1200 // Using directives should be placed correctly #pragma warning disable SA1403 // File may only contain a single namespace #pragma warning disable SA1649 // File name should match first type name namespace "); this.Write(this.ToStringHelper.ToStringWithCulture(Namespace)); - this.Write("\r\n{\r\n using System;\r\n using System.Buffers;\r\n using System.Collections.G" + - "eneric;\r\n using MessagePack;\r\n\r\n"); + this.Write("\r\n{\r\n"); foreach(var info in UnionSerializationInfos) { this.Write(" public sealed class "); this.Write(this.ToStringHelper.ToStringWithCulture(info.Name)); this.Write("Formatter : global::MessagePack.Formatters.IMessagePackFormatter<"); this.Write(this.ToStringHelper.ToStringWithCulture(info.FullName)); - this.Write(">\r\n {\r\n private readonly Dictionary> typeToKeyAndJumpMap;\r\n private readonly Dictionary keyT" + - "oJumpMap;\r\n\r\n public "); + this.Write(@"> + { + private readonly global::System.Collections.Generic.Dictionary> typeToKeyAndJumpMap; + private readonly global::System.Collections.Generic.Dictionary keyToJumpMap; + + public "); this.Write(this.ToStringHelper.ToStringWithCulture(info.Name)); - this.Write("Formatter()\r\n {\r\n this.typeToKeyAndJumpMap = new Dictionary>("); + this.Write("Formatter()\r\n {\r\n this.typeToKeyAndJumpMap = new global::System" + + ".Collections.Generic.Dictionary>("); this.Write(this.ToStringHelper.ToStringWithCulture(info.SubTypes.Length)); this.Write(", global::MessagePack.Internal.RuntimeTypeHandleEqualityComparer.Default)\r\n " + " {\r\n"); for(var i = 0; i < info.SubTypes.Length; i++) { var item = info.SubTypes[i]; this.Write(" { typeof("); this.Write(this.ToStringHelper.ToStringWithCulture(item.Type)); - this.Write(").TypeHandle, new KeyValuePair("); + this.Write(").TypeHandle, new global::System.Collections.Generic.KeyValuePair("); this.Write(this.ToStringHelper.ToStringWithCulture(item.Key)); this.Write(", "); this.Write(this.ToStringHelper.ToStringWithCulture(i)); this.Write(") },\r\n"); } - this.Write(" };\r\n this.keyToJumpMap = new Dictionary("); + this.Write(" };\r\n this.keyToJumpMap = new global::System.Collections.Ge" + + "neric.Dictionary("); this.Write(this.ToStringHelper.ToStringWithCulture(info.SubTypes.Length)); this.Write(")\r\n {\r\n"); for(var i = 0; i < info.SubTypes.Length; i++) { var item = info.SubTypes[i]; @@ -75,12 +79,12 @@ namespace "); this.Write(this.ToStringHelper.ToStringWithCulture(i)); this.Write(" },\r\n"); } - this.Write(" };\r\n }\r\n\r\n public void Serialize(ref MessagePackWriter " + - "writer, "); + this.Write(" };\r\n }\r\n\r\n public void Serialize(ref global::MessagePac" + + "k.MessagePackWriter writer, "); this.Write(this.ToStringHelper.ToStringWithCulture(info.FullName)); this.Write(@" value, global::MessagePack.MessagePackSerializerOptions options) { - KeyValuePair keyValuePair; + global::System.Collections.Generic.KeyValuePair keyValuePair; if (value != null && this.typeToKeyAndJumpMap.TryGetValue(value.GetType().TypeHandle, out keyValuePair)) { writer.WriteArrayHeader(2); @@ -101,7 +105,7 @@ namespace "); "\r\n return;\r\n }\r\n\r\n writer.WriteNil();\r\n " + " }\r\n\r\n public "); this.Write(this.ToStringHelper.ToStringWithCulture(info.FullName)); - this.Write(@" Deserialize(ref MessagePackReader reader, global::MessagePack.MessagePackSerializerOptions options) + this.Write(@" Deserialize(ref global::MessagePack.MessagePackReader reader, global::MessagePack.MessagePackSerializerOptions options) { if (reader.TryReadNil()) { @@ -110,7 +114,7 @@ namespace "); if (reader.ReadArrayHeader() != 2) { - throw new InvalidOperationException(""Invalid Union data was detected. Type:"); + throw new global::System.InvalidOperationException(""Invalid Union data was detected. Type:"); this.Write(this.ToStringHelper.ToStringWithCulture(info.FullName)); this.Write("\");\r\n }\r\n\r\n options.Security.DepthStep(ref reader);\r\n " + " var key = reader.ReadInt32();\r\n\r\n if (!this.keyToJumpMap.TryGet" + @@ -139,7 +143,6 @@ namespace "); #pragma warning restore 618 #pragma warning restore 612 -#pragma warning restore SA1200 // Using directives should be placed correctly #pragma warning restore SA1403 // File may only contain a single namespace #pragma warning restore SA1649 // File name should match first type name "); @@ -150,7 +153,7 @@ namespace "); /// /// Base class for this transformation /// - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.TextTemplating", "16.0.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.TextTemplating", "17.0.0.0")] public class UnionTemplateBase { #region Fields diff --git a/src/MessagePack.GeneratorCore/Generator/UnionTemplate.tt b/src/MessagePack.GeneratorCore/Generator/UnionTemplate.tt index 216cf3c35..eb9272d02 100644 --- a/src/MessagePack.GeneratorCore/Generator/UnionTemplate.tt +++ b/src/MessagePack.GeneratorCore/Generator/UnionTemplate.tt @@ -11,33 +11,28 @@ #pragma warning disable 612 #pragma warning disable 414 #pragma warning disable 168 +#pragma warning disable CS1591 // document public APIs -#pragma warning disable SA1200 // Using directives should be placed correctly #pragma warning disable SA1403 // File may only contain a single namespace #pragma warning disable SA1649 // File name should match first type name namespace <#= Namespace #> { - using System; - using System.Buffers; - using System.Collections.Generic; - using MessagePack; - <# foreach(var info in UnionSerializationInfos) { #> public sealed class <#= info.Name #>Formatter : global::MessagePack.Formatters.IMessagePackFormatter<<#= info.FullName #>> { - private readonly Dictionary> typeToKeyAndJumpMap; - private readonly Dictionary keyToJumpMap; + private readonly global::System.Collections.Generic.Dictionary> typeToKeyAndJumpMap; + private readonly global::System.Collections.Generic.Dictionary keyToJumpMap; public <#= info.Name #>Formatter() { - this.typeToKeyAndJumpMap = new Dictionary>(<#= info.SubTypes.Length #>, global::MessagePack.Internal.RuntimeTypeHandleEqualityComparer.Default) + this.typeToKeyAndJumpMap = new global::System.Collections.Generic.Dictionary>(<#= info.SubTypes.Length #>, global::MessagePack.Internal.RuntimeTypeHandleEqualityComparer.Default) { <# for(var i = 0; i < info.SubTypes.Length; i++) { var item = info.SubTypes[i]; #> - { typeof(<#= item.Type #>).TypeHandle, new KeyValuePair(<#= item.Key #>, <#= i #>) }, + { typeof(<#= item.Type #>).TypeHandle, new global::System.Collections.Generic.KeyValuePair(<#= item.Key #>, <#= i #>) }, <# } #> }; - this.keyToJumpMap = new Dictionary(<#= info.SubTypes.Length #>) + this.keyToJumpMap = new global::System.Collections.Generic.Dictionary(<#= info.SubTypes.Length #>) { <# for(var i = 0; i < info.SubTypes.Length; i++) { var item = info.SubTypes[i]; #> { <#= item.Key #>, <#= i #> }, @@ -45,9 +40,9 @@ namespace <#= Namespace #> }; } - public void Serialize(ref MessagePackWriter writer, <#= info.FullName #> value, global::MessagePack.MessagePackSerializerOptions options) + public void Serialize(ref global::MessagePack.MessagePackWriter writer, <#= info.FullName #> value, global::MessagePack.MessagePackSerializerOptions options) { - KeyValuePair keyValuePair; + global::System.Collections.Generic.KeyValuePair keyValuePair; if (value != null && this.typeToKeyAndJumpMap.TryGetValue(value.GetType().TypeHandle, out keyValuePair)) { writer.WriteArrayHeader(2); @@ -69,7 +64,7 @@ namespace <#= Namespace #> writer.WriteNil(); } - public <#= info.FullName #> Deserialize(ref MessagePackReader reader, global::MessagePack.MessagePackSerializerOptions options) + public <#= info.FullName #> Deserialize(ref global::MessagePack.MessagePackReader reader, global::MessagePack.MessagePackSerializerOptions options) { if (reader.TryReadNil()) { @@ -78,7 +73,7 @@ namespace <#= Namespace #> if (reader.ReadArrayHeader() != 2) { - throw new InvalidOperationException("Invalid Union data was detected. Type:<#= info.FullName #>"); + throw new global::System.InvalidOperationException("Invalid Union data was detected. Type:<#= info.FullName #>"); } options.Security.DepthStep(ref reader); @@ -116,6 +111,5 @@ namespace <#= Namespace #> #pragma warning restore 618 #pragma warning restore 612 -#pragma warning restore SA1200 // Using directives should be placed correctly #pragma warning restore SA1403 // File may only contain a single namespace #pragma warning restore SA1649 // File name should match first type name diff --git a/src/MessagePack.GeneratorCore/MessagePack.GeneratorCore.csproj b/src/MessagePack.GeneratorCore/MessagePack.GeneratorCore.csproj index 4be9ff608..df4755e25 100644 --- a/src/MessagePack.GeneratorCore/MessagePack.GeneratorCore.csproj +++ b/src/MessagePack.GeneratorCore/MessagePack.GeneratorCore.csproj @@ -6,13 +6,13 @@ True ..\..\opensource.snk - 8 + 9 + enable - - - + + diff --git a/src/MessagePack.GeneratorCore/Utils/RoslynExtensions.cs b/src/MessagePack.GeneratorCore/Utils/RoslynExtensions.cs index a02a282c0..b8645e11b 100644 --- a/src/MessagePack.GeneratorCore/Utils/RoslynExtensions.cs +++ b/src/MessagePack.GeneratorCore/Utils/RoslynExtensions.cs @@ -1,12 +1,9 @@ // Copyright (c) All contributors. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. -using System; using System.Collections.Generic; using System.Linq; using Microsoft.CodeAnalysis; -using Microsoft.CodeAnalysis.CSharp; -using Microsoft.CodeAnalysis.CSharp.Syntax; namespace MessagePackCompiler { @@ -15,111 +12,14 @@ internal static class RoslynExtensions { public static IEnumerable GetNamedTypeSymbols(this Compilation compilation) { - foreach (var syntaxTree in compilation.SyntaxTrees) + return compilation.SyntaxTrees.SelectMany(syntaxTree => { var semModel = compilation.GetSemanticModel(syntaxTree); - - foreach (var item in syntaxTree.GetRoot() + return syntaxTree.GetRoot() .DescendantNodes() .Select(x => semModel.GetDeclaredSymbol(x)) - .Where(x => x != null)) - { - var namedType = item as INamedTypeSymbol; - if (namedType != null) - { - yield return namedType; - } - } - } - } - - public static IEnumerable EnumerateBaseType(this ITypeSymbol symbol) - { - var t = symbol.BaseType; - while (t != null) - { - yield return t; - t = t.BaseType; - } - } - - public static AttributeData FindAttribute(this IEnumerable attributeDataList, string typeName) - { - return attributeDataList - .Where(x => x.AttributeClass.ToDisplayString() == typeName) - .FirstOrDefault(); - } - - public static AttributeData FindAttributeShortName( - this IEnumerable attributeDataList, - string typeName) - { - return attributeDataList - .Where(x => x.AttributeClass.Name == typeName) - .FirstOrDefault(); - } - - public static AttributeData FindAttributeIncludeBasePropertyShortName( - this IPropertySymbol property, - string typeName) - { - do - { - var data = FindAttributeShortName(property.GetAttributes(), typeName); - if (data != null) - { - return data; - } - - property = property.OverriddenProperty; - } - while (property != null); - - return null; - } - - public static AttributeSyntax FindAttribute( - this BaseTypeDeclarationSyntax typeDeclaration, - SemanticModel model, - string typeName) - { - return typeDeclaration.AttributeLists - .SelectMany(x => x.Attributes) - .Where(x => model.GetTypeInfo(x).Type?.ToDisplayString() == typeName) - .FirstOrDefault(); - } - - public static INamedTypeSymbol FindBaseTargetType(this ITypeSymbol symbol, string typeName) - { - return symbol.EnumerateBaseType() - .Where(x => x.OriginalDefinition?.ToDisplayString() == typeName) - .FirstOrDefault(); - } - - public static object GetSingleNamedArgumentValue(this AttributeData attribute, string key) - { - foreach (var item in attribute.NamedArguments) - { - if (item.Key == key) - { - return item.Value.Value; - } - } - - return null; - } - - public static bool IsNullable(this INamedTypeSymbol symbol) - { - if (symbol.IsGenericType) - { - if (symbol.ConstructUnboundGenericType().ToDisplayString() == "T?") - { - return true; - } - } - - return false; + .OfType(); + }); } public static IEnumerable GetAllMembers(this ITypeSymbol symbol) @@ -136,17 +36,11 @@ public static IEnumerable GetAllMembers(this ITypeSymbol symbol) } } - public static IEnumerable GetAllInterfaceMembers(this ITypeSymbol symbol) - { - return symbol.GetMembers() - .Concat(symbol.AllInterfaces.SelectMany(x => x.GetMembers())); - } - - public static bool ApproximatelyEqual(this INamedTypeSymbol left, INamedTypeSymbol right) + public static bool ApproximatelyEqual(this INamedTypeSymbol? left, INamedTypeSymbol? right) { if (left is IErrorTypeSymbol || right is IErrorTypeSymbol) { - return left.ToDisplayString() == right.ToDisplayString(); + return left?.ToDisplayString() == right?.ToDisplayString(); } else { diff --git a/src/MessagePack.UnityClient/Assets/Scripts/MessagePack/Formatters/CollectionFormatter.cs b/src/MessagePack.UnityClient/Assets/Scripts/MessagePack/Formatters/CollectionFormatter.cs index 590719e4e..c7cc82729 100644 --- a/src/MessagePack.UnityClient/Assets/Scripts/MessagePack/Formatters/CollectionFormatter.cs +++ b/src/MessagePack.UnityClient/Assets/Scripts/MessagePack/Formatters/CollectionFormatter.cs @@ -346,7 +346,7 @@ public void Serialize(ref MessagePackWriter writer, TCollection value, MessagePa } else { - using (var scratchRental = SequencePool.Shared.Rent()) + using (var scratchRental = options.SequencePool.Rent()) { var scratch = scratchRental.Value; MessagePackWriter scratchWriter = writer.Clone(scratch); @@ -464,6 +464,25 @@ protected override void Add(TCollection collection, int index, TElement value, M } } + public sealed class GenericEnumerableFormatter : CollectionFormatterBase + where TCollection : IEnumerable + { + protected override TElement[] Create(int count, MessagePackSerializerOptions options) + { + return new TElement[count]; + } + + protected override void Add(TElement[] collection, int index, TElement value, MessagePackSerializerOptions options) + { + collection[index] = value; + } + + protected override TCollection Complete(TElement[] intermediateCollection) + { + return (TCollection)Activator.CreateInstance(typeof(TCollection), intermediateCollection); + } + } + public sealed class LinkedListFormatter : CollectionFormatterBase, LinkedList.Enumerator, LinkedList> { protected override void Add(LinkedList collection, int index, T value, MessagePackSerializerOptions options) @@ -950,7 +969,7 @@ public void Serialize(ref MessagePackWriter writer, IEnumerable value, MessagePa IMessagePackFormatter formatter = options.Resolver.GetFormatterWithVerify(); - using (var scratchRental = SequencePool.Shared.Rent()) + using (var scratchRental = options.SequencePool.Rent()) { var scratch = scratchRental.Value; MessagePackWriter scratchWriter = writer.Clone(scratch); @@ -1271,6 +1290,28 @@ protected override HashSet Create(int count, MessagePackSerializerOptions opt } } +#if NET5_0_OR_GREATER + + public sealed class InterfaceReadOnlySetFormatter : CollectionFormatterBase, IReadOnlySet> + { + protected override void Add(HashSet collection, int index, T value, MessagePackSerializerOptions options) + { + collection.Add(value); + } + + protected override IReadOnlySet Complete(HashSet intermediateCollection) + { + return intermediateCollection; + } + + protected override HashSet Create(int count, MessagePackSerializerOptions options) + { + return new HashSet(options.Security.GetEqualityComparer()); + } + } + +#endif + public sealed class ConcurrentBagFormatter : CollectionFormatterBase> { protected override int? GetCount(ConcurrentBag sequence) diff --git a/src/MessagePack.UnityClient/Assets/Scripts/MessagePack/Formatters/DateTimeFormatters.cs b/src/MessagePack.UnityClient/Assets/Scripts/MessagePack/Formatters/DateTimeFormatters.cs index 06d2ef80a..07da2097b 100644 --- a/src/MessagePack.UnityClient/Assets/Scripts/MessagePack/Formatters/DateTimeFormatters.cs +++ b/src/MessagePack.UnityClient/Assets/Scripts/MessagePack/Formatters/DateTimeFormatters.cs @@ -70,4 +70,50 @@ public DateTime[] Deserialize(ref MessagePackReader reader, MessagePackSerialize return array; } } + +#if NET6_0_OR_GREATER + /// + /// Serializes a value as an ordinary using the . + /// + public sealed class DateOnlyFormatter : IMessagePackFormatter + { + public static readonly DateOnlyFormatter Instance = new DateOnlyFormatter(); + + private DateOnlyFormatter() + { + } + + public void Serialize(ref MessagePackWriter writer, DateOnly value, MessagePackSerializerOptions options) + { + writer.Write(value.DayNumber); + } + + public DateOnly Deserialize(ref MessagePackReader reader, MessagePackSerializerOptions options) + { + return DateOnly.FromDayNumber(reader.ReadInt32()); + } + } + + /// + /// Serializes a value as an extension, recording either seconds or ticks depending on the resolution required. + /// + public sealed class TimeOnlyFormatter : IMessagePackFormatter + { + public static readonly TimeOnlyFormatter Instance = new TimeOnlyFormatter(); + + private TimeOnlyFormatter() + { + } + + public void Serialize(ref MessagePackWriter writer, TimeOnly value, MessagePackSerializerOptions options) + { + writer.Write(value.Ticks); + } + + public TimeOnly Deserialize(ref MessagePackReader reader, MessagePackSerializerOptions options) + { + return new TimeOnly(reader.ReadInt64()); + } + } +#endif } diff --git a/src/MessagePack.UnityClient/Assets/Scripts/MessagePack/Formatters/DictionaryFormatter.cs b/src/MessagePack.UnityClient/Assets/Scripts/MessagePack/Formatters/DictionaryFormatter.cs index 4b9347a14..727d9d1df 100644 --- a/src/MessagePack.UnityClient/Assets/Scripts/MessagePack/Formatters/DictionaryFormatter.cs +++ b/src/MessagePack.UnityClient/Assets/Scripts/MessagePack/Formatters/DictionaryFormatter.cs @@ -174,6 +174,25 @@ protected override TDictionary Create(int count, MessagePackSerializerOptions op } } + public sealed class GenericReadOnlyDictionaryFormatter : DictionaryFormatterBase, TDictionary> + where TDictionary : IReadOnlyDictionary + { + protected override void Add(Dictionary collection, int index, TKey key, TValue value, MessagePackSerializerOptions options) + { + collection.Add(key, value); + } + + protected override Dictionary Create(int count, MessagePackSerializerOptions options) + { + return new Dictionary(count, options.Security.GetEqualityComparer()); + } + + protected override TDictionary Complete(Dictionary intermediateCollection) + { + return (TDictionary)Activator.CreateInstance(typeof(TDictionary), intermediateCollection); + } + } + public sealed class InterfaceDictionaryFormatter : DictionaryFormatterBase, IDictionary> { protected override void Add(Dictionary collection, int index, TKey key, TValue value, MessagePackSerializerOptions options) diff --git a/src/MessagePack.UnityClient/Assets/Scripts/MessagePack/Formatters/StandardClassLibraryFormatter.cs b/src/MessagePack.UnityClient/Assets/Scripts/MessagePack/Formatters/StandardClassLibraryFormatter.cs index a227aaca2..e70a9581f 100644 --- a/src/MessagePack.UnityClient/Assets/Scripts/MessagePack/Formatters/StandardClassLibraryFormatter.cs +++ b/src/MessagePack.UnityClient/Assets/Scripts/MessagePack/Formatters/StandardClassLibraryFormatter.cs @@ -15,7 +15,10 @@ namespace MessagePack.Formatters { // NET40 -> BigInteger, Complex, Tuple - // byte[] is special. represents bin type. + /// + /// Serializes a array as a bin type. + /// Deserializes a bin type or an array of byte-sized integers into a array. + /// public sealed class ByteArrayFormatter : IMessagePackFormatter { public static readonly ByteArrayFormatter Instance = new ByteArrayFormatter(); @@ -31,7 +34,35 @@ public void Serialize(ref MessagePackWriter writer, byte[] value, MessagePackSer public byte[] Deserialize(ref MessagePackReader reader, MessagePackSerializerOptions options) { - return reader.ReadBytes()?.ToArray(); + if (reader.NextMessagePackType == MessagePackType.Array) + { + int len = reader.ReadArrayHeader(); + if (len == 0) + { + return Array.Empty(); + } + + byte[] array = new byte[len]; + options.Security.DepthStep(ref reader); + try + { + for (int i = 0; i < len; i++) + { + reader.CancellationToken.ThrowIfCancellationRequested(); + array[i] = reader.ReadByte(); + } + } + finally + { + reader.Depth--; + } + + return array; + } + else + { + return reader.ReadBytes()?.ToArray(); + } } } @@ -635,4 +666,28 @@ public T Deserialize(ref MessagePackReader reader, MessagePackSerializerOptions return (T)Type.GetType(reader.ReadString(), throwOnError: true); } } + +#if NET5_0_OR_GREATER + + public sealed class HalfFormatter : IMessagePackFormatter + { + public static readonly IMessagePackFormatter Instance = new HalfFormatter(); + + private HalfFormatter() + { + } + + public void Serialize(ref MessagePackWriter writer, Half value, MessagePackSerializerOptions options) + { + writer.Write((float)value); + } + + public Half Deserialize(ref MessagePackReader reader, MessagePackSerializerOptions options) + { + return (Half)reader.ReadSingle(); + } + } + +#endif + } diff --git a/src/MessagePack.UnityClient/Assets/Scripts/MessagePack/Formatters/StringInterningFormatter.cs b/src/MessagePack.UnityClient/Assets/Scripts/MessagePack/Formatters/StringInterningFormatter.cs new file mode 100644 index 000000000..9e07521b7 --- /dev/null +++ b/src/MessagePack.UnityClient/Assets/Scripts/MessagePack/Formatters/StringInterningFormatter.cs @@ -0,0 +1,61 @@ +// Copyright (c) All contributors. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +using System; +using Microsoft.NET.StringTools; + +namespace MessagePack.Formatters +{ + /// + /// A formatter that interns strings on deserialization. + /// + public sealed class StringInterningFormatter : IMessagePackFormatter + { + /// + public string Deserialize(ref MessagePackReader reader, MessagePackSerializerOptions options) + { + if (reader.TryReadNil()) + { + return null; + } + + MessagePackReader retryReader = reader; + if (reader.TryReadStringSpan(out ReadOnlySpan bytes)) + { + if (bytes.Length < 4096) + { + if (bytes.Length == 0) + { + return string.Empty; + } + + Span chars = stackalloc char[bytes.Length]; + int charLength; +#if SPAN_BUILTIN + charLength = StringEncoding.UTF8.GetChars(bytes, chars); +#else + unsafe + { + fixed (byte* pBytes = bytes) + fixed (char* pChars = chars) + { + charLength = StringEncoding.UTF8.GetChars(pBytes, bytes.Length, pChars, chars.Length); + } + } +#endif + return Strings.WeakIntern(chars.Slice(0, charLength)); + } + else + { + // Rewind the reader to the start of the string because we're taking the slow path. + reader = retryReader; + } + } + + return Strings.WeakIntern(reader.ReadString()); + } + + /// + public void Serialize(ref MessagePackWriter writer, string value, MessagePackSerializerOptions options) => writer.Write(value); + } +} diff --git a/src/MessagePack.UnityClient/Assets/Scripts/MessagePack/Formatters/StringInterningFormatter.cs.meta b/src/MessagePack.UnityClient/Assets/Scripts/MessagePack/Formatters/StringInterningFormatter.cs.meta new file mode 100644 index 000000000..329667d48 --- /dev/null +++ b/src/MessagePack.UnityClient/Assets/Scripts/MessagePack/Formatters/StringInterningFormatter.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 78f9cfd44a10b334582b112b07143434 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/src/MessagePack.UnityClient/Assets/Scripts/MessagePack/Formatters/TypelessFormatter.cs b/src/MessagePack.UnityClient/Assets/Scripts/MessagePack/Formatters/TypelessFormatter.cs index 0d158a355..488f6800c 100644 --- a/src/MessagePack.UnityClient/Assets/Scripts/MessagePack/Formatters/TypelessFormatter.cs +++ b/src/MessagePack.UnityClient/Assets/Scripts/MessagePack/Formatters/TypelessFormatter.cs @@ -202,7 +202,7 @@ public void Serialize(ref MessagePackWriter writer, object value, MessagePackSer } // mark will be written at the end, when size is known - using (var scratchRental = SequencePool.Shared.Rent()) + using (var scratchRental = options.SequencePool.Rent()) { MessagePackWriter scratchWriter = writer.Clone(scratchRental.Value); scratchWriter.WriteString(typeName); diff --git a/src/MessagePack.UnityClient/Assets/Scripts/MessagePack/HashCode.cs b/src/MessagePack.UnityClient/Assets/Scripts/MessagePack/HashCode.cs index 8d48c08fd..79a44fcf5 100644 --- a/src/MessagePack.UnityClient/Assets/Scripts/MessagePack/HashCode.cs +++ b/src/MessagePack.UnityClient/Assets/Scripts/MessagePack/HashCode.cs @@ -42,7 +42,7 @@ A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */ -#if !NETCOREAPP +#if !(NETCOREAPP || UNITY_2021_2_OR_NEWER) using System.Collections.Generic; using System.ComponentModel; diff --git a/src/MessagePack.UnityClient/Assets/Scripts/MessagePack/IFormatterResolver.cs b/src/MessagePack.UnityClient/Assets/Scripts/MessagePack/IFormatterResolver.cs index 7c5d00022..51a8e14e4 100644 --- a/src/MessagePack.UnityClient/Assets/Scripts/MessagePack/IFormatterResolver.cs +++ b/src/MessagePack.UnityClient/Assets/Scripts/MessagePack/IFormatterResolver.cs @@ -6,6 +6,7 @@ using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.ExceptionServices; +using System.Runtime.Serialization; using MessagePack.Formatters; using MessagePack.Internal; @@ -107,11 +108,17 @@ internal static object GetFormatterDynamicWithVerify(this IFormatterResolver res } } + [Serializable] public class FormatterNotRegisteredException : MessagePackSerializationException { public FormatterNotRegisteredException(string message) : base(message) { } + + protected FormatterNotRegisteredException(SerializationInfo info, StreamingContext context) + : base(info, context) + { + } } } diff --git a/src/MessagePack.UnityClient/Assets/Scripts/MessagePack/Internal/DynamicAssembly.cs b/src/MessagePack.UnityClient/Assets/Scripts/MessagePack/Internal/DynamicAssembly.cs index f5988af0f..72b86f849 100644 --- a/src/MessagePack.UnityClient/Assets/Scripts/MessagePack/Internal/DynamicAssembly.cs +++ b/src/MessagePack.UnityClient/Assets/Scripts/MessagePack/Internal/DynamicAssembly.cs @@ -26,7 +26,7 @@ public DynamicAssembly(string moduleName) AssemblyBuilderAccess builderAccess = AssemblyBuilderAccess.RunAndSave; this.moduleName = moduleName; #else - AssemblyBuilderAccess builderAccess = AssemblyBuilderAccess.Run; + AssemblyBuilderAccess builderAccess = AssemblyBuilderAccess.RunAndCollect; #endif this.assemblyBuilder = AssemblyBuilder.DefineDynamicAssembly(new AssemblyName(moduleName), builderAccess); this.moduleBuilder = this.assemblyBuilder.DefineDynamicModule(moduleName + ".dll"); diff --git a/src/MessagePack.UnityClient/Assets/Scripts/MessagePack/Internal/ReflectionExtensions.cs b/src/MessagePack.UnityClient/Assets/Scripts/MessagePack/Internal/ReflectionExtensions.cs index dba621351..8c9956bdd 100644 --- a/src/MessagePack.UnityClient/Assets/Scripts/MessagePack/Internal/ReflectionExtensions.cs +++ b/src/MessagePack.UnityClient/Assets/Scripts/MessagePack/Internal/ReflectionExtensions.cs @@ -2,6 +2,7 @@ // Licensed under the MIT license. See LICENSE file in the project root for full license information. using System; +using System.Linq; using System.Reflection; using System.Runtime.CompilerServices; @@ -48,5 +49,11 @@ public static MethodInfo GetSetMethod(this PropertyInfo propInfo) { return propInfo.SetMethod; } + + public static bool HasPrivateCtorForSerialization(this TypeInfo type) + { + var markedCtor = type.DeclaredConstructors.SingleOrDefault(x => x.GetCustomAttribute(false) != null); + return markedCtor?.Attributes.HasFlag(MethodAttributes.Private) ?? false; + } } } diff --git a/src/MessagePack.UnityClient/Assets/Scripts/MessagePack/Internal/Sequence`1.cs b/src/MessagePack.UnityClient/Assets/Scripts/MessagePack/Internal/Sequence`1.cs index 9fe752dff..2813b92e0 100644 --- a/src/MessagePack.UnityClient/Assets/Scripts/MessagePack/Internal/Sequence`1.cs +++ b/src/MessagePack.UnityClient/Assets/Scripts/MessagePack/Internal/Sequence`1.cs @@ -27,7 +27,11 @@ namespace Nerdbank.Streams [DebuggerDisplay("{" + nameof(DebuggerDisplay) + ",nq}")] internal class Sequence : IBufferWriter, IDisposable { - private static readonly int DefaultLengthFromArrayPool = 1 + (4095 / Marshal.SizeOf()); + private const int MaximumAutoGrowSize = 32 * 1024; + + private static readonly int DefaultLengthFromArrayPool = 1 + (4095 / Unsafe.SizeOf()); + + private static readonly ReadOnlySequence Empty = new ReadOnlySequence(SequenceSegment.Empty, 0, SequenceSegment.Empty, 0); private readonly Stack segmentPool = new Stack(); @@ -87,9 +91,21 @@ public Sequence(ArrayPool arrayPool) /// The in use may itself have a minimum array length as well, /// in which case the higher of the two minimums dictate the minimum array size that will be allocated. /// + /// + /// If is true, this value may be automatically increased as the length of a sequence grows. + /// /// public int MinimumSpanLength { get; set; } = 0; + /// + /// Gets or sets a value indicating whether the should be + /// intelligently increased as the length of the sequence grows. + /// + /// + /// This can help prevent long sequences made up of many very small arrays. + /// + public bool AutoIncreaseMinimumSpanLength { get; set; } = true; + /// /// Gets this sequence expressed as a . /// @@ -112,9 +128,9 @@ public Sequence(ArrayPool arrayPool) /// The sequence to convert. public static implicit operator ReadOnlySequence(Sequence sequence) { - return sequence.first != null + return sequence.first != null && sequence.last != null ? new ReadOnlySequence(sequence.first, sequence.first.Start, sequence.last, sequence.last.End) - : ReadOnlySequence.Empty; + : Empty; } /// @@ -128,10 +144,22 @@ public static implicit operator ReadOnlySequence(Sequence sequence) public void AdvanceTo(SequencePosition position) { var firstSegment = (SequenceSegment)position.GetObject(); + if (firstSegment == null) + { + // Emulate PipeReader behavior which is to just return for default(SequencePosition) + return; + } + + if (ReferenceEquals(firstSegment, SequenceSegment.Empty) && this.Length == 0) + { + // We were called with our own empty buffer segment. + return; + } + int firstIndex = position.GetInteger(); // Before making any mutations, confirm that the block specified belongs to this sequence. - var current = this.first; + Sequence.SequenceSegment current = this.first; while (current != firstSegment && current != null) { current = current.Next; @@ -151,12 +179,7 @@ public void AdvanceTo(SequencePosition position) firstSegment.AdvanceTo(firstIndex); - if (firstSegment.Length == 0) - { - firstSegment = this.RecycleAndGetNext(firstSegment); - } - - this.first = firstSegment; + this.first = firstSegment.Length == 0 ? this.RecycleAndGetNext(firstSegment) : firstSegment; if (this.first == null) { @@ -174,6 +197,7 @@ public void Advance(int count) SequenceSegment last = this.last; Verify.Operation(last != null, "Cannot advance before acquiring memory."); last.Advance(count); + this.ConsiderMinimumSizeIncrease(); } /// @@ -190,6 +214,24 @@ public void Advance(int count) /// The requested memory. public Span GetSpan(int sizeHint) => this.GetSegment(sizeHint).RemainingSpan; + /// + /// Adds an existing memory location to this sequence without copying. + /// + /// The memory to add. + /// + /// This *may* leave significant slack space in a previously allocated block if calls to + /// follow calls to or . + /// + public void Append(ReadOnlyMemory memory) + { + if (memory.Length > 0) + { + Sequence.SequenceSegment segment = this.segmentPool.Count > 0 ? this.segmentPool.Pop() : new SequenceSegment(); + segment.AssignForeign(memory); + this.Append(segment); + } + } + /// /// Clears the entire sequence, recycles associated memory into pools, /// and resets this instance for reuse. @@ -204,7 +246,7 @@ public void Advance(int count) /// public void Reset() { - var current = this.first; + Sequence.SequenceSegment current = this.first; while (current != null) { current = this.RecycleAndGetNext(current); @@ -236,7 +278,7 @@ private SequenceSegment GetSegment(int sizeHint) if (minBufferSize.HasValue) { - var segment = this.segmentPool.Count > 0 ? this.segmentPool.Pop() : new SequenceSegment(); + Sequence.SequenceSegment segment = this.segmentPool.Count > 0 ? this.segmentPool.Pop() : new SequenceSegment(); if (this.arrayPool != null) { segment.Assign(this.arrayPool.Rent(minBufferSize.Value == -1 ? DefaultLengthFromArrayPool : minBufferSize.Value)); @@ -268,7 +310,7 @@ private void Append(SequenceSegment segment) else { // The last block is completely unused. Replace it instead of appending to it. - var current = this.first; + Sequence.SequenceSegment current = this.first; if (this.first != this.last) { while (current.Next != this.last) @@ -291,24 +333,40 @@ private void Append(SequenceSegment segment) private SequenceSegment RecycleAndGetNext(SequenceSegment segment) { - var recycledSegment = segment; - segment = segment.Next; + Sequence.SequenceSegment recycledSegment = segment; + Sequence.SequenceSegment nextSegment = segment.Next; recycledSegment.ResetMemory(this.arrayPool); this.segmentPool.Push(recycledSegment); - return segment; + return nextSegment; + } + + private void ConsiderMinimumSizeIncrease() + { + if (this.AutoIncreaseMinimumSpanLength && this.MinimumSpanLength < MaximumAutoGrowSize) + { + int autoSize = Math.Min(MaximumAutoGrowSize, (int)Math.Min(int.MaxValue, this.Length / 2)); + if (this.MinimumSpanLength < autoSize) + { + this.MinimumSpanLength = autoSize; + } + } } private class SequenceSegment : ReadOnlySequenceSegment { + internal static readonly SequenceSegment Empty = new SequenceSegment(); + /// /// A value indicating whether the element may contain references (and thus must be cleared). /// private static readonly bool MayContainReferences = !typeof(T).GetTypeInfo().IsPrimitive; +#pragma warning disable SA1011 // Closing square brackets should be spaced correctly /// /// Gets the backing array, when using an instead of a . /// private T[] array; +#pragma warning restore SA1011 // Closing square brackets should be spaced correctly /// /// Gets the position within where the data starts. @@ -362,6 +420,11 @@ private class SequenceSegment : ReadOnlySequenceSegment set => base.Next = value; } + /// + /// Gets a value indicating whether this segment refers to memory that came from outside and that we cannot write to nor recycle. + /// + internal bool IsForeignMemory => this.array == null && this.MemoryOwner == null; + /// /// Assigns this (recyclable) segment a new area in memory. /// @@ -382,12 +445,22 @@ internal void Assign(T[] array) this.Memory = array; } + /// + /// Assigns this (recyclable) segment a new area in memory. + /// + /// A memory block obtained from outside, that we do not own and should not recycle. + internal void AssignForeign(ReadOnlyMemory memory) + { + this.Memory = memory; + this.End = memory.Length; + } + /// /// Clears all fields in preparation to recycle this instance. /// internal void ResetMemory(ArrayPool arrayPool) { - this.ClearReferences(this.Start, this.End); + this.ClearReferences(this.Start, this.End - this.Start); this.Memory = default; this.Next = null; this.RunningIndex = 0; @@ -411,14 +484,17 @@ internal void ResetMemory(ArrayPool arrayPool) /// The next segment in the linked list. internal void SetNext(SequenceSegment segment) { - Debug.Assert(segment != null, "Null not allowed."); this.Next = segment; segment.RunningIndex = this.RunningIndex + this.Start + this.Length; - // When setting Memory, we start with index 0 instead of this.Start because - // the first segment has an explicit index set anyway, - // and we don't want to double-count it here. - this.Memory = this.AvailableMemory.Slice(0, this.Start + this.Length); + // Trim any slack on this segment. + if (!this.IsForeignMemory) + { + // When setting Memory, we start with index 0 instead of this.Start because + // the first segment has an explicit index set anyway, + // and we don't want to double-count it here. + this.Memory = this.AvailableMemory.Slice(0, this.Start + this.Length); + } } /// diff --git a/src/MessagePack.UnityClient/Assets/Scripts/MessagePack/Internal/TinyJsonReader.cs b/src/MessagePack.UnityClient/Assets/Scripts/MessagePack/Internal/TinyJsonReader.cs index 87263061a..02229621b 100644 --- a/src/MessagePack.UnityClient/Assets/Scripts/MessagePack/Internal/TinyJsonReader.cs +++ b/src/MessagePack.UnityClient/Assets/Scripts/MessagePack/Internal/TinyJsonReader.cs @@ -4,6 +4,7 @@ using System; using System.Globalization; using System.IO; +using System.Runtime.Serialization; using System.Text; #pragma warning disable SA1649 // File name should match first type name @@ -39,12 +40,18 @@ internal enum ValueType : byte String, } + [Serializable] public class TinyJsonException : MessagePackSerializationException { public TinyJsonException(string message) : base(message) { } + + protected TinyJsonException(SerializationInfo info, StreamingContext context) + : base(info, context) + { + } } internal class TinyJsonReader : IDisposable diff --git a/src/MessagePack.UnityClient/Assets/Scripts/MessagePack/MessagePack.asmdef b/src/MessagePack.UnityClient/Assets/Scripts/MessagePack/MessagePack.asmdef index f1e851eb9..ff7f5b38c 100644 --- a/src/MessagePack.UnityClient/Assets/Scripts/MessagePack/MessagePack.asmdef +++ b/src/MessagePack.UnityClient/Assets/Scripts/MessagePack/MessagePack.asmdef @@ -13,9 +13,10 @@ "System.Buffers.dll", "System.Threading.Tasks.Extensions.dll", "System.Runtime.CompilerServices.Unsafe.dll", + "Microsoft.NET.StringTools.dll", "System.Runtime.Extensions.dll" ], "autoReferenced": true, "defineConstraints": [], "versionDefines": [] -} \ No newline at end of file +} diff --git a/src/MessagePack.UnityClient/Assets/Scripts/MessagePack/MessagePackCompression.cs b/src/MessagePack.UnityClient/Assets/Scripts/MessagePack/MessagePackCompression.cs index 1fb1a7229..8303a219d 100644 --- a/src/MessagePack.UnityClient/Assets/Scripts/MessagePack/MessagePackCompression.cs +++ b/src/MessagePack.UnityClient/Assets/Scripts/MessagePack/MessagePackCompression.cs @@ -22,7 +22,7 @@ public enum MessagePackCompression /// Uses msgpack type code ext99 and is compatible with v1 of this library. /// /// - /// See also ThisLibraryExtensionTypeCodes.Lz4Block + /// See also ThisLibraryExtensionTypeCodes.Lz4Block. /// Lz4Block, @@ -35,7 +35,7 @@ public enum MessagePackCompression /// Uses msgpack type code ext98 in array. /// /// - /// See also ThisLibraryExtensionTypeCodes.Lz4BlockArray + /// See also ThisLibraryExtensionTypeCodes.Lz4BlockArray. /// Lz4BlockArray, } diff --git a/src/MessagePack.UnityClient/Assets/Scripts/MessagePack/MessagePackSecurity.cs b/src/MessagePack.UnityClient/Assets/Scripts/MessagePack/MessagePackSecurity.cs index c362f9157..2b743afa4 100644 --- a/src/MessagePack.UnityClient/Assets/Scripts/MessagePack/MessagePackSecurity.cs +++ b/src/MessagePack.UnityClient/Assets/Scripts/MessagePack/MessagePackSecurity.cs @@ -255,7 +255,7 @@ private class CollisionResistantHasher : IEqualityComparer, IEqualityCompa /// private class ObjectFallbackEqualityComparer : IEqualityComparer, IEqualityComparer { - private static readonly MethodInfo GetHashCollisionResistantEqualityComparerOpenGenericMethod = typeof(MessagePackSecurity).GetTypeInfo().DeclaredMethods.Single(m => m.Name == nameof(MessagePackSecurity.GetHashCollisionResistantEqualityComparer) && m.IsGenericMethod); + private static readonly Lazy GetHashCollisionResistantEqualityComparerOpenGenericMethod = new Lazy(() => typeof(MessagePackSecurity).GetTypeInfo().DeclaredMethods.Single(m => m.Name == nameof(MessagePackSecurity.GetHashCollisionResistantEqualityComparer) && m.IsGenericMethod)); private readonly MessagePackSecurity security; private readonly ThreadsafeTypeKeyHashTable equalityComparerCache = new ThreadsafeTypeKeyHashTable(); @@ -288,7 +288,7 @@ public int GetHashCode(object value) { try { - equalityComparer = (IEqualityComparer)GetHashCollisionResistantEqualityComparerOpenGenericMethod.MakeGenericMethod(valueType).Invoke(this.security, Array.Empty()); + equalityComparer = (IEqualityComparer)GetHashCollisionResistantEqualityComparerOpenGenericMethod.Value.MakeGenericMethod(valueType).Invoke(this.security, Array.Empty()); } catch (TargetInvocationException ex) { @@ -334,8 +334,8 @@ public override unsafe int GetHashCode(float value) value = float.NaN; } - long l = *(long*)&value; - return HashCode.Combine((int)(l >> 32), unchecked((int)l)); + int l = *(int*)&value; + return l; } } diff --git a/src/MessagePack.UnityClient/Assets/Scripts/MessagePack/MessagePackSerializer.Json.cs b/src/MessagePack.UnityClient/Assets/Scripts/MessagePack/MessagePackSerializer.Json.cs index 091e2a950..38e39985d 100644 --- a/src/MessagePack.UnityClient/Assets/Scripts/MessagePack/MessagePackSerializer.Json.cs +++ b/src/MessagePack.UnityClient/Assets/Scripts/MessagePack/MessagePackSerializer.Json.cs @@ -21,7 +21,9 @@ public partial class MessagePackSerializer /// Thrown if an error occurs during serialization. public static void SerializeToJson(TextWriter textWriter, T obj, MessagePackSerializerOptions options = null, CancellationToken cancellationToken = default) { - using (var sequenceRental = SequencePool.Shared.Rent()) + options = options ?? DefaultOptions; + + using (var sequenceRental = options.SequencePool.Rent()) { var msgpackWriter = new MessagePackWriter(sequenceRental.Value) { @@ -85,7 +87,7 @@ public static void ConvertToJson(ref MessagePackReader reader, TextWriter jsonWr { if (options.Compression.IsCompression()) { - using (var scratchRental = SequencePool.Shared.Rent()) + using (var scratchRental = options.SequencePool.Rent()) { if (TryDecompress(ref reader, scratchRental.Value)) { @@ -133,7 +135,9 @@ public static void ConvertFromJson(string str, ref MessagePackWriter writer, Mes /// public static byte[] ConvertFromJson(string str, MessagePackSerializerOptions options = null, CancellationToken cancellationToken = default) { - using (var scratchRental = SequencePool.Shared.Rent()) + options = options ?? DefaultOptions; + + using (var scratchRental = options.SequencePool.Rent()) { var writer = new MessagePackWriter(scratchRental.Value) { @@ -155,30 +159,31 @@ public static byte[] ConvertFromJson(string str, MessagePackSerializerOptions op public static void ConvertFromJson(TextReader reader, ref MessagePackWriter writer, MessagePackSerializerOptions options = null) { options = options ?? DefaultOptions; + if (options.Compression.IsCompression()) { - using (var scratchRental = SequencePool.Shared.Rent()) + using (var scratchRental = options.SequencePool.Rent()) { MessagePackWriter scratchWriter = writer.Clone(scratchRental.Value); using (var jr = new TinyJsonReader(reader, false)) { - FromJsonCore(jr, ref scratchWriter); + FromJsonCore(jr, ref scratchWriter, options); } scratchWriter.Flush(); - ToLZ4BinaryCore(scratchRental.Value, ref writer, options.Compression); + ToLZ4BinaryCore(scratchRental.Value, ref writer, options.Compression, options.CompressionMinLength); } } else { using (var jr = new TinyJsonReader(reader, false)) { - FromJsonCore(jr, ref writer); + FromJsonCore(jr, ref writer, options); } } } - private static uint FromJsonCore(TinyJsonReader jr, ref MessagePackWriter writer) + private static uint FromJsonCore(TinyJsonReader jr, ref MessagePackWriter writer, MessagePackSerializerOptions options) { uint count = 0; while (jr.Read()) @@ -189,10 +194,10 @@ private static uint FromJsonCore(TinyJsonReader jr, ref MessagePackWriter writer break; case TinyJsonToken.StartObject: // Set up a scratch area to serialize the collection since we don't know its length yet, which must be written first. - using (var scratchRental = SequencePool.Shared.Rent()) + using (var scratchRental = options.SequencePool.Rent()) { MessagePackWriter scratchWriter = writer.Clone(scratchRental.Value); - var mapCount = FromJsonCore(jr, ref scratchWriter); + var mapCount = FromJsonCore(jr, ref scratchWriter, options); scratchWriter.Flush(); mapCount = mapCount / 2; // remove propertyname string count. @@ -206,10 +211,10 @@ private static uint FromJsonCore(TinyJsonReader jr, ref MessagePackWriter writer return count; // break case TinyJsonToken.StartArray: // Set up a scratch area to serialize the collection since we don't know its length yet, which must be written first. - using (var scratchRental = SequencePool.Shared.Rent()) + using (var scratchRental = options.SequencePool.Rent()) { MessagePackWriter scratchWriter = writer.Clone(scratchRental.Value); - var arrayCount = FromJsonCore(jr, ref scratchWriter); + var arrayCount = FromJsonCore(jr, ref scratchWriter, options); scratchWriter.Flush(); writer.WriteArrayHeader(arrayCount); @@ -299,7 +304,7 @@ private static void ToJsonCore(ref MessagePackReader reader, TextWriter writer, WriteJsonString(reader.ReadString(), writer); break; case MessagePackType.Binary: - ArraySegment segment = ByteArraySegmentFormatter.Instance.Deserialize(ref reader, DefaultOptions); + ArraySegment segment = ByteArraySegmentFormatter.Instance.Deserialize(ref reader, options); writer.Write("\"" + Convert.ToBase64String(segment.Array, segment.Offset, segment.Count) + "\""); break; case MessagePackType.Array: diff --git a/src/MessagePack.UnityClient/Assets/Scripts/MessagePack/MessagePackSerializer.NonGeneric.cs b/src/MessagePack.UnityClient/Assets/Scripts/MessagePack/MessagePackSerializer.NonGeneric.cs index 281e20f31..bd6f9b431 100644 --- a/src/MessagePack.UnityClient/Assets/Scripts/MessagePack/MessagePackSerializer.NonGeneric.cs +++ b/src/MessagePack.UnityClient/Assets/Scripts/MessagePack/MessagePackSerializer.NonGeneric.cs @@ -82,6 +82,22 @@ public static object Deserialize(Type type, ReadOnlySequence bytes, Messag return GetOrAdd(type).Deserialize_ReadOnlySequence_Options_CancellationToken.Invoke(bytes, options, cancellationToken); } + /// + /// Helper method used by reflection. + /// + private static void SerializeSemiGeneric(ref MessagePackWriter writer, object valueObject, MessagePackSerializerOptions options = null) + { + Serialize(ref writer, (T)valueObject, options); + } + + /// + /// Helper method used by reflection. + /// + private static object DeserializeSemiGeneric(ref MessagePackReader reader, MessagePackSerializerOptions options = null) + { + return Deserialize(ref reader, options); + } + private static async ValueTask DeserializeObjectAsync(Stream stream, MessagePackSerializerOptions options, CancellationToken cancellationToken) => await DeserializeAsync(stream, options, cancellationToken).ConfigureAwait(false); private static CompiledMethods GetOrAdd(Type type) @@ -219,39 +235,22 @@ internal CompiledMethods(Type type) } { - // public static void Serialize(ref MessagePackWriter writer, T obj, MessagePackSerializerOptions options) - MethodInfo serialize = GetMethod(nameof(Serialize), type, new Type[] { typeof(MessagePackWriter).MakeByRefType(), null, typeof(MessagePackSerializerOptions) }); + // private static void SerializeSemiGeneric(ref MessagePackWriter writer, object obj, MessagePackSerializerOptions options) + MethodInfo serialize = GetMethod(nameof(SerializeSemiGeneric), type, new Type[] { typeof(MessagePackWriter).MakeByRefType(), typeof(object), typeof(MessagePackSerializerOptions) }); #if ENABLE_IL2CPP this.Serialize_MessagePackWriter_T_Options = (ref MessagePackWriter x, object y, MessagePackSerializerOptions z) => ThrowRefStructNotSupported(); #else - ParameterExpression param1 = Expression.Parameter(typeof(MessagePackWriter).MakeByRefType(), "writer"); - ParameterExpression param2 = Expression.Parameter(typeof(object), "obj"); - ParameterExpression param3 = Expression.Parameter(typeof(MessagePackSerializerOptions), "options"); - - MethodCallExpression body = Expression.Call( - null, - serialize, - param1, - ti.IsValueType ? Expression.Unbox(param2, type) : Expression.Convert(param2, type), - param3); - MessagePackWriterSerialize lambda = Expression.Lambda(body, param1, param2, param3).Compile(PreferInterpretation); - - this.Serialize_MessagePackWriter_T_Options = lambda; + this.Serialize_MessagePackWriter_T_Options = (MessagePackWriterSerialize)serialize.CreateDelegate(typeof(MessagePackWriterSerialize)); #endif } { - // public static T Deserialize(ref MessagePackReader reader, MessagePackSerializerOptions options) - MethodInfo deserialize = GetMethod(nameof(Deserialize), type, new Type[] { typeof(MessagePackReader).MakeByRefType(), typeof(MessagePackSerializerOptions) }); + // private static object DeserializeSemiGeneric(ref MessagePackReader reader, MessagePackSerializerOptions options) + MethodInfo deserialize = GetMethod(nameof(DeserializeSemiGeneric), type, new Type[] { typeof(MessagePackReader).MakeByRefType(), typeof(MessagePackSerializerOptions) }); #if ENABLE_IL2CPP this.Deserialize_MessagePackReader_Options = (ref MessagePackReader reader, MessagePackSerializerOptions options) => { ThrowRefStructNotSupported(); return null; }; #else - ParameterExpression param1 = Expression.Parameter(typeof(MessagePackReader).MakeByRefType(), "reader"); - ParameterExpression param2 = Expression.Parameter(typeof(MessagePackSerializerOptions), "options"); - UnaryExpression body = Expression.Convert(Expression.Call(null, deserialize, param1, param2), typeof(object)); - MessagePackReaderDeserialize lambda = Expression.Lambda(body, param1, param2).Compile(); - - this.Deserialize_MessagePackReader_Options = lambda; + this.Deserialize_MessagePackReader_Options = (MessagePackReaderDeserialize)deserialize.CreateDelegate(typeof(MessagePackReaderDeserialize)); #endif } diff --git a/src/MessagePack.UnityClient/Assets/Scripts/MessagePack/MessagePackSerializer.cs b/src/MessagePack.UnityClient/Assets/Scripts/MessagePack/MessagePackSerializer.cs index 973f422f6..8c4a454c6 100644 --- a/src/MessagePack.UnityClient/Assets/Scripts/MessagePack/MessagePackSerializer.cs +++ b/src/MessagePack.UnityClient/Assets/Scripts/MessagePack/MessagePackSerializer.cs @@ -18,8 +18,7 @@ namespace MessagePack [System.Diagnostics.CodeAnalysis.SuppressMessage("ApiDesign", "RS0026:Do not add multiple public overloads with optional parameters", Justification = "Each overload has sufficiently unique required parameters.")] public static partial class MessagePackSerializer { - private const int LZ4NotCompressionSizeInLz4BlockType = 64; - private const int MaxHintSize = 1024 * 1024; + private static MessagePackSerializerOptions defaultOptions; /// /// Gets or sets the default set of options to use when not explicitly specified for a method call. @@ -33,7 +32,20 @@ public static partial class MessagePackSerializer /// If you are an app author, realize that setting this property impacts the entire application so it should only be /// set once, and before any use of occurs. /// - public static MessagePackSerializerOptions DefaultOptions { get; set; } = MessagePackSerializerOptions.Standard; + public static MessagePackSerializerOptions DefaultOptions + { + get + { + if (defaultOptions is null) + { + defaultOptions = MessagePackSerializerOptions.Standard; + } + + return defaultOptions; + } + + set => defaultOptions = value; + } /// /// A thread-local, recyclable array that may be used for short bursts of code. @@ -79,13 +91,13 @@ public static void Serialize(ref MessagePackWriter writer, T value, MessagePa { if (options.Compression.IsCompression() && !PrimitiveChecker.IsMessagePackFixedSizePrimitive) { - using (var scratchRental = SequencePool.Shared.Rent()) + using (var scratchRental = options.SequencePool.Rent()) { var scratch = scratchRental.Value; MessagePackWriter scratchWriter = writer.Clone(scratch); options.Resolver.GetFormatterWithVerify().Serialize(ref scratchWriter, value, options); scratchWriter.Flush(); - ToLZ4BinaryCore(scratch, ref writer, options.Compression); + ToLZ4BinaryCore(scratch, ref writer, options.Compression, options.CompressionMinLength); } } else @@ -119,7 +131,8 @@ public static byte[] Serialize(T value, MessagePackSerializerOptions options scratchArray = array = new byte[65536]; } - var msgpackWriter = new MessagePackWriter(SequencePool.Shared, array) + options = options ?? DefaultOptions; + var msgpackWriter = new MessagePackWriter(options.SequencePool, array) { CancellationToken = cancellationToken, }; @@ -137,8 +150,10 @@ public static byte[] Serialize(T value, MessagePackSerializerOptions options /// Thrown when any error occurs during serialization. public static void Serialize(Stream stream, T value, MessagePackSerializerOptions options = null, CancellationToken cancellationToken = default) { + options = options ?? DefaultOptions; cancellationToken.ThrowIfCancellationRequested(); - using (SequencePool.Rental sequenceRental = SequencePool.Shared.Rent()) + + using (SequencePool.Rental sequenceRental = options.SequencePool.Rent()) { Serialize(sequenceRental.Value, value, options, cancellationToken); @@ -168,8 +183,10 @@ public static void Serialize(Stream stream, T value, MessagePackSerializerOpt /// Thrown when any error occurs during serialization. public static async Task SerializeAsync(Stream stream, T value, MessagePackSerializerOptions options = null, CancellationToken cancellationToken = default) { + options = options ?? DefaultOptions; cancellationToken.ThrowIfCancellationRequested(); - using (SequencePool.Rental sequenceRental = SequencePool.Shared.Rent()) + + using (SequencePool.Rental sequenceRental = options.SequencePool.Rent()) { Serialize(sequenceRental.Value, value, options, cancellationToken); @@ -222,7 +239,7 @@ public static T Deserialize(ref MessagePackReader reader, MessagePackSerializ { if (options.Compression.IsCompression()) { - using (var msgPackUncompressedRental = SequencePool.Shared.Rent()) + using (var msgPackUncompressedRental = options.SequencePool.Rent()) { var msgPackUncompressed = msgPackUncompressedRental.Value; if (TryDecompress(ref reader, msgPackUncompressed)) @@ -315,12 +332,14 @@ public static T Deserialize(ReadOnlyMemory buffer, MessagePackSerialize /// public static T Deserialize(Stream stream, MessagePackSerializerOptions options = null, CancellationToken cancellationToken = default) { + options = options ?? DefaultOptions; + if (TryDeserializeFromMemoryStream(stream, options, cancellationToken, out T result)) { return result; } - using (var sequenceRental = SequencePool.Shared.Rent()) + using (var sequenceRental = options.SequencePool.Rent()) { var sequence = sequenceRental.Value; try @@ -329,7 +348,7 @@ public static T Deserialize(Stream stream, MessagePackSerializerOptions optio do { cancellationToken.ThrowIfCancellationRequested(); - Span span = sequence.GetSpan(stream.CanSeek ? (int)Math.Min(MaxHintSize, stream.Length - stream.Position) : 0); + Span span = sequence.GetSpan(stream.CanSeek ? (int)Math.Min(options.SuggestedContiguousMemorySize, stream.Length - stream.Position) : 0); bytesRead = stream.Read(span); sequence.Advance(bytesRead); } @@ -362,12 +381,14 @@ public static T Deserialize(Stream stream, MessagePackSerializerOptions optio /// public static async ValueTask DeserializeAsync(Stream stream, MessagePackSerializerOptions options = null, CancellationToken cancellationToken = default) { + options = options ?? DefaultOptions; + if (TryDeserializeFromMemoryStream(stream, options, cancellationToken, out T result)) { return result; } - using (var sequenceRental = SequencePool.Shared.Rent()) + using (var sequenceRental = options.SequencePool.Rent()) { var sequence = sequenceRental.Value; try @@ -375,7 +396,7 @@ public static async ValueTask DeserializeAsync(Stream stream, MessagePackS int bytesRead; do { - Memory memory = sequence.GetMemory(stream.CanSeek ? (int)Math.Min(MaxHintSize, stream.Length - stream.Position) : 0); + Memory memory = sequence.GetMemory(stream.CanSeek ? (int)Math.Min(options.SuggestedContiguousMemorySize, stream.Length - stream.Position) : 0); bytesRead = await stream.ReadAsync(memory, cancellationToken).ConfigureAwait(false); sequence.Advance(bytesRead); } @@ -546,16 +567,16 @@ private static bool TryDecompress(ref MessagePackReader reader, IBufferWriter msgpackUncompressedData, ref MessagePackWriter writer, MessagePackCompression compression) + private static void ToLZ4BinaryCore(in ReadOnlySequence msgpackUncompressedData, ref MessagePackWriter writer, MessagePackCompression compression, int minCompressionSize) { - if (compression == MessagePackCompression.Lz4Block) + if (msgpackUncompressedData.Length < minCompressionSize) { - if (msgpackUncompressedData.Length < LZ4NotCompressionSizeInLz4BlockType) - { - writer.WriteRaw(msgpackUncompressedData); - return; - } + writer.WriteRaw(msgpackUncompressedData); + return; + } + if (compression == MessagePackCompression.Lz4Block) + { var maxCompressedLength = LZ4Codec.MaximumOutputLength((int)msgpackUncompressedData.Length); var lz4Span = ArrayPool.Shared.Rent(maxCompressedLength); try diff --git a/src/MessagePack.UnityClient/Assets/Scripts/MessagePack/MessagePackSerializerOptions.cs b/src/MessagePack.UnityClient/Assets/Scripts/MessagePack/MessagePackSerializerOptions.cs index 8eb9835ef..a9a9ec515 100644 --- a/src/MessagePack.UnityClient/Assets/Scripts/MessagePack/MessagePackSerializerOptions.cs +++ b/src/MessagePack.UnityClient/Assets/Scripts/MessagePack/MessagePackSerializerOptions.cs @@ -4,6 +4,7 @@ using System; using System.Collections.Generic; using System.Text.RegularExpressions; +using Nerdbank.Streams; namespace MessagePack { @@ -15,7 +16,7 @@ namespace MessagePack public class MessagePackSerializerOptions { // see:http://msdn.microsoft.com/en-us/library/w3f99sx1.aspx - internal static readonly Regex AssemblyNameVersionSelectorRegex = new Regex(@", Version=\d+.\d+.\d+.\d+, Culture=[\w-]+, PublicKeyToken=(?:null|[a-f0-9]{16})$", RegexOptions.Compiled); + internal static readonly Regex AssemblyNameVersionSelectorRegex = new Regex(@", Version=\d+.\d+.\d+.\d+, Culture=[\w-]+, PublicKeyToken=(?:null|[a-f0-9]{16})", RegexOptions.Compiled); /// /// A collection of known dangerous types that are not expected in a typical MessagePack stream, @@ -37,7 +38,7 @@ public class MessagePackSerializerOptions /// /// Initializes a new instance of the class. /// - protected internal MessagePackSerializerOptions(IFormatterResolver resolver) + public MessagePackSerializerOptions(IFormatterResolver resolver) { this.Resolver = resolver ?? throw new ArgumentNullException(nameof(resolver)); } @@ -56,10 +57,13 @@ protected MessagePackSerializerOptions(MessagePackSerializerOptions copyFrom) this.Resolver = copyFrom.Resolver; this.Compression = copyFrom.Compression; + this.CompressionMinLength = copyFrom.CompressionMinLength; + this.SuggestedContiguousMemorySize = copyFrom.SuggestedContiguousMemorySize; this.OldSpec = copyFrom.OldSpec; this.OmitAssemblyVersion = copyFrom.OmitAssemblyVersion; this.AllowAssemblyVersionMismatch = copyFrom.AllowAssemblyVersionMismatch; this.Security = copyFrom.Security; + this.SequencePool = copyFrom.SequencePool; } /// @@ -79,6 +83,26 @@ protected MessagePackSerializerOptions(MessagePackSerializerOptions copyFrom) /// public MessagePackCompression Compression { get; private set; } + /// + /// Gets the length a serialized msgpack result must equal or exceed before is applied. + /// + /// The default value is 64. + /// + /// When compression is not applied due to a short serialized result, deserialization will still succeed + /// even if is set to something other than . + /// + public int CompressionMinLength { get; private set; } = 64; + + /// + /// Gets the size of contiguous memory blocks in bytes that may be allocated for buffering purposes. + /// + /// The default value is 1MB. + /// + /// Larger values may perform a bit faster, but may result in adding a runtime perf tax due to using the + /// Large Object Heap. + /// + public int SuggestedContiguousMemorySize { get; private set; } = 1024 * 1024; + /// /// Gets a value indicating whether to serialize with set to some value /// causing messagepack spec compliance to be explicitly set to the old or new format. @@ -113,6 +137,12 @@ protected MessagePackSerializerOptions(MessagePackSerializerOptions copyFrom) /// public MessagePackSecurity Security { get; private set; } = MessagePackSecurity.TrustedData; + /// + /// Gets a thread-safe pool of reusable objects. + /// + /// The default value is the instance. + public SequencePool SequencePool { get; private set; } = SequencePool.Shared; + /// /// Gets a type given a string representation of the type. /// @@ -186,6 +216,50 @@ public MessagePackSerializerOptions WithCompression(MessagePackCompression compr return result; } + /// + /// Gets a copy of these options with the property set to a new value. + /// + /// The new value for the property. Must be a positive integer. + /// The new instance; or the original if the value is unchanged. + public MessagePackSerializerOptions WithCompressionMinLength(int compressionMinLength) + { + if (this.CompressionMinLength == compressionMinLength) + { + return this; + } + + if (compressionMinLength <= 0) + { + throw new ArgumentOutOfRangeException(nameof(compressionMinLength)); + } + + var result = this.Clone(); + result.CompressionMinLength = compressionMinLength; + return result; + } + + /// + /// Gets a copy of these options with the property set to a new value. + /// + /// The new value for the property. Must be at least 256. + /// The new instance; or the original if the value is unchanged. + public MessagePackSerializerOptions WithSuggestedContiguousMemorySize(int suggestedContiguousMemorySize) + { + if (this.SuggestedContiguousMemorySize == suggestedContiguousMemorySize) + { + return this; + } + + if (suggestedContiguousMemorySize < 256) + { + throw new ArgumentOutOfRangeException(nameof(suggestedContiguousMemorySize), "This should be at least 256"); + } + + var result = this.Clone(); + result.SuggestedContiguousMemorySize = suggestedContiguousMemorySize; + return result; + } + /// /// Gets a copy of these options with the property set to a new value. /// @@ -259,6 +333,28 @@ public MessagePackSerializerOptions WithSecurity(MessagePackSecurity security) return result; } + /// + /// Gets a copy of these options with the property set to a new value. + /// + /// The new value for the property. + /// The new instance. + public MessagePackSerializerOptions WithPool(SequencePool pool) + { + if (pool is null) + { + throw new ArgumentNullException(nameof(pool)); + } + + if (this.SequencePool == pool) + { + return this; + } + + var result = this.Clone(); + result.SequencePool = pool; + return result; + } + /// /// Creates a clone of this instance with the same properties set. /// diff --git a/src/MessagePack.UnityClient/Assets/Scripts/MessagePack/MessagePackStreamReader.cs b/src/MessagePack.UnityClient/Assets/Scripts/MessagePack/MessagePackStreamReader.cs index fb439ddc7..2c29bc28c 100644 --- a/src/MessagePack.UnityClient/Assets/Scripts/MessagePack/MessagePackStreamReader.cs +++ b/src/MessagePack.UnityClient/Assets/Scripts/MessagePack/MessagePackStreamReader.cs @@ -21,7 +21,7 @@ public partial class MessagePackStreamReader : IDisposable { private readonly Stream stream; private readonly bool leaveOpen; - private SequencePool.Rental sequenceRental = SequencePool.Shared.Rent(); + private SequencePool.Rental sequenceRental; private SequencePosition? endOfLastMessage; /// @@ -39,9 +39,26 @@ public MessagePackStreamReader(Stream stream) /// The stream to read from. /// If true, leaves the stream open after this is disposed; otherwise, false. public MessagePackStreamReader(Stream stream, bool leaveOpen) + : this(stream, leaveOpen, SequencePool.Shared) { + } + + /// + /// Initializes a new instance of the class. + /// + /// The stream to read from. + /// If true, leaves the stream open after this is disposed; otherwise, false. + /// The pool to rent a object from. + public MessagePackStreamReader(Stream stream, bool leaveOpen, SequencePool sequencePool) + { + if (sequencePool == null) + { + throw new ArgumentNullException(nameof(sequencePool)); + } + this.stream = stream ?? throw new ArgumentNullException(nameof(stream)); this.leaveOpen = leaveOpen; + this.sequenceRental = sequencePool.Rent(); } /// @@ -107,13 +124,26 @@ public void DiscardBufferedData() /// public void Dispose() { - if (!this.leaveOpen) + this.Dispose(true); + GC.SuppressFinalize(this); + } + + /// + /// Disposes of managed and unmanaged resources. + /// + /// if this instance is being disposed; if it is being finalized. + protected virtual void Dispose(bool disposing) + { + if (disposing) { - this.stream.Dispose(); - } + if (!this.leaveOpen) + { + this.stream.Dispose(); + } - this.sequenceRental.Dispose(); - this.sequenceRental = default; + this.sequenceRental.Dispose(); + this.sequenceRental = default; + } } /// diff --git a/src/MessagePack.UnityClient/Assets/Scripts/MessagePack/Nil.cs b/src/MessagePack.UnityClient/Assets/Scripts/MessagePack/Nil.cs index 9533d24dd..04bade766 100644 --- a/src/MessagePack.UnityClient/Assets/Scripts/MessagePack/Nil.cs +++ b/src/MessagePack.UnityClient/Assets/Scripts/MessagePack/Nil.cs @@ -3,6 +3,7 @@ using System; using System.Buffers; +using System.Data.Common; namespace MessagePack { @@ -15,6 +16,10 @@ struct Nil : IEquatable { public static readonly Nil Default = default(Nil); + public static bool operator ==(Nil left, Nil right) => true; + + public static bool operator !=(Nil left, Nil right) => false; + public override bool Equals(object obj) { return obj is Nil; diff --git a/src/MessagePack.UnityClient/Assets/Scripts/MessagePack/Resolvers/AttributeFormatterResolver.cs b/src/MessagePack.UnityClient/Assets/Scripts/MessagePack/Resolvers/AttributeFormatterResolver.cs index 00e5b075c..8dde36ff0 100644 --- a/src/MessagePack.UnityClient/Assets/Scripts/MessagePack/Resolvers/AttributeFormatterResolver.cs +++ b/src/MessagePack.UnityClient/Assets/Scripts/MessagePack/Resolvers/AttributeFormatterResolver.cs @@ -1,10 +1,10 @@ // Copyright (c) All contributors. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. -using System; -using System.Linq; // require UNITY_2018_3_OR_NEWER +using System.Linq; using System.Reflection; using MessagePack.Formatters; +using MessagePack.Internal; namespace MessagePack.Resolvers { @@ -49,14 +49,7 @@ static FormatterCache() formatterType = formatterType.MakeGenericType(typeof(T).GetGenericArguments()); } - if (attr.Arguments == null) - { - Formatter = (IMessagePackFormatter)Activator.CreateInstance(formatterType); - } - else - { - Formatter = (IMessagePackFormatter)Activator.CreateInstance(formatterType, attr.Arguments); - } + Formatter = (IMessagePackFormatter)ResolverUtilities.ActivateFormatter(formatterType, attr.Arguments); } } } diff --git a/src/MessagePack.UnityClient/Assets/Scripts/MessagePack/Resolvers/BuiltinResolver.cs b/src/MessagePack.UnityClient/Assets/Scripts/MessagePack/Resolvers/BuiltinResolver.cs index 8d0316328..0defd99f0 100644 --- a/src/MessagePack.UnityClient/Assets/Scripts/MessagePack/Resolvers/BuiltinResolver.cs +++ b/src/MessagePack.UnityClient/Assets/Scripts/MessagePack/Resolvers/BuiltinResolver.cs @@ -64,9 +64,13 @@ internal static class BuiltinResolverGetFormatterHelper { typeof(byte), ByteFormatter.Instance }, { typeof(sbyte), SByteFormatter.Instance }, { typeof(DateTime), DateTimeFormatter.Instance }, +#if NET6_0_OR_GREATER + { typeof(DateOnly), DateOnlyFormatter.Instance }, + { typeof(TimeOnly), TimeOnlyFormatter.Instance }, +#endif { typeof(char), CharFormatter.Instance }, - // Nulllable Primitive + // Nullable Primitive { typeof(Int16?), NullableInt16Formatter.Instance }, { typeof(Int32?), NullableInt32Formatter.Instance }, { typeof(Int64?), NullableInt64Formatter.Instance }, @@ -151,6 +155,10 @@ internal static class BuiltinResolverGetFormatterHelper { typeof(System.Numerics.BigInteger?), new StaticNullableFormatter(BigIntegerFormatter.Instance) }, { typeof(System.Numerics.Complex), ComplexFormatter.Instance }, { typeof(System.Numerics.Complex?), new StaticNullableFormatter(ComplexFormatter.Instance) }, + +#if NET5_0_OR_GREATER + { typeof(System.Half), HalfFormatter.Instance }, +#endif }; internal static object GetFormatter(Type t) diff --git a/src/MessagePack.UnityClient/Assets/Scripts/MessagePack/Resolvers/DynamicGenericResolver.cs b/src/MessagePack.UnityClient/Assets/Scripts/MessagePack/Resolvers/DynamicGenericResolver.cs index bb555243e..787fcc10e 100644 --- a/src/MessagePack.UnityClient/Assets/Scripts/MessagePack/Resolvers/DynamicGenericResolver.cs +++ b/src/MessagePack.UnityClient/Assets/Scripts/MessagePack/Resolvers/DynamicGenericResolver.cs @@ -70,6 +70,9 @@ internal static class DynamicGenericResolverGetFormatterHelper { typeof(IReadOnlyList<>), typeof(InterfaceReadOnlyListFormatter<>) }, { typeof(IReadOnlyCollection<>), typeof(InterfaceReadOnlyCollectionFormatter<>) }, { typeof(ISet<>), typeof(InterfaceSetFormatter<>) }, +#if NET5_0_OR_GREATER + { typeof(IReadOnlySet<>), typeof(InterfaceReadOnlySetFormatter<>) }, +#endif { typeof(System.Collections.Concurrent.ConcurrentBag<>), typeof(ConcurrentBagFormatter<>) }, { typeof(System.Collections.Concurrent.ConcurrentQueue<>), typeof(ConcurrentQueueFormatter<>) }, { typeof(System.Collections.Concurrent.ConcurrentStack<>), typeof(ConcurrentStackFormatter<>) }, @@ -313,6 +316,30 @@ internal static object GetFormatter(Type t) return CreateInstance(typeof(GenericDictionaryFormatter<,,>), new[] { keyType, valueType, t }); } + // generic dictionary with collection ctor + var dictionaryInterfaceDef = ti.ImplementedInterfaces.FirstOrDefault(x => x.GetTypeInfo().IsConstructedGenericType() && + (x.GetGenericTypeDefinition() == typeof(IDictionary<,>) || x.GetGenericTypeDefinition() == typeof(IReadOnlyDictionary<,>))); + if (dictionaryInterfaceDef != null) + { + Type keyType = dictionaryInterfaceDef.GenericTypeArguments[0]; + Type valueType = dictionaryInterfaceDef.GenericTypeArguments[1]; + Type[] allowedParameterTypes = new Type[] + { + typeof(IDictionary<,>).MakeGenericType(keyType, valueType), + typeof(IReadOnlyDictionary<,>).MakeGenericType(keyType, valueType), + typeof(IEnumerable<>).MakeGenericType(typeof(KeyValuePair<,>).MakeGenericType(keyType, valueType)), + }; + foreach (var constructor in ti.DeclaredConstructors) + { + ParameterInfo[] parameters = constructor.GetParameters(); + if (parameters.Length == 1 && + allowedParameterTypes.Any(allowedType => parameters[0].ParameterType.IsAssignableFrom(allowedType))) + { + return CreateInstance(typeof(GenericReadOnlyDictionaryFormatter<,,>), new[] { keyType, valueType, t }); + } + } + } + // generic collection var collectionDef = ti.ImplementedInterfaces.FirstOrDefault(x => x.GetTypeInfo().IsConstructedGenericType() && x.GetGenericTypeDefinition() == typeof(ICollection<>)); if (collectionDef != null && ti.DeclaredConstructors.Any(x => x.GetParameters().Length == 0)) @@ -320,6 +347,23 @@ internal static object GetFormatter(Type t) Type elemType = collectionDef.GenericTypeArguments[0]; return CreateInstance(typeof(GenericCollectionFormatter<,>), new[] { elemType, t }); } + + // generic IEnumerable collection + // looking for combination of IEnumerable and constructor that takes + // enumeration of the same type + foreach (var enumerableCollectionDef in ti.ImplementedInterfaces.Where(x => x.GetTypeInfo().IsConstructedGenericType() && x.GetGenericTypeDefinition() == typeof(IEnumerable<>))) + { + Type elemType = enumerableCollectionDef.GenericTypeArguments[0]; + Type paramInterface = typeof(IEnumerable<>).MakeGenericType(elemType); + foreach (var constructor in ti.DeclaredConstructors) + { + var parameters = constructor.GetParameters(); + if (parameters.Length == 1 && parameters[0].ParameterType.IsAssignableFrom(paramInterface)) + { + return CreateInstance(typeof(GenericEnumerableFormatter<,>), new[] { elemType, t }); + } + } + } } return null; diff --git a/src/MessagePack.UnityClient/Assets/Scripts/MessagePack/Resolvers/DynamicObjectResolver.cs b/src/MessagePack.UnityClient/Assets/Scripts/MessagePack/Resolvers/DynamicObjectResolver.cs index f285082dc..643a6643b 100644 --- a/src/MessagePack.UnityClient/Assets/Scripts/MessagePack/Resolvers/DynamicObjectResolver.cs +++ b/src/MessagePack.UnityClient/Assets/Scripts/MessagePack/Resolvers/DynamicObjectResolver.cs @@ -14,6 +14,7 @@ using System.Threading; using MessagePack.Formatters; using MessagePack.Internal; +using MessagePack.Resolvers; #pragma warning disable SA1403 // File may only contain a single namespace @@ -94,13 +95,23 @@ static FormatterCache() return; } - TypeInfo formatterTypeInfo = DynamicObjectTypeBuilder.BuildType(DynamicAssembly.Value, typeof(T), false, false); + TypeInfo formatterTypeInfo; + try + { + formatterTypeInfo = DynamicObjectTypeBuilder.BuildType(DynamicAssembly.Value, typeof(T), false, false); + } + catch (InitAccessorInGenericClassNotSupportedException) + { + Formatter = (IMessagePackFormatter)DynamicObjectTypeBuilder.BuildFormatterToDynamicMethod(typeof(T), false, false, false); + return; + } + if (formatterTypeInfo == null) { return; } - Formatter = (IMessagePackFormatter)Activator.CreateInstance(formatterTypeInfo.AsType()); + Formatter = (IMessagePackFormatter)ResolverUtilities.ActivateFormatter(formatterTypeInfo.AsType()); } } } @@ -224,7 +235,7 @@ static FormatterCache() return; } - if (ti.IsAnonymous()) + if (ti.IsAnonymous() || ti.HasPrivateCtorForSerialization()) { Formatter = (IMessagePackFormatter)DynamicObjectTypeBuilder.BuildFormatterToDynamicMethod(typeof(T), true, true, false); return; @@ -341,7 +352,7 @@ public static TypeInfo BuildType(DynamicAssembly assembly, Type type, bool force return null; } - var serializationInfo = MessagePack.Internal.ObjectSerializationInfo.CreateOrNull(type, forceStringKey, contractless, false); + var serializationInfo = MessagePack.Internal.ObjectSerializationInfo.CreateOrNull(type, forceStringKey, contractless, false, dynamicMethod: false); if (serializationInfo == null) { return null; @@ -455,7 +466,7 @@ public static TypeInfo BuildType(DynamicAssembly assembly, Type type, bool force public static object BuildFormatterToDynamicMethod(Type type, bool forceStringKey, bool contractless, bool allowPrivate) { - var serializationInfo = ObjectSerializationInfo.CreateOrNull(type, forceStringKey, contractless, allowPrivate); + var serializationInfo = ObjectSerializationInfo.CreateOrNull(type, forceStringKey, contractless, allowPrivate, dynamicMethod: true); if (serializationInfo == null) { return null; @@ -475,7 +486,7 @@ public static object BuildFormatterToDynamicMethod(Type type, bool forceStringKe var i = 0; foreach (ObjectSerializationInfo.EmittableMember item in serializationInfo.Members.Where(x => x.IsReadable)) { - stringByteKeysField.Add(Utilities.GetWriterBytes(item.StringKey, (ref MessagePackWriter writer, string arg) => writer.Write(arg))); + stringByteKeysField.Add(Utilities.GetWriterBytes(item.StringKey, (ref MessagePackWriter writer, string arg) => writer.Write(arg), SequencePool.Shared)); i++; } } @@ -485,7 +496,7 @@ public static object BuildFormatterToDynamicMethod(Type type, bool forceStringKe MessagePackFormatterAttribute attr = item.GetMessagePackFormatterAttribute(); if (attr != null) { - var formatter = Activator.CreateInstance(attr.FormatterType, attr.Arguments); + IMessagePackFormatter formatter = ResolverUtilities.ActivateFormatter(attr.FormatterType, attr.Arguments); serializeCustomFormatters.Add(formatter); } else @@ -500,7 +511,7 @@ public static object BuildFormatterToDynamicMethod(Type type, bool forceStringKe MessagePackFormatterAttribute attr = item.GetMessagePackFormatterAttribute(); if (attr != null) { - var formatter = Activator.CreateInstance(attr.FormatterType, attr.Arguments); + IMessagePackFormatter formatter = ResolverUtilities.ActivateFormatter(attr.FormatterType, attr.Arguments); deserializeCustomFormatters.Add(formatter); } else @@ -611,43 +622,60 @@ private static void BuildConstructor(Type type, ObjectSerializationInfo info, Co private static Dictionary BuildCustomFormatterField(TypeBuilder builder, ObjectSerializationInfo info, ILGenerator il) { Dictionary dict = new Dictionary(); - foreach (ObjectSerializationInfo.EmittableMember item in info.Members.Where(x => x.IsReadable || x.IsWritable)) + foreach (ObjectSerializationInfo.EmittableMember item in info.Members.Where(x => x.IsReadable || x.IsActuallyWritable)) { MessagePackFormatterAttribute attr = item.GetMessagePackFormatterAttribute(); if (attr != null) { - FieldBuilder f = builder.DefineField(item.Name + "_formatter", attr.FormatterType, FieldAttributes.Private | FieldAttributes.InitOnly); - - var bindingFlags = (int)(BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic); + // Verify that the specified formatter implements the required interface. + // Doing this now provides a more helpful error message than if we let the CLR throw an EntryPointNotFoundException later. + if (!attr.FormatterType.GetInterfaces().Any(i => i.IsGenericType && i.GetGenericTypeDefinition() == typeof(IMessagePackFormatter<>) && i.GenericTypeArguments[0].IsEquivalentTo(item.Type))) + { + throw new MessagePackSerializationException($"{info.Type.FullName}.{item.Name} is declared as type {item.Type.FullName}, but the prescribed {attr.FormatterType.FullName} does not implement IMessagePackFormatter<{item.Type.Name}>."); + } - LocalBuilder attrVar = il.DeclareLocal(typeof(MessagePackFormatterAttribute)); + FieldBuilder f = builder.DefineField(item.Name + "_formatter", attr.FormatterType, FieldAttributes.Private | FieldAttributes.InitOnly); - il.Emit(OpCodes.Ldtoken, info.Type); - il.EmitCall(EmitInfo.GetTypeFromHandle); - il.Emit(OpCodes.Ldstr, item.Name); - il.EmitLdc_I4(bindingFlags); - if (item.IsProperty) + // If no args were provided and the formatter implements the singleton pattern, fetch the formatter from the field. + if ((attr.Arguments == null || attr.Arguments.Length == 0) && ResolverUtilities.FetchSingletonField(attr.FormatterType) is FieldInfo singletonField) { - il.EmitCall(EmitInfo.TypeGetProperty); + il.EmitLoadThis(); + il.EmitLdsfld(singletonField); } else { - il.EmitCall(EmitInfo.TypeGetField); - } + var bindingFlags = (int)(BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic); - il.EmitTrue(); - il.EmitCall(EmitInfo.GetCustomAttributeMessagePackFormatterAttribute); - il.EmitStloc(attrVar); + LocalBuilder attrVar = il.DeclareLocal(typeof(MessagePackFormatterAttribute)); - il.EmitLoadThis(); + il.Emit(OpCodes.Ldtoken, info.Type); + il.EmitCall(EmitInfo.GetTypeFromHandle); + il.Emit(OpCodes.Ldstr, item.Name); + il.EmitLdc_I4(bindingFlags); + if (item.IsProperty) + { + il.EmitCall(EmitInfo.TypeGetProperty); + } + else + { + il.EmitCall(EmitInfo.TypeGetField); + } - il.EmitLdloc(attrVar); - il.EmitCall(EmitInfo.MessagePackFormatterAttr.FormatterType); - il.EmitLdloc(attrVar); - il.EmitCall(EmitInfo.MessagePackFormatterAttr.Arguments); - il.EmitCall(EmitInfo.ActivatorCreateInstance); + il.EmitTrue(); + il.EmitCall(EmitInfo.GetCustomAttributeMessagePackFormatterAttribute); + il.EmitStloc(attrVar); + + il.EmitLoadThis(); + + il.EmitLdloc(attrVar); + il.EmitCall(EmitInfo.MessagePackFormatterAttr.FormatterType); + il.EmitLdloc(attrVar); + il.EmitCall(EmitInfo.MessagePackFormatterAttr.Arguments); + il.EmitCall(EmitInfo.ActivatorCreateInstance); + + il.Emit(OpCodes.Castclass, attr.FormatterType); + } - il.Emit(OpCodes.Castclass, attr.FormatterType); il.Emit(OpCodes.Stfld, f); dict.Add(item, f); @@ -796,7 +824,7 @@ private static void EmitSerializeValue(ILGenerator il, TypeInfo type, ObjectSeri argOptions.EmitLoad(); il.EmitCall(getSerialize(t)); } - else if (IsOptimizeTargetType(t)) + else if (ObjectSerializationInfo.IsOptimizeTargetType(t)) { if (!t.GetTypeInfo().IsValueType) { @@ -851,407 +879,683 @@ private static void EmitSerializeValue(ILGenerator il, TypeInfo type, ObjectSeri // T Deserialize([arg:1]ref MessagePackReader reader, [arg:2]MessagePackSerializerOptions options); private static void BuildDeserialize(Type type, ObjectSerializationInfo info, ILGenerator il, Func tryEmitLoadCustomFormatter, int firstArgIndex) { - var reader = new ArgumentField(il, firstArgIndex, @ref: true); + var argReader = new ArgumentField(il, firstArgIndex, @ref: true); var argOptions = new ArgumentField(il, firstArgIndex + 1); - // if(reader.TryReadNil()) { return null; } - Label falseLabel = il.DefineLabel(); - reader.EmitLdarg(); - il.EmitCall(MessagePackReaderTypeInfo.TryReadNil); - il.Emit(OpCodes.Brfalse_S, falseLabel); - if (type.GetTypeInfo().IsClass) - { - il.Emit(OpCodes.Ldnull); - il.Emit(OpCodes.Ret); - } - else + // if (reader.TryReadNil()) { throw / return; } + BuildDeserializeInternalTryReadNil(type, il, ref argReader); + + // T ____result; + var localResult = il.DeclareLocal(type); + + // where T : new() + var canOverwrite = info.ConstructorParameters.Length == 0; + if (canOverwrite) { - il.Emit(OpCodes.Ldstr, "typecode is null, struct not supported"); - il.Emit(OpCodes.Newobj, messagePackSerializationExceptionMessageOnlyConstructor); - il.Emit(OpCodes.Throw); + // ____result = new T(); + BuildDeserializeInternalCreateInstance(type, info, il, localResult); } - il.MarkLabel(falseLabel); - // options.Security.DepthStep(ref reader); - argOptions.EmitLoad(); - il.EmitCall(getSecurityFromOptions); - reader.EmitLdarg(); - il.EmitCall(securityDepthStep); - - // var length = ReadMapHeader(ref byteSequence); - LocalBuilder length = il.DeclareLocal(typeof(int)); // [loc:1] - reader.EmitLdarg(); + BuildDeserializeInternalDepthStep(il, ref argReader, ref argOptions); - if (info.IsIntKey) - { - il.EmitCall(MessagePackReaderTypeInfo.ReadArrayHeader); - } - else - { - il.EmitCall(MessagePackReaderTypeInfo.ReadMapHeader); - } + // var length = reader.Read(Map|Array)Header(); + var localLength = BuildDeserializeInternalReadHeaderLength(info, il, ref argReader); - il.EmitStloc(length); + // var resolver = options.Resolver; + var localResolver = BuildDeserializeInternalResolver(info, il, ref argOptions); - // make local fields - Label? gotoDefault = null; - DeserializeInfo[] infoList; if (info.IsIntKey) { - var maxKey = info.Members.Select(x => x.IntKey).DefaultIfEmpty(-1).Max(); - var len = maxKey + 1; - var intKeyMap = info.Members.ToDictionary(x => x.IntKey); - - infoList = Enumerable.Range(0, len) - .Select(x => - { - ObjectSerializationInfo.EmittableMember member; - if (intKeyMap.TryGetValue(x, out member)) - { - return new DeserializeInfo - { - MemberInfo = member, - LocalField = il.DeclareLocal(member.Type), - SwitchLabel = il.DefineLabel(), - }; - } - else - { - // return null MemberInfo, should filter null - if (gotoDefault == null) - { - gotoDefault = il.DefineLabel(); - } - - return new DeserializeInfo - { - MemberInfo = null, - LocalField = null, - SwitchLabel = gotoDefault.Value, - }; - } - }) - .ToArray(); + // switch (key) { ... } + BuildDeserializeInternalDeserializeEachPropertyIntKey(info, il, tryEmitLoadCustomFormatter, canOverwrite, ref argReader, ref argOptions, localResolver, localResult, localLength); } else { - infoList = info.Members - .Select(item => new DeserializeInfo - { - MemberInfo = item, - LocalField = il.DeclareLocal(item.Type), - //// SwitchLabel = il.DefineLabel() - }) - .ToArray(); + // var span = reader.ReadStringSpan(); + BuildDeserializeInternalDeserializeEachPropertyStringKey(info, il, tryEmitLoadCustomFormatter, canOverwrite, ref argReader, argOptions, localResolver, localResult, localLength); } - // IFormatterResolver resolver = options.Resolver; - LocalBuilder localResolver = il.DeclareLocal(typeof(IFormatterResolver)); - argOptions.EmitLoad(); - il.EmitCall(getResolverFromOptions); - il.EmitStloc(localResolver); - - // Read Loop(for var i = 0; i < length; i++) - if (info.IsStringKey) - { - var automata = new AutomataDictionary(); - for (int i = 0; i < info.Members.Length; i++) - { - automata.Add(info.Members[i].StringKey, i); - } - - LocalBuilder buffer = il.DeclareLocal(typeof(ReadOnlySpan)); - LocalBuilder longKey = il.DeclareLocal(typeof(ulong)); + // ____result.OnAfterDeserialize() + BuildDeserializeInternalOnAfterDeserialize(type, info, il, localResult); - // for (int i = 0; i < len; i++) - il.EmitIncrementFor(length, forILocal => - { - Label readNext = il.DefineLabel(); - Label loopEnd = il.DefineLabel(); + // reader.Depth--; + BuildDeserializeInternalDepthUnStep(il, ref argReader); - reader.EmitLdarg(); - il.EmitCall(ReadStringSpan); - il.EmitStloc(buffer); + // return ____result; + il.Emit(OpCodes.Ldloc, localResult); + il.Emit(OpCodes.Ret); + } - // gen automata name lookup - automata.EmitMatch( - il, - buffer, - longKey, - x => - { - var i = x.Value; - if (infoList[i].MemberInfo != null) - { - EmitDeserializeValue(il, infoList[i], i, tryEmitLoadCustomFormatter, reader, argOptions, localResolver); - il.Emit(OpCodes.Br, loopEnd); - } - else - { - il.Emit(OpCodes.Br, readNext); - } - }, - () => - { - il.Emit(OpCodes.Br, readNext); - }); + private static void BuildDeserializeInternalDeserializeEachPropertyStringKey(ObjectSerializationInfo info, ILGenerator il, Func tryEmitLoadCustomFormatter, bool canOverwrite, ref ArgumentField argReader, ArgumentField argOptions, LocalBuilder localResolver, LocalBuilder localResult, LocalBuilder localLength) + { + // Prepare local variables or assignment fields/properties + var infoList = BuildDeserializeInternalDeserializationInfoArrayStringKey(info, il, canOverwrite); - il.MarkLabel(readNext); - reader.EmitLdarg(); - il.EmitCall(MessagePackReaderTypeInfo.Skip); + // Read Loop(for var i = 0; i < length; i++) + BuildDeserializeInternalDeserializeLoopStringKey(il, tryEmitLoadCustomFormatter, ref argReader, ref argOptions, infoList, localResolver, localResult, localLength, canOverwrite, info); - il.MarkLabel(loopEnd); - }); - } - else + if (canOverwrite) { - LocalBuilder key = il.DeclareLocal(typeof(int)); - Label switchDefault = il.DefineLabel(); - - il.EmitIncrementFor(length, forILocal => - { - Label loopEnd = il.DefineLabel(); - - il.EmitLdloc(forILocal); - il.EmitStloc(key); - - // switch... local = Deserialize - il.EmitLdloc(key); - - il.Emit(OpCodes.Switch, infoList.Select(x => x.SwitchLabel).ToArray()); + return; + } - il.MarkLabel(switchDefault); + // ____result = new T(...); + BuildDeserializeInternalCreateInstanceWithArguments(info, il, infoList, localResult); - // default, only read. reader.ReadNextBlock(); - reader.EmitLdarg(); - il.EmitCall(MessagePackReaderTypeInfo.Skip); - il.Emit(OpCodes.Br, loopEnd); + // ... if (__field__IsInitialized) { ____result.field = __field__; } ... + BuildDeserializeInternalAssignFieldFromLocalVariableStringKey(info, il, infoList, localResult); + } - if (gotoDefault != null) - { - il.MarkLabel(gotoDefault.Value); - il.Emit(OpCodes.Br, switchDefault); - } + private static void BuildDeserializeInternalDeserializeEachPropertyIntKey(ObjectSerializationInfo info, ILGenerator il, Func tryEmitLoadCustomFormatter, bool canOverwrite, ref ArgumentField argReader, ref ArgumentField argOptions, LocalBuilder localResolver, LocalBuilder localResult, LocalBuilder localLength) + { + // Prepare local variables or assignment fields/properties + var infoList = BuildDeserializeInternalDeserializationInfoArrayIntKey(info, il, canOverwrite, out var gotoDefault, out var maxKey); - var i = 0; - foreach (DeserializeInfo item in infoList) - { - if (item.MemberInfo != null) - { - il.MarkLabel(item.SwitchLabel); - EmitDeserializeValue(il, item, i++, tryEmitLoadCustomFormatter, reader, argOptions, localResolver); - il.Emit(OpCodes.Br, loopEnd); - } - } + // Read Loop(for var i = 0; i < length; i++) + BuildDeserializeInternalDeserializeLoopIntKey(il, tryEmitLoadCustomFormatter, ref argReader, ref argOptions, infoList, localResolver, localResult, localLength, canOverwrite, gotoDefault); - il.MarkLabel(loopEnd); - }); + if (canOverwrite) + { + return; } - // create result object - LocalBuilder structLocal = EmitNewObject(il, type, info, infoList); + // ____result = new T(...); + BuildDeserializeInternalCreateInstanceWithArguments(info, il, infoList, localResult); - // IMessagePackSerializationCallbackReceiver.OnAfterDeserialize() - if (type.GetTypeInfo().ImplementedInterfaces.Any(x => x == typeof(IMessagePackSerializationCallbackReceiver))) + // ... ____result.field = __field__; ... + BuildDeserializeInternalAssignFieldFromLocalVariableIntKey(info, il, infoList, localResult, localLength, maxKey); + } + + private static void BuildDeserializeInternalAssignFieldFromLocalVariableStringKey(ObjectSerializationInfo info, ILGenerator il, DeserializeInfo[] infoList, LocalBuilder localResult) + { + foreach (var item in infoList) { - // call directly - MethodInfo[] runtimeMethods = type.GetRuntimeMethods().Where(x => x.Name == "OnAfterDeserialize").ToArray(); - if (runtimeMethods.Length == 1) + if (item.MemberInfo == null || item.IsInitializedLocalVariable == null || item.MemberInfo.IsWrittenByConstructor) { - if (info.IsClass) - { - il.Emit(OpCodes.Dup); - } - else - { - il.EmitLdloca(structLocal); - } + continue; + } - il.Emit(OpCodes.Call, runtimeMethods[0]); // don't use EmitCall helper(must use 'Call') + // if (__field__IsInitialized) { ____result.field = __field__; } + var skipLabel = il.DefineLabel(); + il.EmitLdloc(item.IsInitializedLocalVariable); + il.Emit(OpCodes.Brfalse_S, skipLabel); + + if (info.IsClass) + { + il.EmitLdloc(localResult); } else { - if (info.IsStruct) - { - il.EmitLdloc(structLocal); - il.Emit(OpCodes.Box, type); - } - else - { - il.Emit(OpCodes.Dup); - } - - il.EmitCall(onAfterDeserialize); + il.EmitLdloca(localResult); } - } - // reader.Depth--; - reader.EmitLdarg(); - il.Emit(OpCodes.Dup); - il.EmitCall(readerDepthGet); - il.Emit(OpCodes.Ldc_I4_1); - il.Emit(OpCodes.Sub_Ovf); - il.EmitCall(readerDepthSet); + il.EmitLdloc(item.LocalVariable); + item.MemberInfo.EmitStoreValue(il); - if (info.IsStruct) - { - il.Emit(OpCodes.Ldloc, structLocal); + il.MarkLabel(skipLabel); } - - il.Emit(OpCodes.Ret); } - private static void EmitDeserializeValue(ILGenerator il, DeserializeInfo info, int index, Func tryEmitLoadCustomFormatter, ArgumentField argReader, ArgumentField argOptions, LocalBuilder localResolver) + private static void BuildDeserializeInternalAssignFieldFromLocalVariableIntKey(ObjectSerializationInfo info, ILGenerator il, DeserializeInfo[] infoList, LocalBuilder localResult, LocalBuilder localLength, int maxKey) { - Label storeLabel = il.DefineLabel(); - ObjectSerializationInfo.EmittableMember member = info.MemberInfo; - Type t = member.Type; - Action emitter = tryEmitLoadCustomFormatter(index, member); - if (emitter != null) + if (maxKey == -1) { - emitter(); - argReader.EmitLdarg(); - argOptions.EmitLoad(); - il.EmitCall(getDeserialize(t)); + return; } - else if (IsOptimizeTargetType(t)) + + Label? memberAssignmentDoneLabel = null; + var intKeyMap = infoList.Where(x => x.MemberInfo != null && x.MemberInfo.IsActuallyWritable).ToDictionary(x => x.MemberInfo.IntKey); + for (var key = 0; key <= maxKey; key++) { - if (!t.GetTypeInfo().IsValueType) + if (!intKeyMap.TryGetValue(key, out var item)) { - // As a nullable type (e.g. byte[] and string) we need to first call TryReadNil - // if (reader.TryReadNil()) - Label readNonNilValueLabel = il.DefineLabel(); - argReader.EmitLdarg(); - il.EmitCall(MessagePackReaderTypeInfo.TryReadNil); - il.Emit(OpCodes.Brfalse_S, readNonNilValueLabel); - il.Emit(OpCodes.Ldnull); - il.Emit(OpCodes.Br, storeLabel); + continue; + } - il.MarkLabel(readNonNilValueLabel); + if (item.MemberInfo.IsWrittenByConstructor) + { + continue; } - argReader.EmitLdarg(); - if (t == typeof(byte[])) + // if (length <= key) { goto MEMBER_ASSIGNMENT_DONE; } + il.EmitLdloc(localLength); + il.EmitLdc_I4(key); + if (memberAssignmentDoneLabel == null) { - LocalBuilder local = il.DeclareLocal(typeof(ReadOnlySequence?)); - il.EmitCall(MessagePackReaderTypeInfo.ReadBytes); - il.EmitStloc(local); - il.EmitLdloca(local); - il.EmitCall(ArrayFromNullableReadOnlySequence); + memberAssignmentDoneLabel = il.DefineLabel(); + } + + il.Emit(OpCodes.Ble, memberAssignmentDoneLabel.Value); + + // ____result.field = __field__; + if (info.IsClass) + { + il.EmitLdloc(localResult); } else { - il.EmitCall(MessagePackReaderTypeInfo.TypeInfo.GetDeclaredMethods("Read" + t.Name).First(x => x.GetParameters().Length == 0)); + il.EmitLdloca(localResult); } + + il.EmitLdloc(item.LocalVariable); + item.MemberInfo.EmitStoreValue(il); } - else + + // MEMBER_ASSIGNMENT_DONE: + if (memberAssignmentDoneLabel != null) { - il.EmitLdloc(localResolver); - il.EmitCall(getFormatterWithVerify.MakeGenericMethod(t)); - argReader.EmitLdarg(); - argOptions.EmitLoad(); - il.EmitCall(getDeserialize(t)); + il.MarkLabel(memberAssignmentDoneLabel.Value); } - - il.MarkLabel(storeLabel); - il.EmitStloc(info.LocalField); } - private static LocalBuilder EmitNewObject(ILGenerator il, Type type, ObjectSerializationInfo info, DeserializeInfo[] members) + private static void BuildDeserializeInternalCreateInstanceWithArguments(ObjectSerializationInfo info, ILGenerator il, DeserializeInfo[] infoList, LocalBuilder localResult) { - if (info.IsClass) + foreach (var item in info.ConstructorParameters) { - EmitNewObjectConstructorArguments(il, info, members); - - il.Emit(OpCodes.Newobj, info.BestmatchConstructor); + var local = infoList.First(x => x.MemberInfo == item.MemberInfo); + il.EmitLdloc(local.LocalVariable); - foreach (DeserializeInfo item in members.Where(x => x.MemberInfo != null && x.MemberInfo.IsWritable)) + if (!item.ConstructorParameter.ParameterType.IsValueType && local.MemberInfo.IsValueType) { - il.Emit(OpCodes.Dup); - il.EmitLdloc(item.LocalField); - item.MemberInfo.EmitStoreValue(il); + // When a constructor argument of type object is being provided by a serialized member value that is a value type + // then that value must be boxed in order for the generated code to be valid (see issue #987). This may occur because + // the only requirement when determining whether a member value may be used to populate a constructor argument in an + // IsAssignableFrom check and typeof(object) IsAssignableFrom typeof(int), for example. + il.Emit(OpCodes.Box, local.MemberInfo.Type); } - - return null; } - else + + il.Emit(OpCodes.Newobj, info.BestmatchConstructor); + il.Emit(OpCodes.Stloc, localResult); + } + + private static DeserializeInfo[] BuildDeserializeInternalDeserializationInfoArrayStringKey(ObjectSerializationInfo info, ILGenerator il, bool canOverwrite) + { + var infoList = new DeserializeInfo[info.Members.Length]; + for (var i = 0; i < infoList.Length; i++) { - LocalBuilder result = il.DeclareLocal(type); - if (info.BestmatchConstructor == null) + var item = info.Members[i]; + if (canOverwrite && item.IsActuallyWritable) { - il.Emit(OpCodes.Ldloca, result); - il.Emit(OpCodes.Initobj, type); + infoList[i] = new DeserializeInfo + { + MemberInfo = item, + }; } else { - EmitNewObjectConstructorArguments(il, info, members); - - il.Emit(OpCodes.Newobj, info.BestmatchConstructor); - il.Emit(OpCodes.Stloc, result); - } - - foreach (DeserializeInfo item in members.Where(x => x.MemberInfo != null && x.MemberInfo.IsWritable)) - { - il.EmitLdloca(result); - il.EmitLdloc(item.LocalField); - item.MemberInfo.EmitStoreValue(il); + var isConstructorParameter = info.ConstructorParameters.Any(p => p.MemberInfo.Equals(item)); + infoList[i] = new DeserializeInfo + { + MemberInfo = item, + LocalVariable = il.DeclareLocal(item.Type), + IsInitializedLocalVariable = isConstructorParameter ? default : il.DeclareLocal(typeof(bool)), + }; } - - return result; // struct returns local result field } + + return infoList; } - private static void EmitNewObjectConstructorArguments(ILGenerator il, ObjectSerializationInfo info, DeserializeInfo[] members) + private static DeserializeInfo[] BuildDeserializeInternalDeserializationInfoArrayIntKey(ObjectSerializationInfo info, ILGenerator il, bool canOverwrite, out Label? gotoDefault, out int maxKey) { - foreach (ObjectSerializationInfo.EmittableMemberAndConstructorParameter item in info.ConstructorParameters) - { - DeserializeInfo local = members.First(x => x.MemberInfo == item.MemberInfo); - il.EmitLdloc(local.LocalField); + maxKey = info.Members.Select(x => x.IntKey).DefaultIfEmpty(-1).Max(); + var len = maxKey + 1; + var intKeyMap = info.Members.ToDictionary(x => x.IntKey); + gotoDefault = null; - if (!item.ConstructorParameter.ParameterType.IsValueType && local.MemberInfo.IsValueType) + var infoList = new DeserializeInfo[len]; + for (var i = 0; i < infoList.Length; i++) + { + if (intKeyMap.TryGetValue(i, out var member)) { - // When a constructor argument of type object is being provided by a serialized member value that is a value type - // then that value must be boxed in order for the generated code to be valid (see issue #987). This may occur because - // the only requirement when determining whether a member value may be used to populate a constructor argument in an - // IsAssignableFrom check and typeof(object) IsAssignableFrom typeof(int), for example. - il.Emit(OpCodes.Box, local.MemberInfo.Type); + if (canOverwrite && member.IsActuallyWritable) + { + infoList[i] = new DeserializeInfo + { + MemberInfo = member, + SwitchLabel = il.DefineLabel(), + }; + } + else + { + infoList[i] = new DeserializeInfo + { + MemberInfo = member, + LocalVariable = il.DeclareLocal(member.Type), + SwitchLabel = il.DefineLabel(), + }; + } + } + else + { + // return null MemberInfo, should filter null + if (gotoDefault == null) + { + gotoDefault = il.DefineLabel(); + } + + infoList[i] = new DeserializeInfo + { + SwitchLabel = gotoDefault.Value, + }; } } + + return infoList; } - /// - /// Keep this list in sync with ShouldUseFormatterResolverHelper.PrimitiveTypes. - /// - private static bool IsOptimizeTargetType(Type type) + private static void BuildDeserializeInternalDeserializeLoopIntKey(ILGenerator il, Func tryEmitLoadCustomFormatter, ref ArgumentField argReader, ref ArgumentField argOptions, DeserializeInfo[] infoList, LocalBuilder localResolver, LocalBuilder localResult, LocalBuilder localLength, bool canOverwrite, Label? gotoDefault) { - return type == typeof(Int16) - || type == typeof(Int32) - || type == typeof(Int64) - || type == typeof(UInt16) - || type == typeof(UInt32) - || type == typeof(UInt64) - || type == typeof(Single) - || type == typeof(Double) - || type == typeof(bool) - || type == typeof(byte) - || type == typeof(sbyte) - || type == typeof(char) - || type == typeof(byte[]) - - // Do not include types that resolvers are allowed to modify. - ////|| type == typeof(DateTime) // OldSpec has no support, so for that and perf reasons a .NET native DateTime resolver exists. - ////|| type == typeof(string) // https://github.com/Cysharp/MasterMemory provides custom formatter for string interning. - ; - } + var key = il.DeclareLocal(typeof(int)); + var switchDefault = il.DefineLabel(); + var reader = argReader; + var options = argOptions; -#pragma warning disable SA1311 // Static readonly fields should begin with upper-case letter + void ForBody(LocalBuilder forILocal) + { + var loopEnd = il.DefineLabel(); - // EmitInfos... - private static readonly Type refMessagePackReader = typeof(MessagePackReader).MakeByRefType(); + il.EmitLdloc(forILocal); + il.EmitStloc(key); - private static readonly MethodInfo ReadOnlySpanFromByteArray = typeof(ReadOnlySpan).GetRuntimeMethod("op_Implicit", new[] { typeof(byte[]) }); - private static readonly MethodInfo ReadStringSpan = typeof(CodeGenHelpers).GetRuntimeMethod(nameof(CodeGenHelpers.ReadStringSpan), new[] { typeof(MessagePackReader).MakeByRefType() }); + // switch... local = Deserialize + il.EmitLdloc(key); + + il.Emit(OpCodes.Switch, infoList.Select(x => x.SwitchLabel).ToArray()); + + il.MarkLabel(switchDefault); + + // default, only read. reader.ReadNextBlock(); + reader.EmitLdarg(); + il.EmitCall(MessagePackReaderTypeInfo.Skip); + il.Emit(OpCodes.Br, loopEnd); + + if (gotoDefault != null) + { + il.MarkLabel(gotoDefault.Value); + il.Emit(OpCodes.Br, switchDefault); + } + + var i = 0; + foreach (var item in infoList) + { + if (item.MemberInfo == null) + { + continue; + } + + il.MarkLabel(item.SwitchLabel); + if (canOverwrite) + { + BuildDeserializeInternalDeserializeValueAssignDirectly(il, item, i++, tryEmitLoadCustomFormatter, ref reader, ref options, localResolver, localResult); + } + else + { + BuildDeserializeInternalDeserializeValueAssignLocalVariable(il, item, i++, tryEmitLoadCustomFormatter, ref reader, ref options, localResolver, localResult); + } + + il.Emit(OpCodes.Br, loopEnd); + } + + il.MarkLabel(loopEnd); + } + + il.EmitIncrementFor(localLength, ForBody); + } + + private static void BuildDeserializeInternalDeserializeLoopStringKey(ILGenerator il, Func tryEmitLoadCustomFormatter, ref ArgumentField argReader, ref ArgumentField argOptions, DeserializeInfo[] infoList, LocalBuilder localResolver, LocalBuilder localResult, LocalBuilder localLength, bool canOverwrite, ObjectSerializationInfo info) + { + var automata = new AutomataDictionary(); + for (var i = 0; i < info.Members.Length; i++) + { + automata.Add(info.Members[i].StringKey, i); + } + + var buffer = il.DeclareLocal(typeof(ReadOnlySpan)); + var longKey = il.DeclareLocal(typeof(ulong)); + var reader = argReader; + var options = argOptions; + + // for (int i = 0; i < len; i++) + void ForBody(LocalBuilder forILocal) + { + var readNext = il.DefineLabel(); + var loopEnd = il.DefineLabel(); + + reader.EmitLdarg(); + il.EmitCall(ReadStringSpan); + il.EmitStloc(buffer); + + // gen automata name lookup + void OnFoundAssignDirect(KeyValuePair x) + { + var i = x.Value; + var item = infoList[i]; + if (item.MemberInfo != null) + { + BuildDeserializeInternalDeserializeValueAssignDirectly(il, item, i, tryEmitLoadCustomFormatter, ref reader, ref options, localResolver, localResult); + il.Emit(OpCodes.Br, loopEnd); + } + else + { + il.Emit(OpCodes.Br, readNext); + } + } + + void OnFoundAssignLocalVariable(KeyValuePair x) + { + var i = x.Value; + var item = infoList[i]; + if (item.MemberInfo != null) + { + BuildDeserializeInternalDeserializeValueAssignLocalVariable(il, item, i, tryEmitLoadCustomFormatter, ref reader, ref options, localResolver, localResult); + il.Emit(OpCodes.Br, loopEnd); + } + else + { + il.Emit(OpCodes.Br, readNext); + } + } + + void OnNotFound() + { + il.Emit(OpCodes.Br, readNext); + } + +#if NET_STANDARD_2_0 + throw new NotImplementedException("NET_STANDARD_2_0 directive was used"); +#else + if (canOverwrite) + { + automata.EmitMatch(il, buffer, longKey, OnFoundAssignDirect, OnNotFound); + } + else + { + automata.EmitMatch(il, buffer, longKey, OnFoundAssignLocalVariable, OnNotFound); + } +#endif + + il.MarkLabel(readNext); + reader.EmitLdarg(); + il.EmitCall(MessagePackReaderTypeInfo.Skip); + + il.MarkLabel(loopEnd); + } + + il.EmitIncrementFor(localLength, ForBody); + } + + private static void BuildDeserializeInternalTryReadNil(Type type, ILGenerator il, ref ArgumentField argReader) + { + // if(reader.TryReadNil()) { return null; } + var falseLabel = il.DefineLabel(); + argReader.EmitLdarg(); + il.EmitCall(MessagePackReaderTypeInfo.TryReadNil); + il.Emit(OpCodes.Brfalse_S, falseLabel); + if (type.GetTypeInfo().IsClass) + { + il.Emit(OpCodes.Ldnull); + il.Emit(OpCodes.Ret); + } + else + { + il.Emit(OpCodes.Ldstr, "typecode is null, struct not supported"); + il.Emit(OpCodes.Newobj, messagePackSerializationExceptionMessageOnlyConstructor); + il.Emit(OpCodes.Throw); + } + + il.MarkLabel(falseLabel); + } + + private static void BuildDeserializeInternalDepthUnStep(ILGenerator il, ref ArgumentField argReader) + { + argReader.EmitLdarg(); + il.Emit(OpCodes.Dup); + il.EmitCall(readerDepthGet); + il.Emit(OpCodes.Ldc_I4_1); + il.Emit(OpCodes.Sub_Ovf); + il.EmitCall(readerDepthSet); + } + + private static void BuildDeserializeInternalOnAfterDeserialize(Type type, ObjectSerializationInfo info, ILGenerator il, LocalBuilder localResult) + { + if (type.GetTypeInfo().ImplementedInterfaces.All(x => x != typeof(IMessagePackSerializationCallbackReceiver))) + { + return; + } + + if (info.IsClass) + { + il.EmitLdloc(localResult); + } + + // call directly + var runtimeMethod = type.GetRuntimeMethods().SingleOrDefault(x => x.Name == "OnAfterDeserialize"); + if (runtimeMethod != null) + { + if (info.IsStruct) + { + il.EmitLdloca(localResult); + } + + il.Emit(OpCodes.Call, runtimeMethod); // don't use EmitCall helper(must use 'Call') + } + else + { + if (info.IsStruct) + { + il.EmitLdloc(localResult); + il.Emit(OpCodes.Box, type); + } + + il.EmitCall(onAfterDeserialize); + } + } + + private static LocalBuilder BuildDeserializeInternalResolver(ObjectSerializationInfo info, ILGenerator il, ref ArgumentField argOptions) + { + if (!info.ShouldUseFormatterResolver) + { + return default; + } + + // IFormatterResolver resolver = options.Resolver; + var localResolver = il.DeclareLocal(typeof(IFormatterResolver)); + argOptions.EmitLoad(); + il.EmitCall(getResolverFromOptions); + il.EmitStloc(localResolver); + return localResolver; + } + + private static LocalBuilder BuildDeserializeInternalReadHeaderLength(ObjectSerializationInfo info, ILGenerator il, ref ArgumentField argReader) + { + // var length = ReadMapHeader(ref byteSequence); + var length = il.DeclareLocal(typeof(int)); // [loc:1] + argReader.EmitLdarg(); + + il.EmitCall(info.IsIntKey ? MessagePackReaderTypeInfo.ReadArrayHeader : MessagePackReaderTypeInfo.ReadMapHeader); + + il.EmitStloc(length); + return length; + } + + private static void BuildDeserializeInternalDepthStep(ILGenerator il, ref ArgumentField argReader, ref ArgumentField argOptions) + { + argOptions.EmitLoad(); + il.EmitCall(getSecurityFromOptions); + argReader.EmitLdarg(); + il.EmitCall(securityDepthStep); + } + + // where T : new(); + private static void BuildDeserializeInternalCreateInstance(Type type, ObjectSerializationInfo info, ILGenerator il, LocalBuilder localResult) + { + // var result = new T(); + if (info.IsClass) + { + il.Emit(OpCodes.Newobj, info.BestmatchConstructor); + il.EmitStloc(localResult); + } + else + { + il.Emit(OpCodes.Ldloca, localResult); + il.Emit(OpCodes.Initobj, type); + } + } + + private static void BuildDeserializeInternalDeserializeValueAssignDirectly(ILGenerator il, DeserializeInfo info, int index, Func tryEmitLoadCustomFormatter, ref ArgumentField argReader, ref ArgumentField argOptions, LocalBuilder localResolver, LocalBuilder localResult) + { + var storeLabel = il.DefineLabel(); + var member = info.MemberInfo; + var t = member.Type; + var emitter = tryEmitLoadCustomFormatter(index, member); + + if (member.IsActuallyWritable) + { + if (localResult.LocalType.IsClass) + { + il.EmitLdloc(localResult); + } + else + { + il.EmitLdloca(localResult); + } + } + else if (info.IsInitializedLocalVariable != null) + { + il.EmitLdc_I4(1); + il.EmitStloc(info.IsInitializedLocalVariable); + } + + if (emitter != null) + { + emitter(); + argReader.EmitLdarg(); + argOptions.EmitLoad(); + il.EmitCall(getDeserialize(t)); + } + else if (ObjectSerializationInfo.IsOptimizeTargetType(t)) + { + if (!t.GetTypeInfo().IsValueType) + { + // As a nullable type (e.g. byte[] and string) we need to first call TryReadNil + // if (reader.TryReadNil()) + var readNonNilValueLabel = il.DefineLabel(); + argReader.EmitLdarg(); + il.EmitCall(MessagePackReaderTypeInfo.TryReadNil); + il.Emit(OpCodes.Brfalse_S, readNonNilValueLabel); + il.Emit(OpCodes.Ldnull); + il.Emit(OpCodes.Br, storeLabel); + + il.MarkLabel(readNonNilValueLabel); + } + + argReader.EmitLdarg(); + if (t == typeof(byte[])) + { + var local = il.DeclareLocal(typeof(ReadOnlySequence?)); + il.EmitCall(MessagePackReaderTypeInfo.ReadBytes); + il.EmitStloc(local); + il.EmitLdloca(local); + il.EmitCall(ArrayFromNullableReadOnlySequence); + } + else + { + il.EmitCall(MessagePackReaderTypeInfo.TypeInfo.GetDeclaredMethods("Read" + t.Name).First(x => x.GetParameters().Length == 0)); + } + } + else + { + il.EmitLdloc(localResolver); + il.EmitCall(getFormatterWithVerify.MakeGenericMethod(t)); + argReader.EmitLdarg(); + argOptions.EmitLoad(); + il.EmitCall(getDeserialize(t)); + } + + il.MarkLabel(storeLabel); + if (member.IsActuallyWritable) + { + member.EmitStoreValue(il); + } + else + { + il.Emit(OpCodes.Pop); + } + } + + private static void BuildDeserializeInternalDeserializeValueAssignLocalVariable(ILGenerator il, DeserializeInfo info, int index, Func tryEmitLoadCustomFormatter, ref ArgumentField argReader, ref ArgumentField argOptions, LocalBuilder localResolver, LocalBuilder localResult) + { + var storeLabel = il.DefineLabel(); + var member = info.MemberInfo; + var t = member.Type; + var emitter = tryEmitLoadCustomFormatter(index, member); + + if (info.IsInitializedLocalVariable != null) + { + il.EmitLdc_I4(1); + il.EmitStloc(info.IsInitializedLocalVariable); + } + + if (emitter != null) + { + emitter(); + argReader.EmitLdarg(); + argOptions.EmitLoad(); + il.EmitCall(getDeserialize(t)); + } + else if (ObjectSerializationInfo.IsOptimizeTargetType(t)) + { + if (!t.GetTypeInfo().IsValueType) + { + // As a nullable type (e.g. byte[] and string) we need to first call TryReadNil + // if (reader.TryReadNil()) + var readNonNilValueLabel = il.DefineLabel(); + argReader.EmitLdarg(); + il.EmitCall(MessagePackReaderTypeInfo.TryReadNil); + il.Emit(OpCodes.Brfalse_S, readNonNilValueLabel); + il.Emit(OpCodes.Ldnull); + il.Emit(OpCodes.Br, storeLabel); + + il.MarkLabel(readNonNilValueLabel); + } + + argReader.EmitLdarg(); + if (t == typeof(byte[])) + { + var local = il.DeclareLocal(typeof(ReadOnlySequence?)); + il.EmitCall(MessagePackReaderTypeInfo.ReadBytes); + il.EmitStloc(local); + il.EmitLdloca(local); + il.EmitCall(ArrayFromNullableReadOnlySequence); + } + else + { + il.EmitCall(MessagePackReaderTypeInfo.TypeInfo.GetDeclaredMethods("Read" + t.Name).First(x => x.GetParameters().Length == 0)); + } + } + else + { + il.EmitLdloc(localResolver); + il.EmitCall(getFormatterWithVerify.MakeGenericMethod(t)); + argReader.EmitLdarg(); + argOptions.EmitLoad(); + il.EmitCall(getDeserialize(t)); + } + + il.MarkLabel(storeLabel); + il.EmitStloc(info.LocalVariable); + } + +#pragma warning disable SA1311 // Static readonly fields should begin with upper-case letter + + // EmitInfos... + private static readonly Type refMessagePackReader = typeof(MessagePackReader).MakeByRefType(); + + private static readonly MethodInfo ReadOnlySpanFromByteArray = typeof(ReadOnlySpan).GetRuntimeMethod("op_Implicit", new[] { typeof(byte[]) }); + private static readonly MethodInfo ReadStringSpan = typeof(CodeGenHelpers).GetRuntimeMethod(nameof(CodeGenHelpers.ReadStringSpan), new[] { typeof(MessagePackReader).MakeByRefType() }); private static readonly MethodInfo ArrayFromNullableReadOnlySequence = typeof(CodeGenHelpers).GetRuntimeMethod(nameof(CodeGenHelpers.GetArrayFromNullableSequence), new[] { typeof(ReadOnlySequence?).MakeByRefType() }); private static readonly MethodInfo getFormatterWithVerify = typeof(FormatterResolverExtensions).GetRuntimeMethods().First(x => x.Name == nameof(FormatterResolverExtensions.GetFormatterWithVerify)); @@ -1336,7 +1640,9 @@ private class DeserializeInfo { public ObjectSerializationInfo.EmittableMember MemberInfo { get; set; } - public LocalBuilder LocalField { get; set; } + public LocalBuilder LocalVariable { get; set; } + + public LocalBuilder IsInitializedLocalVariable { get; set; } public Label SwitchLabel { get; set; } } @@ -1402,6 +1708,8 @@ public bool IsStruct get { return !this.IsClass; } } + public bool ShouldUseFormatterResolver { get; private set; } + public ConstructorInfo BestmatchConstructor { get; set; } public EmittableMemberAndConstructorParameter[] ConstructorParameters { get; set; } @@ -1412,10 +1720,11 @@ private ObjectSerializationInfo() { } - public static ObjectSerializationInfo CreateOrNull(Type type, bool forceStringKey, bool contractless, bool allowPrivate) + public static ObjectSerializationInfo CreateOrNull(Type type, bool forceStringKey, bool contractless, bool allowPrivate, bool dynamicMethod) { TypeInfo ti = type.GetTypeInfo(); var isClass = ti.IsClass || ti.IsInterface || ti.IsAbstract; + var isClassRecord = isClass && IsClassRecord(ti); var isStruct = ti.IsValueType; MessagePackObjectAttribute contractAttr = ti.GetCustomAttributes().FirstOrDefault(); @@ -1429,336 +1738,189 @@ public static ObjectSerializationInfo CreateOrNull(Type type, bool forceStringKe var intMembers = new Dictionary(); var stringMembers = new Dictionary(); - if (forceStringKey || contractless || (contractAttr != null && contractAttr.KeyAsPropertyName)) + // When returning false, it means should ignoring this member. + bool AddEmittableMemberOrIgnore(bool isIntKeyMode, EmittableMember member, bool checkConflicting) { - // All public members are serialize target except [Ignore] member. - isIntKey = !(forceStringKey || (contractAttr != null && contractAttr.KeyAsPropertyName)); - - var hiddenIntKey = 0; - - // Group the properties and fields by name to qualify members of the same name - // (declared with the 'new' keyword) with the declaring type. - IEnumerable> membersByName = type.GetRuntimeProperties() - .Concat(type.GetRuntimeFields().Cast()) - .OrderBy(m => m.DeclaringType, OrderBaseTypesBeforeDerivedTypes.Instance) - .GroupBy(m => m.Name); - foreach (var memberGroup in membersByName) + if (checkConflicting) { - bool firstMemberByName = true; - foreach (MemberInfo item in memberGroup) + if (isIntKeyMode ? intMembers.TryGetValue(member.IntKey, out var conflictingMember) : stringMembers.TryGetValue(member.StringKey, out conflictingMember)) { - if (item.GetCustomAttribute(true) != null) - { - continue; - } - - if (item.GetCustomAttribute(true) != null) + // Quietly skip duplicate if this is an override property. + if (member.PropertyInfo != null && ((conflictingMember.PropertyInfo.SetMethod?.IsVirtual ?? false) || (conflictingMember.PropertyInfo.GetMethod?.IsVirtual ?? false))) { - continue; + return false; } - EmittableMember member; - if (item is PropertyInfo property) - { - if (property.IsIndexer()) - { - continue; - } + var memberInfo = (MemberInfo)member.PropertyInfo ?? member.FieldInfo; + throw new MessagePackDynamicObjectResolverException($"key is duplicated, all members key must be unique. type:{type.FullName} member:{memberInfo.Name}"); + } + } - MethodInfo getMethod = property.GetGetMethod(true); - MethodInfo setMethod = property.GetSetMethod(true); + if (isIntKeyMode) + { + intMembers.Add(member.IntKey, member); + } + else + { + stringMembers.Add(member.StringKey, member); + } - member = new EmittableMember - { - PropertyInfo = property, - IsReadable = (getMethod != null) && (allowPrivate || getMethod.IsPublic) && !getMethod.IsStatic, - IsWritable = (setMethod != null) && (allowPrivate || setMethod.IsPublic) && !setMethod.IsStatic, - StringKey = firstMemberByName ? item.Name : $"{item.DeclaringType.FullName}.{item.Name}", - }; - } - else if (item is FieldInfo field) - { - if (item.GetCustomAttribute(true) != null) - { - continue; - } + return true; + } - if (field.IsStatic) - { - continue; - } + EmittableMember CreateEmittableMember(MemberInfo m) + { + if (m.IsDefined(typeof(IgnoreMemberAttribute), true) || m.IsDefined(typeof(IgnoreDataMemberAttribute), true)) + { + return null; + } - member = new EmittableMember - { - FieldInfo = field, - IsReadable = allowPrivate || field.IsPublic, - IsWritable = allowPrivate || (field.IsPublic && !field.IsInitOnly), - StringKey = firstMemberByName ? item.Name : $"{item.DeclaringType.FullName}.{item.Name}", - }; - } - else + EmittableMember result; + switch (m) + { + case PropertyInfo property: + if (property.IsIndexer()) { - throw new MessagePackSerializationException("unexpected member type"); + return null; } - if (!member.IsReadable && !member.IsWritable) + if (isClassRecord && property.Name == "EqualityContract") { - continue; + return null; } - member.IntKey = hiddenIntKey++; - if (isIntKey) + var getMethod = property.GetGetMethod(true); + var setMethod = property.GetSetMethod(true); + result = new EmittableMember(dynamicMethod) { - intMembers.Add(member.IntKey, member); + PropertyInfo = property, + IsReadable = (getMethod != null) && (allowPrivate || getMethod.IsPublic) && !getMethod.IsStatic, + IsWritable = (setMethod != null) && (allowPrivate || setMethod.IsPublic) && !setMethod.IsStatic, + }; + break; + case FieldInfo field: + if (field.GetCustomAttribute(true) != null) + { + return null; } - else + + if (field.IsStatic) { - stringMembers.Add(member.StringKey, member); + return null; } - firstMemberByName = false; - } + result = new EmittableMember(dynamicMethod) + { + FieldInfo = field, + IsReadable = allowPrivate || field.IsPublic, + IsWritable = allowPrivate || (field.IsPublic && !field.IsInitOnly), + }; + break; + default: + throw new MessagePackSerializationException("unexpected member type"); } + + return result.IsReadable || result.IsWritable ? result : null; } - else + + // Determine whether to ignore MessagePackObjectAttribute or DataContract. + if (forceStringKey || contractless || (contractAttr?.KeyAsPropertyName == true)) { - // Public members with KeyAttribute except [Ignore] member. - var searchFirst = true; + // All public members are serialize target except [Ignore] member. + isIntKey = !(forceStringKey || (contractAttr != null && contractAttr.KeyAsPropertyName)); var hiddenIntKey = 0; - foreach (PropertyInfo item in GetAllProperties(type)) + // Group the properties and fields by name to qualify members of the same name + // (declared with the 'new' keyword) with the declaring type. + var membersByName = type.GetRuntimeProperties().Concat(type.GetRuntimeFields().Cast()) + .OrderBy(m => m.DeclaringType, OrderBaseTypesBeforeDerivedTypes.Instance) + .GroupBy(m => m.Name); + foreach (var memberGroup in membersByName) { - if (item.GetCustomAttribute(true) != null) - { - continue; - } - - if (item.GetCustomAttribute(true) != null) - { - continue; - } - - if (item.IsIndexer()) - { - continue; - } - - MethodInfo getMethod = item.GetGetMethod(true); - MethodInfo setMethod = item.GetSetMethod(true); - - var member = new EmittableMember - { - PropertyInfo = item, - IsReadable = (getMethod != null) && (allowPrivate || getMethod.IsPublic) && !getMethod.IsStatic, - IsWritable = (setMethod != null) && (allowPrivate || setMethod.IsPublic) && !setMethod.IsStatic, - }; - if (!member.IsReadable && !member.IsWritable) - { - continue; - } - - KeyAttribute key; - if (contractAttr != null) - { - // MessagePackObjectAttribute - key = item.GetCustomAttribute(true); - if (key == null) - { - throw new MessagePackDynamicObjectResolverException("all public members must mark KeyAttribute or IgnoreMemberAttribute." + " type: " + type.FullName + " member:" + item.Name); - } - - member.IsExplicitContract = true; - if (key.IntKey == null && key.StringKey == null) - { - throw new MessagePackDynamicObjectResolverException("both IntKey and StringKey are null." + " type: " + type.FullName + " member:" + item.Name); - } - } - else + var first = true; + foreach (var member in memberGroup.Select(CreateEmittableMember).Where(n => n != null)) { - // DataContractAttribute - DataMemberAttribute pseudokey = item.GetCustomAttribute(true); - if (pseudokey == null) + var memberInfo = (MemberInfo)member.PropertyInfo ?? member.FieldInfo; + if (first) { - // This member has no DataMemberAttribute nor IgnoreMemberAttribute. - // But the type *did* have a DataContractAttribute on it, so no attribute implies the member should not be serialized. - continue; - } - - member.IsExplicitContract = true; - - // use Order first - if (pseudokey.Order != -1) - { - key = new KeyAttribute(pseudokey.Order); - } - else if (pseudokey.Name != null) - { - key = new KeyAttribute(pseudokey.Name); + first = false; + member.StringKey = memberInfo.Name; } else { - key = new KeyAttribute(item.Name); // use property name - } - } - - if (searchFirst) - { - searchFirst = false; - isIntKey = key.IntKey != null; - } - else - { - if ((isIntKey && key.IntKey == null) || (!isIntKey && key.StringKey == null)) - { - throw new MessagePackDynamicObjectResolverException("all members key type must be same." + " type: " + type.FullName + " member:" + item.Name); - } - } - - if (isIntKey) - { - member.IntKey = key.IntKey.Value; - if (intMembers.TryGetValue(member.IntKey, out EmittableMember conflictingMember)) - { - // Quietly skip duplicate if this is an override property. - if ((conflictingMember.PropertyInfo.SetMethod?.IsVirtual ?? false) || (conflictingMember.PropertyInfo.GetMethod?.IsVirtual ?? false)) - { - continue; - } - - throw new MessagePackDynamicObjectResolverException("key is duplicated, all members key must be unique." + " type: " + type.FullName + " member:" + item.Name); - } - - intMembers.Add(member.IntKey, member); - } - else - { - member.StringKey = key.StringKey; - if (stringMembers.TryGetValue(member.StringKey, out EmittableMember conflictingMember)) - { - // Quietly skip duplicate if this is an override property. - if ((conflictingMember.PropertyInfo.SetMethod?.IsVirtual ?? false) || (conflictingMember.PropertyInfo.GetMethod?.IsVirtual ?? false)) - { - continue; - } - - throw new MessagePackDynamicObjectResolverException("key is duplicated, all members key must be unique." + " type: " + type.FullName + " member:" + item.Name); + member.StringKey = $"{memberInfo.DeclaringType.FullName}.{memberInfo.Name}"; } member.IntKey = hiddenIntKey++; - stringMembers.Add(member.StringKey, member); + AddEmittableMemberOrIgnore(isIntKey, member, false); } } + } + else + { + // Public members with KeyAttribute except [Ignore] member. + var searchFirst = true; + var hiddenIntKey = 0; - foreach (FieldInfo item in GetAllFields(type)) + var memberInfos = GetAllProperties(type).Cast().Concat(GetAllFields(type)); + foreach (var member in memberInfos.Select(CreateEmittableMember).Where(n => n != null)) { - if (item.GetCustomAttribute(true) != null) - { - continue; - } - - if (item.GetCustomAttribute(true) != null) - { - continue; - } - - if (item.GetCustomAttribute(true) != null) - { - continue; - } - - if (item.IsStatic) - { - continue; - } - - var member = new EmittableMember - { - FieldInfo = item, - IsReadable = allowPrivate || item.IsPublic, - IsWritable = allowPrivate || (item.IsPublic && !item.IsInitOnly), - }; - if (!member.IsReadable && !member.IsWritable) - { - continue; - } + var memberInfo = (MemberInfo)member.PropertyInfo ?? member.FieldInfo; KeyAttribute key; if (contractAttr != null) { - // MessagePackObjectAttribute - key = item.GetCustomAttribute(true); - if (key == null) - { - throw new MessagePackDynamicObjectResolverException("all public members must mark KeyAttribute or IgnoreMemberAttribute." + " type: " + type.FullName + " member:" + item.Name); - } - - member.IsExplicitContract = true; + // MessagePackObjectAttribute. KeyAttribute must be marked, and IntKey or StringKey must be set. + key = memberInfo.GetCustomAttribute(true) ?? + throw new MessagePackDynamicObjectResolverException($"all public members must mark KeyAttribute or IgnoreMemberAttribute. type:{type.FullName} member:{memberInfo.Name}"); if (key.IntKey == null && key.StringKey == null) { - throw new MessagePackDynamicObjectResolverException("both IntKey and StringKey are null." + " type: " + type.FullName + " member:" + item.Name); + throw new MessagePackDynamicObjectResolverException($"both IntKey and StringKey are null. type: {type.FullName} member:{memberInfo.Name}"); } } else { - // DataContractAttribute - DataMemberAttribute pseudokey = item.GetCustomAttribute(true); + // DataContractAttribute. Try to use the DataMemberAttribute to fake KeyAttribute. + // This member has no DataMemberAttribute nor IgnoreMemberAttribute. + // But the type *did* have a DataContractAttribute on it, so no attribute implies the member should not be serialized. + var pseudokey = memberInfo.GetCustomAttribute(true); if (pseudokey == null) { - // This member has no DataMemberAttribute nor IgnoreMemberAttribute. - // But the type *did* have a DataContractAttribute on it, so no attribute implies the member should not be serialized. continue; } - member.IsExplicitContract = true; - - // use Order first - if (pseudokey.Order != -1) - { - key = new KeyAttribute(pseudokey.Order); - } - else if (pseudokey.Name != null) - { - key = new KeyAttribute(pseudokey.Name); - } - else - { - key = new KeyAttribute(item.Name); // use property name - } + key = + pseudokey.Order != -1 ? new KeyAttribute(pseudokey.Order) : + pseudokey.Name != null ? new KeyAttribute(pseudokey.Name) : + new KeyAttribute(memberInfo.Name); } + member.IsExplicitContract = true; + + // Cannot assign StringKey and IntKey at the same time. if (searchFirst) { searchFirst = false; isIntKey = key.IntKey != null; } - else + else if ((isIntKey && key.IntKey == null) || (!isIntKey && key.StringKey == null)) { - if ((isIntKey && key.IntKey == null) || (!isIntKey && key.StringKey == null)) - { - throw new MessagePackDynamicObjectResolverException("all members key type must be same." + " type: " + type.FullName + " member:" + item.Name); - } + throw new MessagePackDynamicObjectResolverException($"all members key type must be same. type: {type.FullName} member:{memberInfo.Name}"); } if (isIntKey) { member.IntKey = key.IntKey.Value; - if (intMembers.ContainsKey(member.IntKey)) - { - throw new MessagePackDynamicObjectResolverException("key is duplicated, all members key must be unique." + " type: " + type.FullName + " member:" + item.Name); - } - - intMembers.Add(member.IntKey, member); } else { member.StringKey = key.StringKey; - if (stringMembers.ContainsKey(member.StringKey)) - { - throw new MessagePackDynamicObjectResolverException("key is duplicated, all members key must be unique." + " type: " + type.FullName + " member:" + item.Name); - } - member.IntKey = hiddenIntKey++; - stringMembers.Add(member.StringKey, member); + } + + if (!AddEmittableMemberOrIgnore(isIntKey, member, true)) + { + continue; } } } @@ -1787,6 +1949,7 @@ public static ObjectSerializationInfo CreateOrNull(Type type, bool forceStringKe var constructorParameters = new List(); if (ctor != null) { + IReadOnlyDictionary ctorParamIndexIntMembersDictionary = intMembers.OrderBy(x => x.Key).Select((x, i) => (Key: x.Value, Index: i)).ToDictionary(x => x.Index, x => x.Key); ILookup> constructorLookupByKeyDictionary = stringMembers.ToLookup(x => x.Key, x => x, StringComparer.OrdinalIgnoreCase); ILookup> constructorLookupByMemberNameDictionary = stringMembers.ToLookup(x => x.Value.Name, x => x, StringComparer.OrdinalIgnoreCase); do @@ -1798,7 +1961,7 @@ public static ObjectSerializationInfo CreateOrNull(Type type, bool forceStringKe EmittableMember paramMember; if (isIntKey) { - if (intMembers.TryGetValue(ctorParamIndex, out paramMember)) + if (ctorParamIndexIntMembersDictionary.TryGetValue(ctorParamIndex, out paramMember)) { if ((item.ParameterType == paramMember.Type || item.ParameterType.GetTypeInfo().IsAssignableFrom(paramMember.Type)) @@ -1811,7 +1974,7 @@ public static ObjectSerializationInfo CreateOrNull(Type type, bool forceStringKe if (ctorEnumerator != null) { ctor = null; - continue; + break; } else { @@ -1824,7 +1987,7 @@ public static ObjectSerializationInfo CreateOrNull(Type type, bool forceStringKe if (ctorEnumerator != null) { ctor = null; - continue; + break; } else { @@ -1857,7 +2020,7 @@ public static ObjectSerializationInfo CreateOrNull(Type type, bool forceStringKe if (ctorEnumerator != null) { ctor = null; - continue; + break; } else { @@ -1875,7 +2038,7 @@ public static ObjectSerializationInfo CreateOrNull(Type type, bool forceStringKe if (ctorEnumerator != null) { ctor = null; - continue; + break; } else { @@ -1888,7 +2051,7 @@ public static ObjectSerializationInfo CreateOrNull(Type type, bool forceStringKe if (ctorEnumerator != null) { ctor = null; - continue; + break; } else { @@ -1929,17 +2092,78 @@ public static ObjectSerializationInfo CreateOrNull(Type type, bool forceStringKe .ToArray(); } + var shouldUseFormatterResolver = false; + + // Mark each member that will be set by way of the constructor. + foreach (var item in constructorParameters) + { + item.MemberInfo.IsWrittenByConstructor = true; + } + + var membersArray = members.Where(m => m.IsExplicitContract || m.IsWrittenByConstructor || m.IsWritable).ToArray(); + foreach (var member in membersArray) + { + if (IsOptimizeTargetType(member.Type)) + { + continue; + } + + var attr = member.GetMessagePackFormatterAttribute(); + if (!(attr is null)) + { + continue; + } + + shouldUseFormatterResolver = true; + break; + } + + // Under a certain combination of conditions, throw to draw attention to the fact that we cannot set a property. + if (!allowPrivate) + { + // A property is not actually problematic if we can set it via the type's constructor. + var problematicProperties = membersArray + .Where(m => m.IsProblematicInitProperty && !constructorParameters.Any(cp => cp.MemberInfo == m)); + problematicProperties.FirstOrDefault()?.ThrowIfNotWritable(); + } + return new ObjectSerializationInfo { Type = type, IsClass = isClass, + ShouldUseFormatterResolver = shouldUseFormatterResolver, BestmatchConstructor = ctor, ConstructorParameters = constructorParameters.ToArray(), IsIntKey = isIntKey, - Members = members.Where(m => m.IsExplicitContract || constructorParameters.Any(p => p.MemberInfo.Equals(m)) || m.IsWritable).ToArray(), + Members = membersArray, }; } + /// + /// Keep this list in sync with ShouldUseFormatterResolverHelper.PrimitiveTypes. + /// + internal static bool IsOptimizeTargetType(Type type) + { + return type == typeof(Int16) + || type == typeof(Int32) + || type == typeof(Int64) + || type == typeof(UInt16) + || type == typeof(UInt32) + || type == typeof(UInt64) + || type == typeof(Single) + || type == typeof(Double) + || type == typeof(bool) + || type == typeof(byte) + || type == typeof(sbyte) + || type == typeof(char) + || type == typeof(byte[]) + + // Do not include types that resolvers are allowed to modify. + ////|| type == typeof(DateTime) // OldSpec has no support, so for that and perf reasons a .NET native DateTime resolver exists. + ////|| type == typeof(string) // https://github.com/Cysharp/MasterMemory provides custom formatter for string interning. + ; + } + private static IEnumerable GetAllFields(Type type) { if (type.BaseType is object) @@ -1974,6 +2198,14 @@ private static IEnumerable GetAllProperties(Type type) } } + private static bool IsClassRecord(TypeInfo type) + { + // The only truly unique thing about a C# 9 record class is the presence of a $ method, + // which cannot be declared in C# because of the reserved characters in its name. + return type.IsClass + && type.GetMethod("$", BindingFlags.Public | BindingFlags.Instance) is object; + } + private static bool TryGetNextConstructor(IEnumerator ctorEnumerator, ref ConstructorInfo ctor) { if (ctorEnumerator == null || ctor != null) @@ -2002,6 +2234,13 @@ public class EmittableMemberAndConstructorParameter public class EmittableMember { + private readonly bool dynamicMethod; + + internal EmittableMember(bool dynamicMethod) + { + this.dynamicMethod = dynamicMethod; + } + public bool IsProperty { get { return this.PropertyInfo != null; } @@ -2014,6 +2253,13 @@ public bool IsField public bool IsWritable { get; set; } + public bool IsWrittenByConstructor { get; set; } + + /// + /// Gets a value indicating whether the property can only be set by an object initializer, a constructor, or another `init` member. + /// + public bool IsInitOnly => this.PropertyInfo?.GetSetMethod(true)?.ReturnParameter.GetRequiredCustomModifiers().Any(modifierType => modifierType.FullName == "System.Runtime.CompilerServices.IsExternalInit") ?? false; + public bool IsReadable { get; set; } public int IntKey { get; set; } @@ -2051,6 +2297,22 @@ public bool IsValueType /// public bool IsExplicitContract { get; set; } + /// + /// Gets a value indicating whether a dynamic resolver can write to this property, + /// going beyond by also considering CLR bugs. + /// + internal bool IsActuallyWritable => this.IsWritable && (this.dynamicMethod || !this.IsProblematicInitProperty); + + /// + /// Gets a value indicating whether this member is a property with an property setter + /// and is declared on a generic class. + /// + /// + /// A bug in + /// blocks its ability to invoke property init accessors when in a generic class. + /// + internal bool IsProblematicInitProperty => this.PropertyInfo is PropertyInfo property && property.DeclaringType.IsGenericType && this.IsInitOnly; + public MessagePackFormatterAttribute GetMessagePackFormatterAttribute() { if (this.IsProperty) @@ -2099,6 +2361,17 @@ public void EmitStoreValue(ILGenerator il) } } + internal void ThrowIfNotWritable() + { + if (this.IsProblematicInitProperty && !this.dynamicMethod) + { + throw new InitAccessorInGenericClassNotSupportedException( + $"`init` property accessor {this.PropertyInfo.SetMethod.DeclaringType.FullName}.{this.PropertyInfo.Name} found in generic type, " + + $"which is not supported with the DynamicObjectResolver. Use the AllowPrivate variety of the resolver instead. " + + $"See https://github.com/neuecc/MessagePack-CSharp/issues/1134 for details."); + } + } + ////public object ReflectionLoadValue(object value) ////{ //// if (IsProperty) @@ -2150,6 +2423,35 @@ public MessagePackDynamicObjectResolverException(string message) { } } + + /// + /// Identifies the unsupported scenario of an + /// property accessor within a generic class. + /// + [Serializable] + internal class InitAccessorInGenericClassNotSupportedException : NotSupportedException + { + public InitAccessorInGenericClassNotSupportedException() + { + } + + public InitAccessorInGenericClassNotSupportedException(string message) + : base(message) + { + } + + public InitAccessorInGenericClassNotSupportedException(string message, Exception inner) + : base(message, inner) + { + } + + protected InitAccessorInGenericClassNotSupportedException( + SerializationInfo info, + StreamingContext context) + : base(info, context) + { + } + } } #endif diff --git a/src/MessagePack.UnityClient/Assets/Scripts/MessagePack/Resolvers/ResolverUtilities.cs b/src/MessagePack.UnityClient/Assets/Scripts/MessagePack/Resolvers/ResolverUtilities.cs new file mode 100644 index 000000000..a66221814 --- /dev/null +++ b/src/MessagePack.UnityClient/Assets/Scripts/MessagePack/Resolvers/ResolverUtilities.cs @@ -0,0 +1,45 @@ +// Copyright (c) All contributors. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +using System; +using System.Reflection; +using MessagePack.Formatters; + +namespace MessagePack.Internal +{ + internal static class ResolverUtilities + { + internal static IMessagePackFormatter ActivateFormatter(Type formatterType, object[] args = null) + { + if (args == null || args.Length == 0) + { + if (formatterType.GetConstructor(Type.EmptyTypes) is ConstructorInfo ctor) + { + return (IMessagePackFormatter)ctor.Invoke(Array.Empty()); + } + else if (FetchSingletonField(formatterType) is FieldInfo instance) + { + return (IMessagePackFormatter)instance.GetValue(null); + } + else + { + throw new MessagePackSerializationException($"The {formatterType.FullName} formatter has no default constructor nor implements the singleton pattern."); + } + } + else + { + return (IMessagePackFormatter)Activator.CreateInstance(formatterType, args); + } + } + + internal static FieldInfo FetchSingletonField(Type formatterType) + { + if (formatterType.GetField("Instance", BindingFlags.Static | BindingFlags.Public) is FieldInfo fieldInfo && fieldInfo.IsInitOnly) + { + return fieldInfo; + } + + return null; + } + } +} diff --git a/src/MessagePack.UnityClient/Assets/Scripts/MessagePack/Resolvers/ResolverUtilities.cs.meta b/src/MessagePack.UnityClient/Assets/Scripts/MessagePack/Resolvers/ResolverUtilities.cs.meta new file mode 100644 index 000000000..1f34c5fff --- /dev/null +++ b/src/MessagePack.UnityClient/Assets/Scripts/MessagePack/Resolvers/ResolverUtilities.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: d4e2e1ebcc7467944a57bb9a3327820b +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/src/MessagePack.UnityClient/Assets/Scripts/MessagePack/SafeBitConverter.cs b/src/MessagePack.UnityClient/Assets/Scripts/MessagePack/SafeBitConverter.cs index 7eb77a006..8bbc141a9 100644 --- a/src/MessagePack.UnityClient/Assets/Scripts/MessagePack/SafeBitConverter.cs +++ b/src/MessagePack.UnityClient/Assets/Scripts/MessagePack/SafeBitConverter.cs @@ -13,15 +13,15 @@ internal static long ToInt64(ReadOnlySpan value) #if UNITY_ANDROID if (BitConverter.IsLittleEndian) { - int i1 = value[0] | (value[1] << 8) | (value[2] << 16) | (value[3] << 24); - int i2 = value[4] | (value[5] << 8) | (value[6] << 16) | (value[7] << 24); - return (uint)i1 | ((long)i2 << 32); + long i1 = value[0] | (value[1] << 8) | (value[2] << 16) | (value[3] << 24); + long i2 = value[4] | (value[5] << 8) | (value[6] << 16) | (value[7] << 24); + return i1 | (i2 << 32); } else { - int i1 = (value[0] << 24) | (value[1] << 16) | (value[2] << 8) | value[3]; - int i2 = (value[4] << 24) | (value[5] << 16) | (value[6] << 8) | value[7]; - return (uint)i2 | ((long)i1 << 32); + long i1 = (value[0] << 24) | (value[1] << 16) | (value[2] << 8) | value[3]; + long i2 = (value[4] << 24) | (value[5] << 16) | (value[6] << 8) | value[7]; + return i2 | (i1 << 32); } #else return MemoryMarshal.Cast(value)[0]; diff --git a/src/MessagePack.UnityClient/Assets/Scripts/MessagePack/SequencePool.cs b/src/MessagePack.UnityClient/Assets/Scripts/MessagePack/SequencePool.cs index bdfc073d3..4857095d0 100644 --- a/src/MessagePack.UnityClient/Assets/Scripts/MessagePack/SequencePool.cs +++ b/src/MessagePack.UnityClient/Assets/Scripts/MessagePack/SequencePool.cs @@ -11,16 +11,17 @@ namespace MessagePack /// /// A thread-safe, alloc-free reusable object pool. /// - internal class SequencePool +#if MESSAGEPACK_INTERNAL + internal +#else + public +#endif + class SequencePool { /// /// A thread-safe pool of reusable objects. /// - /// - /// We use a that allows every processor to be involved in messagepack serialization concurrently, - /// plus one nested serialization per processor (since LZ4 and sometimes other nested serializations may exist). - /// - internal static readonly SequencePool Shared = new SequencePool(Environment.ProcessorCount * 2); + internal static readonly SequencePool Shared = new SequencePool(); /// /// The value to use for . @@ -41,18 +42,41 @@ internal class SequencePool /// /// The array pool which we share with all objects created by this instance. /// + private readonly ArrayPool arrayPool; + + /// + /// Initializes a new instance of the class. + /// + /// + /// We use a that allows every processor to be involved in messagepack serialization concurrently, + /// plus one nested serialization per processor (since LZ4 and sometimes other nested serializations may exist). + /// + public SequencePool() + : this(Environment.ProcessorCount * 2, ArrayPool.Create(80 * 1024, 100)) + { + } + + /// + /// Initializes a new instance of the class. + /// + /// The maximum size to allow the pool to grow. /// /// We allow 100 arrays to be shared (instead of the default 50) and reduce the max array length from the default 1MB to something more reasonable for our expected use. /// - private readonly ArrayPool arrayPool = ArrayPool.Create(80 * 1024, 100); + public SequencePool(int maxSize) + : this(maxSize, ArrayPool.Create(80 * 1024, 100)) + { + } /// /// Initializes a new instance of the class. /// /// The maximum size to allow the pool to grow. - internal SequencePool(int maxSize) + /// Array pool that will be used. + public SequencePool(int maxSize, ArrayPool arrayPool) { this.maxSize = maxSize; + this.arrayPool = arrayPool; } /// diff --git a/src/MessagePack.UnityClient/Assets/Scripts/MessagePack/Utilities.cs b/src/MessagePack.UnityClient/Assets/Scripts/MessagePack/Utilities.cs index 8d5a4cfe8..d011ee4d3 100644 --- a/src/MessagePack.UnityClient/Assets/Scripts/MessagePack/Utilities.cs +++ b/src/MessagePack.UnityClient/Assets/Scripts/MessagePack/Utilities.cs @@ -22,9 +22,9 @@ internal static class Utilities internal delegate void GetWriterBytesAction(ref MessagePackWriter writer, TArg argument); - internal static byte[] GetWriterBytes(TArg arg, GetWriterBytesAction action) + internal static byte[] GetWriterBytes(TArg arg, GetWriterBytesAction action, SequencePool pool) { - using (var sequenceRental = SequencePool.Shared.Rent()) + using (var sequenceRental = pool.Rent()) { var writer = new MessagePackWriter(sequenceRental.Value); action(ref writer, arg); diff --git a/src/MessagePack.UnityClient/Assets/Scripts/MessagePack/package.json b/src/MessagePack.UnityClient/Assets/Scripts/MessagePack/package.json index 369e37739..ea203c5ce 100644 --- a/src/MessagePack.UnityClient/Assets/Scripts/MessagePack/package.json +++ b/src/MessagePack.UnityClient/Assets/Scripts/MessagePack/package.json @@ -1,11 +1,12 @@ { "name": "com.neuecc.messagepack", "displayName": "MessagePack", - "version": "2.2.60", + "version": "2.4.35", "unity": "2018.4", "description": "Extremely Fast MessagePack Serializer for C#.", - "keywords": [ "Serializer" ], + "keywords": [ + "Serializer" + ], "license": "MIT", - "category": "Scripting", - "dependencies": {} + "category": "Scripting" } diff --git a/src/MessagePack.UnityClient/Assets/Scripts/Tests/Class1.cs b/src/MessagePack.UnityClient/Assets/Scripts/Tests/Class1.cs index d25b14f6f..3325e3c33 100644 --- a/src/MessagePack.UnityClient/Assets/Scripts/Tests/Class1.cs +++ b/src/MessagePack.UnityClient/Assets/Scripts/Tests/Class1.cs @@ -115,6 +115,108 @@ public void Serialize(ref MessagePackWriter writer, int value, MessagePackSerial } } + [MessagePackObject(true)] + public class DefaultValueStringKeyClassWithoutExplicitConstructor + { + public const int Prop1Constant = 11; + public const int Prop2Constant = 45; + + public int Prop1 { get; set; } = Prop1Constant; + + public int Prop2 { get; set; } = Prop2Constant; + } + + [MessagePackObject(true)] + public class DefaultValueStringKeyClassWithExplicitConstructor + { + public const int Prop2Constant = 1419; + + public int Prop1 { get; set; } + + public int Prop2 { get; set; } + + public DefaultValueStringKeyClassWithExplicitConstructor(int prop1) + { + Prop1 = prop1; + Prop2 = Prop2Constant; + } + } + + [MessagePackObject(true)] + public struct DefaultValueStringKeyStructWithExplicitConstructor + { + public const int Prop2Constant = 198; + + public int Prop1 { get; set; } + + public int Prop2 { get; set; } + + public DefaultValueStringKeyStructWithExplicitConstructor(int prop1) + { + Prop1 = prop1; + Prop2 = Prop2Constant; + } + } + + [MessagePackObject] + public class DefaultValueIntKeyClassWithoutExplicitConstructor + { + public const int Prop1Constant = 33; + public const int Prop2Constant = -4; + + [Key(0)] + public int Prop1 { get; set; } = Prop1Constant; + + [Key(1)] + public int Prop2 { get; set; } = Prop2Constant; + } + + [MessagePackObject] + public class DefaultValueIntKeyClassWithExplicitConstructor + { + public const int Prop2Constant = -109; + public const string Prop3Constant = "生命、宇宙、そして万物についての究極の疑問の答え"; + public const string Prop4Constant = "Hello, world! To you, From me."; + + [Key(0)] + public int Prop1 { get; set; } + + [Key(1)] + public int Prop2 { get; set; } + + [Key(2)] + public string Prop3 { get; set; } + + [Key(3)] + public string Prop4 { get; set; } + + public DefaultValueIntKeyClassWithExplicitConstructor(int prop1) + { + Prop1 = prop1; + Prop2 = Prop2Constant; + Prop3 = Prop3Constant; + Prop4 = Prop4Constant; + } + } + + [MessagePackObject] + public struct DefaultValueIntKeyStructWithExplicitConstructor + { + public const int Prop2Constant = 31; + + [Key(0)] + public int Prop1 { get; set; } + + [Key(1)] + public int Prop2 { get; set; } + + public DefaultValueIntKeyStructWithExplicitConstructor(int prop1) + { + Prop1 = prop1; + Prop2 = Prop2Constant; + } + } + [MessagePackObject(true)] public class SimpleStringKeyData { @@ -1047,6 +1149,13 @@ public long Amount } } +[MessagePackObject] +public class MessagePackFormatterFieldUser +{ + [Key(0), MessagePackFormatter(typeof(NativeDateTimeFormatter))] + public DateTime Timestamp { get; set; } +} + namespace PerfBenchmarkDotNet { [MessagePackObject(true)] diff --git a/src/MessagePack.UnityClient/Assets/Scripts/Tests/ShareTests/AllowPrivateTest.cs b/src/MessagePack.UnityClient/Assets/Scripts/Tests/ShareTests/AllowPrivateTest.cs index 7c418e7ea..f27b794e1 100644 --- a/src/MessagePack.UnityClient/Assets/Scripts/Tests/ShareTests/AllowPrivateTest.cs +++ b/src/MessagePack.UnityClient/Assets/Scripts/Tests/ShareTests/AllowPrivateTest.cs @@ -157,6 +157,28 @@ internal class InternalClass internal InternalEnum EnumProperty { get; set; } } + [MessagePackObject] + public class PrivateReadonlyField + { + public static PrivateReadonlyField WithNullValue { get; } = new PrivateReadonlyField(); + + [Key(0)] + private readonly string field; + + [SerializationConstructor] + public PrivateReadonlyField(string field) + { + this.field = field ?? "not null"; + } + + private PrivateReadonlyField() + { + } + + [IgnoreMember] + public string Field => field; + } + #if !ENABLE_IL2CPP [MessagePackObject] @@ -193,6 +215,25 @@ public ImmutablePrivateClass(int x, int y, bool dummy) public bool CreatedUsingPrivateCtor { get; } } + public class ContractlessClassPrivateCtor + { + public int X { get; private set; } + + public int Y { get; private set; } + + [SerializationConstructor] + private ContractlessClassPrivateCtor(int x, int y) + { + X = x; + Y = y; + } + + public static ContractlessClassPrivateCtor Create(int x, int y) + { + return new ContractlessClassPrivateCtor(x, y); + } + } + [MessagePackObject] public class CompletelyPrivateConstructor { @@ -310,6 +351,15 @@ public void InternalClassWithInternalEnum() Assert.Equal(expected.EnumProperty, actual.EnumProperty); } + [Fact] + public void PrivateReadonlyFieldSetInConstructor() + { + PrivateReadonlyField initial = PrivateReadonlyField.WithNullValue; + var bin = MessagePackSerializer.Serialize(initial, StandardResolverAllowPrivate.Options); + var deserialized = MessagePackSerializer.Deserialize(bin, StandardResolverAllowPrivate.Options); + Assert.Equal("not null", deserialized.Field); + } + #if !ENABLE_IL2CPP [Fact] @@ -335,6 +385,17 @@ public void PrivateConstructor2() Assert.Equal(p1.X, p2.X); Assert.Equal(p1.Y, p2.Y); } + + [Fact] + public void ContractlessAttributedPrivateConstructor() + { + var p1 = ContractlessClassPrivateCtor.Create(10, 20); + var bin = MessagePackSerializer.Serialize(p1, ContractlessStandardResolver.Options); + var p2 = MessagePackSerializer.Deserialize(bin, ContractlessStandardResolver.Options); + + Assert.Equal(p1.X, p2.X); + Assert.Equal(p1.Y, p2.Y); + } #endif } } diff --git a/src/MessagePack.UnityClient/Assets/Scripts/Tests/ShareTests/CollectionTest.cs b/src/MessagePack.UnityClient/Assets/Scripts/Tests/ShareTests/CollectionTest.cs index 121806e32..fce5184fc 100644 --- a/src/MessagePack.UnityClient/Assets/Scripts/Tests/ShareTests/CollectionTest.cs +++ b/src/MessagePack.UnityClient/Assets/Scripts/Tests/ShareTests/CollectionTest.cs @@ -251,6 +251,41 @@ public void CustomGenericInterfaceCollectionTest() } } + [Fact] + public void CustomGenericEnumerableCollectionTest() + { + { + var xs = new ImplGenericEnumerable(); + xs.Add(1); + xs.Add(2); + xs.Add(3); + + this.Convert(xs).Is(1, 2, 3); + } + } + + [Fact] + public void CustomGenericInterfaceReadOnlyCollectionTest() + { + { + var xs = new ImplGenericReadonlyCollection(); + xs.Add(1); + xs.Add(2); + xs.Add(3); + + this.Convert(xs).Is(1, 2, 3); + } + + { + var xs = new ImplGenericGenericReadOnlyCollection(); + xs.Add(1); + xs.Add(2); + xs.Add(3); + + this.Convert(xs).Is(1, 2, 3); + } + } + [Fact] public void CustomGenericDictionaryTest() { @@ -262,6 +297,18 @@ public void CustomGenericDictionaryTest() d2["foo"].Is(10); d2["bar"].Is(20); } + + [Fact] + public void CustomGenericReadOnlyDictionaryTest() + { + var d = new ImplReadonlyDictionary(); + d.Add("foo", 10); + d.Add("bar", 20); + + var d2 = this.Convert(d); + d2["foo"].Is(10); + d2["bar"].Is(20); + } } public class ImplNonGenericList : IList @@ -429,6 +476,38 @@ IEnumerator IEnumerable.GetEnumerator() } } + public class ImplGenericGenericReadOnlyCollection : IReadOnlyCollection + { + private readonly ICollection inner; + + public ImplGenericGenericReadOnlyCollection() + { + this.inner = new List(); + } + + public ImplGenericGenericReadOnlyCollection(IEnumerable items) + { + this.inner = new List(items); + } + + public IEnumerator GetEnumerator() + { + return inner.GetEnumerator(); + } + + IEnumerator IEnumerable.GetEnumerator() + { + return ((IEnumerable)inner).GetEnumerator(); + } + + public int Count => inner.Count; + + public void Add(T item) + { + inner.Add(item); + } + } + public class ImplDictionary : IDictionary { private readonly Dictionary inner; @@ -503,4 +582,119 @@ IEnumerator IEnumerable.GetEnumerator() return ((IDictionary)inner).GetEnumerator(); } } + + public class ImplGenericReadonlyCollection : IReadOnlyCollection + { + private readonly ICollection inner; + + public ImplGenericReadonlyCollection() + { + this.inner = new List(); + } + + public ImplGenericReadonlyCollection(IEnumerable items) + { + this.inner = new List(items); + } + + public int Count => inner.Count; + + public IEnumerator GetEnumerator() + { + return inner.GetEnumerator(); + } + + IEnumerator IEnumerable.GetEnumerator() + { + return inner.GetEnumerator(); + } + + public void Add(int item) + { + inner.Add(item); + } + } + + public class ImplReadonlyDictionary : IReadOnlyDictionary + { + private readonly Dictionary inner; + + public ImplReadonlyDictionary() + { + this.inner = new Dictionary(); + } + + public ImplReadonlyDictionary(IDictionary inner) + { + this.inner = new Dictionary(inner); + } + + public IEnumerator> GetEnumerator() + { + return inner.GetEnumerator(); + } + + IEnumerator IEnumerable.GetEnumerator() + { + return ((IEnumerable)inner).GetEnumerator(); + } + + public int Count => inner.Count; + + public bool ContainsKey(string key) + { + return inner.ContainsKey(key); + } + + public bool TryGetValue(string key, out int value) + { + return inner.TryGetValue(key, out value); + } + + public int this[string key] => inner[key]; + + public IEnumerable Keys => inner.Keys; + + public IEnumerable Values => inner.Values; + + public void Add(string key, int value) + { + inner.Add(key, value); + } + } + + public class ImplGenericEnumerable : IEnumerable + { + private readonly List inner = new List(); + + public ImplGenericEnumerable() + { + } + + public ImplGenericEnumerable(IEnumerable values) + { + } + + public ImplGenericEnumerable(IEnumerable values) + { + inner.AddRange(values); + } + + public ImplGenericEnumerable(ICollection values) + { + inner.AddRange(values); + } + + public IEnumerator GetEnumerator() + { + return inner.GetEnumerator(); + } + + IEnumerator IEnumerable.GetEnumerator() + { + return ((IEnumerable)inner).GetEnumerator(); + } + + public void Add(int item) => inner.Add(item); + } } diff --git a/src/MessagePack.UnityClient/Assets/Scripts/Tests/ShareTests/ContractlessStandardResolverTest.cs b/src/MessagePack.UnityClient/Assets/Scripts/Tests/ShareTests/ContractlessStandardResolverTest.cs index d05204268..0349bc0f7 100644 --- a/src/MessagePack.UnityClient/Assets/Scripts/Tests/ShareTests/ContractlessStandardResolverTest.cs +++ b/src/MessagePack.UnityClient/Assets/Scripts/Tests/ShareTests/ContractlessStandardResolverTest.cs @@ -42,6 +42,16 @@ public class Person public object[] /*Address*/ Addresses { get; set; } } + public class DefaultValueStringKeyClassWithoutExplicitConstructor + { + public const int Prop1Constant = 11; + public const int Prop2Constant = 45; + + public int Prop1 { get; set; } = Prop1Constant; + + public int Prop2 { get; set; } = Prop2Constant; + } + public class V1 { public int ABCDEFG1 { get; set; } @@ -184,6 +194,18 @@ public void SimpleTest() ((string)d2["Street"]).Is("Ave."); } + [Fact] + public void DefaultValueStringKeyClassWithoutExplicitConstructorTest() + { + var dictionary = new Dictionary(); + + var result = MessagePackSerializer.Serialize(dictionary, Resolvers.ContractlessStandardResolver.Options); + + var instance = MessagePackSerializer.Deserialize(result, Resolvers.ContractlessStandardResolver.Options); + instance.Prop1.Is(DefaultValueStringKeyClassWithoutExplicitConstructor.Prop1Constant); + instance.Prop2.Is(DefaultValueStringKeyClassWithoutExplicitConstructor.Prop2Constant); + } + [Fact] public void Versioning() { diff --git a/src/MessagePack.UnityClient/Assets/Scripts/Tests/ShareTests/DataContractTest.cs b/src/MessagePack.UnityClient/Assets/Scripts/Tests/ShareTests/DataContractTest.cs index 87175888d..d4defb9e3 100644 --- a/src/MessagePack.UnityClient/Assets/Scripts/Tests/ShareTests/DataContractTest.cs +++ b/src/MessagePack.UnityClient/Assets/Scripts/Tests/ShareTests/DataContractTest.cs @@ -3,18 +3,27 @@ using System; using System.Collections.Generic; +using System.IO; using System.Linq; using System.Runtime.Serialization; using System.Text; using System.Threading.Tasks; +using MessagePack.Resolvers; using Xunit; +using Xunit.Abstractions; namespace MessagePack.Tests { #if !ENABLE_IL2CPP - public class DataContractTest { + private readonly ITestOutputHelper logger; + + public DataContractTest(ITestOutputHelper logger) + { + this.logger = logger; + } + [DataContract] public class MyClass { @@ -65,6 +74,23 @@ public class ClassWithPublicMembersWithoutAttributes public int IgnoredField; } + [DataContract] + public class ClassWithPrivateReadonlyDictionary + { + [DataMember(Name = "Key", Order = 0, EmitDefaultValue = false)] + private readonly Guid? key; + + [DataMember(Name = "Body", Order = 1, EmitDefaultValue = false)] + private readonly Dictionary body = new Dictionary(); + + public ClassWithPrivateReadonlyDictionary(Guid? key) + { + this.key = key; + } + + internal Dictionary GetBody() => this.body; + } + [Fact] public void SerializeOrder() { @@ -134,6 +160,103 @@ public void Serialize_WithVariousAttributes() MessagePackSerializer.ConvertToJson(bin).Is(@"{""AttributedProperty"":1,""AttributedField"":4}"); } + + [DataContract] + public class Master : IEquatable + { + [DataMember] + public int A { get; set; } + + [DataMember] + internal Detail InternalComplexProperty { get; set; } + + [DataMember] + internal Detail InternalComplexField; + + public bool Equals(Master other) + { + return other != null + && this.A == other.A + && EqualityComparer.Default.Equals(this.InternalComplexProperty, other.InternalComplexProperty) + && EqualityComparer.Default.Equals(this.InternalComplexField, other.InternalComplexField); + } + } + + public class Detail : IEquatable + { + public int B1 { get; set; } + + internal int B2 { get; set; } + + public bool Equals(Detail other) => other != null && this.B1 == other.B1 && this.B2 == other.B2; + } + +#if !UNITY_2018_3_OR_NEWER + + [Fact] + public void DataContractSerializerCompatibility() + { + var master = new Master + { + A = 1, + InternalComplexProperty = new Detail + { + B1 = 2, + B2 = 3, + }, + InternalComplexField = new Detail + { + B1 = 4, + B2 = 5, + }, + }; + + var dcsValue = DataContractSerializerRoundTrip(master); + + var option = MessagePackSerializerOptions.Standard.WithResolver(CompositeResolver.Create( + DynamicObjectResolverAllowPrivate.Instance, + ContractlessStandardResolver.Instance)); + var mpValue = MessagePackSerializer.Deserialize(MessagePackSerializer.Serialize(master, option), option); + + Assert.Equal(dcsValue, mpValue); + } + +#endif + + private static T DataContractSerializerRoundTrip(T value) + { + var ms = new MemoryStream(); + var dcs = new DataContractSerializer(typeof(T)); + dcs.WriteObject(ms, value); + ms.Position = 0; + return (T)dcs.ReadObject(ms); + } + + [Fact] + public void DeserializeTypeWithPrivateReadonlyDictionary() + { + var before = new ClassWithPrivateReadonlyDictionary(Guid.NewGuid()); + before.GetBody()["name"] = "my name"; + byte[] bytes = MessagePackSerializer.Serialize(before, StandardResolverAllowPrivate.Options); + string json = MessagePackSerializer.ConvertToJson(bytes); // just for check that json has _body' values. + this.logger.WriteLine(json); + + var after = MessagePackSerializer.Deserialize(bytes, StandardResolverAllowPrivate.Options); + Assert.Equal("my name", after.GetBody()["name"]); + } + + [Fact] + public void DeserializeTypeWithPrivateReadonlyDictionary_DCS() + { + var before = new ClassWithPrivateReadonlyDictionary(Guid.NewGuid()); + before.GetBody()["name"] = "my name"; + DataContractSerializer dcs = new DataContractSerializer(typeof(ClassWithPrivateReadonlyDictionary)); + var ms = new MemoryStream(); + dcs.WriteObject(ms, before); + ms.Position = 0; + var after = (ClassWithPrivateReadonlyDictionary)dcs.ReadObject(ms); + Assert.Equal("my name", after.GetBody()["name"]); + } } #endif diff --git a/src/MessagePack.UnityClient/Assets/Scripts/Tests/ShareTests/DynamicObjectFallbackTest.cs b/src/MessagePack.UnityClient/Assets/Scripts/Tests/ShareTests/DynamicObjectFallbackTest.cs index 4ac2331d3..a16b9f0b0 100644 --- a/src/MessagePack.UnityClient/Assets/Scripts/Tests/ShareTests/DynamicObjectFallbackTest.cs +++ b/src/MessagePack.UnityClient/Assets/Scripts/Tests/ShareTests/DynamicObjectFallbackTest.cs @@ -1,7 +1,7 @@ // Copyright (c) All contributors. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. -#if !ENABLE_IL2CPP +#if !UNITY_2018_3_OR_NEWER using System; using System.Collections.Generic; diff --git a/src/MessagePack.UnityClient/Assets/Scripts/Tests/ShareTests/DynamicObjectResolverConstructorTest.cs b/src/MessagePack.UnityClient/Assets/Scripts/Tests/ShareTests/DynamicObjectResolverConstructorTest.cs index 73bc1c70b..68f0b8aa2 100644 --- a/src/MessagePack.UnityClient/Assets/Scripts/Tests/ShareTests/DynamicObjectResolverConstructorTest.cs +++ b/src/MessagePack.UnityClient/Assets/Scripts/Tests/ShareTests/DynamicObjectResolverConstructorTest.cs @@ -255,6 +255,30 @@ public TestConstructor9(int x, int y, int z) } } + /// + /// This constructor tests the case where there are missing int keys, to ensure that + /// the correct ctor is still found using index numbers of the keys, not their values. + /// + [MessagePackObject] + public class TestConstructor10 + { + [Key(0)] + public int X { get; } + + [Key(2)] + public int Y { get; } + + [Key(5)] + public int Z { get; } + + public TestConstructor10(int x, int y, int z) + { + X = x; + Y = y; + Z = z; + } + } + [Fact] public void StringKey() { @@ -350,5 +374,17 @@ public void MatchedStructCtorFoundWithMixOfMemberNamesAndStringKeys() r.Y.Is(8); r.Z.Is(9); } + + [Fact] + public void MatchedClassCtorFoundWithMissingIntKeys() + { + var ctor = new TestConstructor10(10, 11, 12); + var bin = MessagePackSerializer.Serialize(ctor); + var r = MessagePackSerializer.Deserialize(bin); + + r.X.Is(10); + r.Y.Is(11); + r.Z.Is(12); + } } } diff --git a/src/MessagePack.UnityClient/Assets/Scripts/Tests/ShareTests/DynamicObjectResolverTests.cs b/src/MessagePack.UnityClient/Assets/Scripts/Tests/ShareTests/DynamicObjectResolverTests.cs index 34e409bab..8508b01a5 100644 --- a/src/MessagePack.UnityClient/Assets/Scripts/Tests/ShareTests/DynamicObjectResolverTests.cs +++ b/src/MessagePack.UnityClient/Assets/Scripts/Tests/ShareTests/DynamicObjectResolverTests.cs @@ -67,7 +67,7 @@ public void DeserializerSetsMissingPropertiesToDefaultValue() var instance = MessagePackSerializer.Deserialize(seq); Assert.Equal("Set", instance.Prop1); - Assert.Null(instance.Prop2); + Assert.Equal("Uninitialized", instance.Prop2); } [Fact] @@ -81,7 +81,7 @@ public void DeserializerSetsMissingPropertiesToDefaultValue_OrdinalKey() var instance = MessagePackSerializer.Deserialize(seq); Assert.Equal("Set", instance.Prop1); - Assert.Null(instance.Prop2); + Assert.Equal("Uninitialized", instance.Prop2); } [Fact] @@ -91,9 +91,8 @@ public void CtorParameterAndPropertySetterExists() byte[] bin = MessagePackSerializer.Serialize(m1); var m2 = MessagePackSerializer.Deserialize(bin); - // In this version of the deserializer, we expect the property setter to be invoked - // and reaffirm the value already passed to the constructor. - Assert.Equal(m1.MyProperty, m2.MyProperty); + // We do NOT use the property setter since the constructor is expected to set the property. + Assert.Equal(0, m2.MyProperty); } /// @@ -176,6 +175,290 @@ private void PrivateMembersInBaseClass_Helper(MessagePackSerializerOptions optio Assert.Equal(obj.Name, obj2.Name); } + [Fact] + public void DefaultValueStringKeyClassWithoutExplicitConstructorTest() + { + var seq = new Sequence(); + var writer = new MessagePackWriter(seq); + writer.WriteMapHeader(0); + writer.Flush(); + + var instance = MessagePackSerializer.Deserialize(seq); + Assert.Equal(DefaultValueStringKeyClassWithoutExplicitConstructor.Prop1Constant, instance.Prop1); + Assert.Equal(DefaultValueStringKeyClassWithoutExplicitConstructor.Prop2Constant, instance.Prop2); + } + + [Fact] + public void DefaultValueStringKeyClassWithExplicitConstructorTest() + { + var seq = new Sequence(); + var writer = new MessagePackWriter(seq); + writer.WriteMapHeader(1); + writer.Write(nameof(DefaultValueStringKeyClassWithExplicitConstructor.Prop1)); + writer.Write(-1); + writer.Flush(); + + var instance = MessagePackSerializer.Deserialize(seq); + Assert.Equal(-1, instance.Prop1); + Assert.Equal(DefaultValueStringKeyClassWithExplicitConstructor.Prop2Constant, instance.Prop2); + } + + [Fact] + public void DefaultValueStringKeyClassWithExplicitConstructorSetPropertyTest() + { + var seq = new Sequence(); + var writer = new MessagePackWriter(seq); + writer.WriteMapHeader(2); + writer.Write(nameof(DefaultValueStringKeyClassWithExplicitConstructor.Prop1)); + writer.Write(-1); + writer.Write(nameof(DefaultValueStringKeyClassWithExplicitConstructor.Prop2)); + writer.Write(int.MaxValue); + writer.Flush(); + + var instance = MessagePackSerializer.Deserialize(seq); + Assert.Equal(-1, instance.Prop1); + Assert.Equal(int.MaxValue, instance.Prop2); + } + + [Fact] + public void DefaultValueStringKeyStructWithExplicitConstructorTest() + { + var seq = new Sequence(); + var writer = new MessagePackWriter(seq); + writer.WriteMapHeader(1); + writer.Write(nameof(DefaultValueStringKeyStructWithExplicitConstructor.Prop1)); + writer.Write(-1); + writer.Flush(); + + var instance = MessagePackSerializer.Deserialize(seq); + Assert.Equal(-1, instance.Prop1); + Assert.Equal(DefaultValueStringKeyStructWithExplicitConstructor.Prop2Constant, instance.Prop2); + } + + [Fact] + public void DefaultValueStringKeyStructWithExplicitConstructorSetPropertyTest() + { + var seq = new Sequence(); + var writer = new MessagePackWriter(seq); + writer.WriteMapHeader(2); + writer.Write(nameof(DefaultValueStringKeyStructWithExplicitConstructor.Prop1)); + writer.Write(-1); + writer.Write(nameof(DefaultValueStringKeyStructWithExplicitConstructor.Prop2)); + writer.Write(int.MinValue); + writer.Flush(); + + var instance = MessagePackSerializer.Deserialize(seq); + Assert.Equal(-1, instance.Prop1); + Assert.Equal(int.MinValue, instance.Prop2); + } + + [Fact] + public void DefaultValueIntKeyClassWithoutExplicitConstructorTest() + { + var seq = new Sequence(); + var writer = new MessagePackWriter(seq); + writer.WriteArrayHeader(0); + writer.Flush(); + + var instance = MessagePackSerializer.Deserialize(seq); + Assert.Equal(DefaultValueIntKeyClassWithoutExplicitConstructor.Prop1Constant, instance.Prop1); + Assert.Equal(DefaultValueIntKeyClassWithoutExplicitConstructor.Prop2Constant, instance.Prop2); + } + + [Fact] + public void DefaultValueIntKeyClassWithExplicitConstructorTest() + { + var seq = new Sequence(); + var writer = new MessagePackWriter(seq); + writer.WriteArrayHeader(1); + writer.Write(-1); + writer.Flush(); + + var instance = MessagePackSerializer.Deserialize(seq); + Assert.Equal(-1, instance.Prop1); + Assert.Equal(DefaultValueIntKeyClassWithExplicitConstructor.Prop2Constant, instance.Prop2); + } + + [Fact] + public void DefaultValueIntKeyClassWithExplicitConstructorSetPropertyTest() + { + var seq = new Sequence(); + var writer = new MessagePackWriter(seq); + writer.WriteArrayHeader(2); + writer.Write(-1); + writer.Write(42); + writer.Flush(); + + var instance = MessagePackSerializer.Deserialize(seq); + Assert.Equal(-1, instance.Prop1); + Assert.Equal(42, instance.Prop2); + } + + [Fact] + public void DefaultValueIntKeyStructWithExplicitConstructorTest() + { + var seq = new Sequence(); + var writer = new MessagePackWriter(seq); + writer.WriteArrayHeader(1); + writer.Write(-1); + writer.Flush(); + + var instance = MessagePackSerializer.Deserialize(seq); + Assert.Equal(-1, instance.Prop1); + Assert.Equal(DefaultValueIntKeyStructWithExplicitConstructor.Prop2Constant, instance.Prop2); + } + + [Fact] + public void DefaultValueIntKeyStructWithExplicitConstructorSetPropertyTest() + { + var seq = new Sequence(); + var writer = new MessagePackWriter(seq); + writer.WriteArrayHeader(2); + writer.Write(-1); + writer.Write(-98); + writer.Flush(); + + var instance = MessagePackSerializer.Deserialize(seq); + Assert.Equal(-1, instance.Prop1); + Assert.Equal(-98, instance.Prop2); + } + +#if !UNITY_2018_3_OR_NEWER + + [Fact] + public void RoundtripGenericClass_StandardResolverFallsBackOnInitProperty() + { + var person = new GenericPerson { Name = "bob" }; + var options = StandardResolver.Options; + byte[] msgpack = MessagePackSerializer.Serialize(person, options); + var deserialized = MessagePackSerializer.Deserialize>(msgpack, options); + Assert.Equal(person.Name, deserialized.Name); + } + + [Fact] + public void RoundtripNonGenericClass_StandardResolverWorksWithInitPropertySetter() + { + var person = new Person { Name = "bob" }; + var options = StandardResolver.Options; + byte[] msgpack = MessagePackSerializer.Serialize(person, options); + var deserialized = MessagePackSerializer.Deserialize(msgpack, options); + Assert.Equal(person.Name, deserialized.Name); + } + + [Fact] + public void RoundtripGenericClass_StandardResolverWorksWithDeserializingCtor() + { + var person = new GenericPersonWithCtor("bob"); + var options = StandardResolver.Options; + byte[] msgpack = MessagePackSerializer.Serialize(person, options); + var deserialized = MessagePackSerializer.Deserialize>(msgpack, options); + Assert.Equal(person.Name, deserialized.Name); + } + + [Fact] + public void RoundtripGenericClass_AllowPrivateStandardResolver() + { + var person = new GenericPerson { Name = "bob" }; + var options = StandardResolverAllowPrivate.Options; + byte[] msgpack = MessagePackSerializer.Serialize(person, options); + var deserialized = MessagePackSerializer.Deserialize>(msgpack, options); + Assert.Equal(person.Name, deserialized.Name); + } + +#endif + + [MessagePackObject(true)] + public class DefaultValueStringKeyClassWithoutExplicitConstructor + { + public const int Prop1Constant = 11; + public const int Prop2Constant = 45; + + public int Prop1 { get; set; } = Prop1Constant; + + public int Prop2 { get; set; } = Prop2Constant; + } + + [MessagePackObject(true)] + public class DefaultValueStringKeyClassWithExplicitConstructor + { + public const int Prop2Constant = 1419; + + public int Prop1 { get; set; } + + public int Prop2 { get; set; } + + public DefaultValueStringKeyClassWithExplicitConstructor(int prop1) + { + Prop1 = prop1; + Prop2 = Prop2Constant; + } + } + + [MessagePackObject(true)] + public struct DefaultValueStringKeyStructWithExplicitConstructor + { + public const int Prop2Constant = 198; + + public int Prop1 { get; set; } + + public int Prop2 { get; set; } + + public DefaultValueStringKeyStructWithExplicitConstructor(int prop1) + { + Prop1 = prop1; + Prop2 = Prop2Constant; + } + } + + [MessagePackObject] + public class DefaultValueIntKeyClassWithoutExplicitConstructor + { + public const int Prop1Constant = 33; + public const int Prop2Constant = -4; + + [Key(0)] + public int Prop1 { get; set; } = Prop1Constant; + + [Key(1)] + public int Prop2 { get; set; } = Prop2Constant; + } + + [MessagePackObject] + public class DefaultValueIntKeyClassWithExplicitConstructor + { + public const int Prop2Constant = -109; + + [Key(0)] + public int Prop1 { get; set; } + + [Key(1)] + public int Prop2 { get; set; } + + public DefaultValueIntKeyClassWithExplicitConstructor(int prop1) + { + Prop1 = prop1; + Prop2 = Prop2Constant; + } + } + + [MessagePackObject] + public struct DefaultValueIntKeyStructWithExplicitConstructor + { + public const int Prop2Constant = 31; + + [Key(0)] + public int Prop1 { get; set; } + + [Key(1)] + public int Prop2 { get; set; } + + public DefaultValueIntKeyStructWithExplicitConstructor(int prop1) + { + Prop1 = prop1; + Prop2 = Prop2Constant; + } + } + [DataContract] public class BaseClassWithVirtualProperty { @@ -370,6 +653,32 @@ public class DerivedClass : BaseClass public string Name { get; set; } } +#if !UNITY_2018_3_OR_NEWER + [MessagePackObject] + public class Person + { + [Key(0)] + public string Name { get; init; } + } + + [MessagePackObject] + public class GenericPerson + { + [Key(0)] + public string Name { get; init; } + } + + [MessagePackObject] + public class GenericPersonWithCtor + { + [SerializationConstructor] + public GenericPersonWithCtor(string name) => this.Name = name; + + [Key(0)] + public string Name { get; init; } + } +#endif + [MessagePackObject(true)] public class ClassWithPropertySetterAndDummyCtor { diff --git a/src/MessagePack.UnityClient/Assets/Scripts/Tests/ShareTests/ExpandoObjectTests.cs b/src/MessagePack.UnityClient/Assets/Scripts/Tests/ShareTests/ExpandoObjectTests.cs index 45b17edeb..99f3b808a 100644 --- a/src/MessagePack.UnityClient/Assets/Scripts/Tests/ShareTests/ExpandoObjectTests.cs +++ b/src/MessagePack.UnityClient/Assets/Scripts/Tests/ShareTests/ExpandoObjectTests.cs @@ -1,6 +1,8 @@ // Copyright (c) All contributors. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. +#if !UNITY_2018_3_OR_NEWER + using System.Dynamic; using System.Runtime.Serialization; using MessagePack.Resolvers; @@ -115,3 +117,5 @@ public class CustomObject } } } + +#endif diff --git a/src/MessagePack.UnityClient/Assets/Scripts/Tests/ShareTests/FormatterTest.cs b/src/MessagePack.UnityClient/Assets/Scripts/Tests/ShareTests/FormatterTest.cs index d2b18a795..d74e4ba5e 100644 --- a/src/MessagePack.UnityClient/Assets/Scripts/Tests/ShareTests/FormatterTest.cs +++ b/src/MessagePack.UnityClient/Assets/Scripts/Tests/ShareTests/FormatterTest.cs @@ -312,5 +312,16 @@ public void UriTest_Relative() var relative = new Uri("/me/", UriKind.Relative); this.Convert(relative).ToString().Is("/me/"); } + +#if NET5_0_OR_GREATER + + [Fact] + public void HalfTest() + { + Convert((Half)1.34f).Is((Half)1.34f); + Convert((Half)0).Is((Half)0); + } + +#endif } } diff --git a/src/MessagePack.UnityClient/Assets/Scripts/Tests/ShareTests/MessagePackFormatterPerFieldTest.cs b/src/MessagePack.UnityClient/Assets/Scripts/Tests/ShareTests/MessagePackFormatterPerFieldTest.cs index 6be33a46f..b0dca2c34 100644 --- a/src/MessagePack.UnityClient/Assets/Scripts/Tests/ShareTests/MessagePackFormatterPerFieldTest.cs +++ b/src/MessagePack.UnityClient/Assets/Scripts/Tests/ShareTests/MessagePackFormatterPerFieldTest.cs @@ -5,16 +5,27 @@ using System.Buffers; using System.Collections.Generic; using System.Linq; +using System.Net.Sockets; +using System.Reflection; +using System.Runtime.Serialization; using System.Text; using System.Threading.Tasks; using MessagePack.Formatters; using MessagePack.Resolvers; using Xunit; +using Xunit.Abstractions; namespace MessagePack.Tests { public class MessagePackFormatterPerFieldTest { + private readonly ITestOutputHelper logger; + + public MessagePackFormatterPerFieldTest(ITestOutputHelper logger) + { + this.logger = logger; + } + [MessagePackObject] public class MyClass { @@ -105,5 +116,129 @@ public void FooBar() r2.MyProperty4.Is("bar"); } } + + [MessagePackObject] + public class BlockFormattedIntegers + { + [Key(0)] [MessagePackFormatter(typeof(ForceByteBlockFormatter))] public byte UInt8Property { get; set; } + + [Key(1)] [MessagePackFormatter(typeof(ForceUInt16BlockFormatter))] public ushort UInt16Property { get; set; } + + [Key(2)] [MessagePackFormatter(typeof(ForceUInt32BlockFormatter))] public uint UInt32Property { get; set; } + + [Key(3)] [MessagePackFormatter(typeof(ForceUInt64BlockFormatter))] public ulong UInt64Property { get; set; } + + [Key(4)] [MessagePackFormatter(typeof(ForceSByteBlockFormatter))] public sbyte Int8Property { get; set; } + + [Key(5)] [MessagePackFormatter(typeof(ForceInt16BlockFormatter))] public short Int16Property { get; set; } + + [Key(6)] [MessagePackFormatter(typeof(ForceInt32BlockFormatter))] public int Int32Property { get; set; } + + [Key(7)] [MessagePackFormatter(typeof(ForceInt64BlockFormatter))] public long Int64Property { get; set; } + + [Key(8)] [MessagePackFormatter(typeof(NullableForceByteBlockFormatter))] public byte? NullableUInt8Property { get; set; } + + [Key(9)] [MessagePackFormatter(typeof(NullableForceUInt16BlockFormatter))] public ushort? NullableUInt16Property { get; set; } + + [Key(10)] [MessagePackFormatter(typeof(NullableForceUInt32BlockFormatter))] public uint? NullableUInt32Property { get; set; } + + [Key(11)] [MessagePackFormatter(typeof(NullableForceUInt64BlockFormatter))] public ulong? NullableUInt64Property { get; set; } + + [Key(12)] [MessagePackFormatter(typeof(NullableForceSByteBlockFormatter))] public sbyte? NullableInt8Property { get; set; } + + [Key(13)] [MessagePackFormatter(typeof(NullableForceInt16BlockFormatter))] public short? NullableInt16Property { get; set; } + + [Key(14)] [MessagePackFormatter(typeof(NullableForceInt32BlockFormatter))] public int? NullableInt32Property { get; set; } + + [Key(15)] [MessagePackFormatter(typeof(NullableForceInt64BlockFormatter))] public long? NullableInt64Property { get; set; } + } + + /// + /// Asserts that every formatter offers the public API required for use by + /// . + /// + [Fact] + public void AllFormattersOfferAreAvailableViaAttribute() + { + var formatters = (from type in typeof(ForceByteBlockFormatter).Assembly.GetTypes() + where typeof(IMessagePackFormatter).IsAssignableFrom(type) && !type.IsAbstract + let ctor = GetDefaultConstructor(type) + where ctor is object // skip formatters that require special initialization. + select new { Type = type, DefaultConstructor = ctor }).ToList(); + this.logger.WriteLine("Found {0} applicable formatters to check.", formatters.Count); + + Assert.All(formatters, formatter => Assert.True(formatter.DefaultConstructor.IsPublic || UsesSingletonPattern(formatter.Type))); + } + + [Fact] + public void ForceBlockFormatters() + { + var block = new BlockFormattedIntegers + { + UInt8Property = 1, + UInt16Property = 2, + UInt32Property = 3, + UInt64Property = 4, + + Int8Property = 1, + Int16Property = 2, + Int32Property = 3, + Int64Property = 4, + + NullableUInt8Property = 1, + NullableUInt16Property = 2, + NullableUInt32Property = 3, + NullableUInt64Property = 4, + + NullableInt8Property = 1, + NullableInt16Property = 2, + NullableInt32Property = 3, + NullableInt64Property = 4, + }; + byte[] packed = MessagePackSerializer.Serialize(block, MessagePackSerializerOptions.Standard); + var reader = new MessagePackReader(packed); + + reader.ReadArrayHeader(); + + Assert.Equal(MessagePackCode.UInt8, reader.NextCode); + Assert.Equal(1, reader.ReadByte()); + Assert.Equal(MessagePackCode.UInt16, reader.NextCode); + Assert.Equal(2, reader.ReadUInt16()); + Assert.Equal(MessagePackCode.UInt32, reader.NextCode); + Assert.Equal(3u, reader.ReadUInt32()); + Assert.Equal(MessagePackCode.UInt64, reader.NextCode); + Assert.Equal(4u, reader.ReadUInt64()); + + Assert.Equal(MessagePackCode.Int8, reader.NextCode); + Assert.Equal(1, reader.ReadSByte()); + Assert.Equal(MessagePackCode.Int16, reader.NextCode); + Assert.Equal(2, reader.ReadInt16()); + Assert.Equal(MessagePackCode.Int32, reader.NextCode); + Assert.Equal(3, reader.ReadInt32()); + Assert.Equal(MessagePackCode.Int64, reader.NextCode); + Assert.Equal(4, reader.ReadInt64()); + + Assert.Equal(MessagePackCode.UInt8, reader.NextCode); + Assert.Equal(1, reader.ReadByte()); + Assert.Equal(MessagePackCode.UInt16, reader.NextCode); + Assert.Equal(2, reader.ReadUInt16()); + Assert.Equal(MessagePackCode.UInt32, reader.NextCode); + Assert.Equal(3u, reader.ReadUInt32()); + Assert.Equal(MessagePackCode.UInt64, reader.NextCode); + Assert.Equal(4u, reader.ReadUInt64()); + + Assert.Equal(MessagePackCode.Int8, reader.NextCode); + Assert.Equal(1, reader.ReadSByte()); + Assert.Equal(MessagePackCode.Int16, reader.NextCode); + Assert.Equal(2, reader.ReadInt16()); + Assert.Equal(MessagePackCode.Int32, reader.NextCode); + Assert.Equal(3, reader.ReadInt32()); + Assert.Equal(MessagePackCode.Int64, reader.NextCode); + Assert.Equal(4, reader.ReadInt64()); + } + + private static ConstructorInfo GetDefaultConstructor(Type formatterType) => formatterType.GetConstructors(BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic).FirstOrDefault(c => c.GetParameters().Length == 0); + + private static bool UsesSingletonPattern(Type formatterType) => formatterType.GetField("Instance", BindingFlags.Static | BindingFlags.Public)?.IsInitOnly is true; } } diff --git a/src/MessagePack.UnityClient/Assets/Scripts/Tests/ShareTests/MessagePackSerializerOptionsTests.cs b/src/MessagePack.UnityClient/Assets/Scripts/Tests/ShareTests/MessagePackSerializerOptionsTests.cs index 96bec149a..0db5157c0 100644 --- a/src/MessagePack.UnityClient/Assets/Scripts/Tests/ShareTests/MessagePackSerializerOptionsTests.cs +++ b/src/MessagePack.UnityClient/Assets/Scripts/Tests/ShareTests/MessagePackSerializerOptionsTests.cs @@ -1,6 +1,7 @@ // Copyright (c) All contributors. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. +using System; using MessagePack; using MessagePack.Resolvers; using Xunit; @@ -13,7 +14,8 @@ public class MessagePackSerializerOptionsTests .WithOmitAssemblyVersion(true) .WithResolver(BuiltinResolver.Instance) .WithOldSpec(false) - .WithSecurity(MySecurityOptions.Instance); + .WithSecurity(MySecurityOptions.Instance) + .WithSuggestedContiguousMemorySize(64 * 1024); [Fact] public void AllowAssemblyVersionMismatch() @@ -36,6 +38,26 @@ public void Compression() Assert.Equal(MessagePackCompression.Lz4Block, MessagePackSerializerOptions.Standard.WithCompression(MessagePackCompression.Lz4Block).Compression); } + [Fact] + public void CompressionMinLength() + { + Assert.Equal(64, MessagePackSerializerOptions.Standard.CompressionMinLength); + Assert.Throws(() => MessagePackSerializerOptions.Standard.WithCompressionMinLength(0)); + Assert.Throws(() => MessagePackSerializerOptions.Standard.WithCompressionMinLength(-1)); + MessagePackSerializerOptions options = MessagePackSerializerOptions.Standard.WithCompressionMinLength(128); + Assert.Equal(128, options.CompressionMinLength); + } + + [Fact] + public void SuggestedContiguousMemorySize() + { + Assert.Equal(1024 * 1024, MessagePackSerializerOptions.Standard.SuggestedContiguousMemorySize); + Assert.Throws(() => MessagePackSerializerOptions.Standard.WithSuggestedContiguousMemorySize(0)); + Assert.Throws(() => MessagePackSerializerOptions.Standard.WithSuggestedContiguousMemorySize(4)); + MessagePackSerializerOptions options = MessagePackSerializerOptions.Standard.WithSuggestedContiguousMemorySize(512); + Assert.Equal(512, options.SuggestedContiguousMemorySize); + } + [Fact] public void OldSpec() { @@ -63,6 +85,7 @@ public void WithOldSpec_PreservesOtherProperties() var mutated = NonDefaultOptions.WithOldSpec(true); Assert.True(mutated.OldSpec.Value); Assert.Equal(NonDefaultOptions.Compression, mutated.Compression); + Assert.Equal(NonDefaultOptions.SuggestedContiguousMemorySize, mutated.SuggestedContiguousMemorySize); Assert.Equal(NonDefaultOptions.AllowAssemblyVersionMismatch, mutated.AllowAssemblyVersionMismatch); Assert.Equal(NonDefaultOptions.OmitAssemblyVersion, mutated.OmitAssemblyVersion); Assert.Same(NonDefaultOptions.Resolver, mutated.Resolver); @@ -81,12 +104,26 @@ public void WithLZ4Compression_PreservesOtherProperties() Assert.Same(MySecurityOptions.Instance, mutated.Security); } + [Fact] + public void WithSuggestedContiguousMemorySize_PreservesOtherProperties() + { + var mutated = NonDefaultOptions.WithSuggestedContiguousMemorySize(612); + Assert.Equal(612, mutated.SuggestedContiguousMemorySize); + Assert.Equal(NonDefaultOptions.Compression, mutated.Compression); + Assert.Equal(NonDefaultOptions.OldSpec, mutated.OldSpec); + Assert.Equal(NonDefaultOptions.AllowAssemblyVersionMismatch, mutated.AllowAssemblyVersionMismatch); + Assert.Equal(NonDefaultOptions.OmitAssemblyVersion, mutated.OmitAssemblyVersion); + Assert.Same(NonDefaultOptions.Resolver, mutated.Resolver); + Assert.Same(MySecurityOptions.Instance, mutated.Security); + } + [Fact] public void WithAllowAssemblyVersionMismatch_PreservesOtherProperties() { var mutated = NonDefaultOptions.WithAllowAssemblyVersionMismatch(false); Assert.False(mutated.AllowAssemblyVersionMismatch); Assert.Equal(NonDefaultOptions.Compression, mutated.Compression); + Assert.Equal(NonDefaultOptions.SuggestedContiguousMemorySize, mutated.SuggestedContiguousMemorySize); Assert.Equal(NonDefaultOptions.OldSpec, mutated.OldSpec); Assert.Equal(NonDefaultOptions.OmitAssemblyVersion, mutated.OmitAssemblyVersion); Assert.Same(NonDefaultOptions.Resolver, mutated.Resolver); @@ -99,6 +136,7 @@ public void WithOmitAssemblyVersion_PreservesOtherProperties() var mutated = NonDefaultOptions.WithOmitAssemblyVersion(false); Assert.False(mutated.OmitAssemblyVersion); Assert.Equal(NonDefaultOptions.Compression, mutated.Compression); + Assert.Equal(NonDefaultOptions.SuggestedContiguousMemorySize, mutated.SuggestedContiguousMemorySize); Assert.Equal(NonDefaultOptions.OldSpec, mutated.OldSpec); Assert.Equal(NonDefaultOptions.AllowAssemblyVersionMismatch, mutated.AllowAssemblyVersionMismatch); Assert.Same(NonDefaultOptions.Resolver, mutated.Resolver); @@ -111,6 +149,7 @@ public void WithResolver_PreservesOtherProperties() var mutated = NonDefaultOptions.WithResolver(ContractlessStandardResolver.Instance); Assert.Same(ContractlessStandardResolver.Instance, mutated.Resolver); Assert.Equal(NonDefaultOptions.Compression, mutated.Compression); + Assert.Equal(NonDefaultOptions.SuggestedContiguousMemorySize, mutated.SuggestedContiguousMemorySize); Assert.Equal(NonDefaultOptions.OldSpec, mutated.OldSpec); Assert.Equal(NonDefaultOptions.AllowAssemblyVersionMismatch, mutated.AllowAssemblyVersionMismatch); Assert.Equal(NonDefaultOptions.OmitAssemblyVersion, mutated.OmitAssemblyVersion); @@ -124,6 +163,7 @@ public void WithSecurity_PreservesOtherProperties() Assert.Same(MessagePackSecurity.TrustedData, mutated.Security); Assert.Same(NonDefaultOptions.Resolver, mutated.Resolver); Assert.Equal(NonDefaultOptions.Compression, mutated.Compression); + Assert.Equal(NonDefaultOptions.SuggestedContiguousMemorySize, mutated.SuggestedContiguousMemorySize); Assert.Equal(NonDefaultOptions.OldSpec, mutated.OldSpec); Assert.Equal(NonDefaultOptions.AllowAssemblyVersionMismatch, mutated.AllowAssemblyVersionMismatch); Assert.Equal(NonDefaultOptions.OmitAssemblyVersion, mutated.OmitAssemblyVersion); diff --git a/src/MessagePack.UnityClient/Assets/Scripts/Tests/ShareTests/MessagePackWriterTests.cs b/src/MessagePack.UnityClient/Assets/Scripts/Tests/ShareTests/MessagePackWriterTests.cs index 5d06e78dc..85d293650 100644 --- a/src/MessagePack.UnityClient/Assets/Scripts/Tests/ShareTests/MessagePackWriterTests.cs +++ b/src/MessagePack.UnityClient/Assets/Scripts/Tests/ShareTests/MessagePackWriterTests.cs @@ -10,6 +10,7 @@ using Nerdbank.Streams; using Xunit; using Xunit.Abstractions; +using MessagePackWriterCref = MessagePack.MessagePackWriter; namespace MessagePack.Tests { @@ -33,7 +34,7 @@ public MessagePackWriterTests() #endif /// - /// Verifies that + /// Verifies that /// accepts a span that came from stackalloc. /// [Fact] diff --git a/src/MessagePack.UnityClient/Assets/Scripts/Tests/ShareTests/StandardClassLibraryFormatterTests.cs b/src/MessagePack.UnityClient/Assets/Scripts/Tests/ShareTests/StandardClassLibraryFormatterTests.cs index 6d4d9b34a..351234765 100644 --- a/src/MessagePack.UnityClient/Assets/Scripts/Tests/ShareTests/StandardClassLibraryFormatterTests.cs +++ b/src/MessagePack.UnityClient/Assets/Scripts/Tests/ShareTests/StandardClassLibraryFormatterTests.cs @@ -2,12 +2,21 @@ // Licensed under the MIT license. See LICENSE file in the project root for full license information. using System; +using Nerdbank.Streams; using Xunit; +using Xunit.Abstractions; namespace MessagePack.Tests { public class StandardClassLibraryFormatterTests : TestBase { + private readonly ITestOutputHelper logger; + + public StandardClassLibraryFormatterTests(ITestOutputHelper logger) + { + this.logger = logger; + } + [Fact] public void SystemType_Serializable() { @@ -25,5 +34,103 @@ public void SystemType_Serializable_Null() Type type2 = MessagePackSerializer.Deserialize(msgpack, MessagePackSerializerOptions.Standard); Assert.Equal(type, type2); } + + [Fact] + public void DeserializeByteArrayFromFixArray() + { + var input = new byte[] { 0x93, 0x01, 0x02, 0x03 }; + byte[] byte_array = MessagePackSerializer.Deserialize(input); + Assert.Equal(new byte[] { 1, 2, 3 }, byte_array); + } + + [Fact] + public void DeserializeByteArrayFromFixArray_LargerNumbers() + { + var input = new byte[] { 0x93, 0x01, 0x02, 0xCC, 0xD4 }; + byte[] byte_array = MessagePackSerializer.Deserialize(input); + Assert.Equal(new byte[] { 1, 2, 212 }, byte_array); + } + + [Fact] + public void DeserializeByteArrayFromFixArray_LargerThanByte() + { + var input = new byte[] { 0x93, 0x01, 0x02, 0xCD, 0x08, 0x48 }; // 1, 2, 2120 + var ex = Assert.Throws(() => MessagePackSerializer.Deserialize(input)); + this.logger.WriteLine(ex.ToString()); + } + + [Fact] + public void DeserializeByteArrayFromFixArray_ZeroLength() + { + var input = new byte[] { 0x90 }; // [ ] + byte[] actual = MessagePackSerializer.Deserialize(input); + Assert.Empty(actual); + + // Make sure we're optimized to reuse singleton empty arrays. + Assert.Same(Array.Empty(), actual); + } + + [Fact] + public void DeserializeByteArrayFromFixArray_Array32() + { + var input = new byte[] { 0xDD, 0, 0, 0, 3, 1, 2, 3 }; + byte[] byte_array = MessagePackSerializer.Deserialize(input); + Assert.Equal(new byte[] { 1, 2, 3 }, byte_array); + } + +#if NET6_0_OR_GREATER + [Fact] + public void DateOnly() + { + var value = new DateOnly(2012, 3, 5); + this.AssertRoundtrip(value); + this.AssertRoundtrip(value); + this.AssertRoundtrip(new[] { value }); + } + + [Fact] + public void TimeOnly() + { + TimeOnly lowRes = new TimeOnly(5, 4, 3); + this.AssertRoundtrip(lowRes); + this.AssertRoundtrip(lowRes); + this.AssertRoundtrip(new[] { lowRes }); + + TimeOnly mediumRes = new TimeOnly(5, 4, 3, 2); + this.AssertRoundtrip(mediumRes); + this.AssertRoundtrip(mediumRes); + this.AssertRoundtrip(new[] { mediumRes }); + + TimeOnly highRes = new TimeOnly(lowRes.Ticks + 1); + this.AssertRoundtrip(highRes); + this.AssertRoundtrip(System.TimeOnly.MaxValue); + } +#endif + + private void AssertRoundtrip(T value) + { + Assert.Equal(value, this.Roundtrip(value, breakupBuffer: false)); + Assert.Equal(value, this.Roundtrip(value, breakupBuffer: true)); + } + + private T Roundtrip(T value, bool breakupBuffer = false) + { + byte[] msgpack = MessagePackSerializer.Serialize(value, MessagePackSerializerOptions.Standard); + this.logger.WriteLine("{0} 0x{1}", value, TestUtilities.ToHex(msgpack)); + + if (breakupBuffer) + { + using (Sequence seq = new Sequence()) + { + seq.Append(msgpack.AsMemory(0, msgpack.Length - 1)); + seq.Append(msgpack.AsMemory(msgpack.Length - 1, 1)); + return MessagePackSerializer.Deserialize(seq, MessagePackSerializerOptions.Standard); + } + } + else + { + return MessagePackSerializer.Deserialize(msgpack, MessagePackSerializerOptions.Standard); + } + } } } diff --git a/src/MessagePack.UnityClient/Assets/Scripts/Tests/ShareTests/StringInterningTests.cs b/src/MessagePack.UnityClient/Assets/Scripts/Tests/ShareTests/StringInterningTests.cs new file mode 100644 index 000000000..d4e98f77a --- /dev/null +++ b/src/MessagePack.UnityClient/Assets/Scripts/Tests/ShareTests/StringInterningTests.cs @@ -0,0 +1,107 @@ +// Copyright (c) All contributors. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +using MessagePack.Formatters; +using MessagePack.Resolvers; +using Nerdbank.Streams; +using Xunit; + +namespace MessagePack.Tests +{ + public class StringInterningTests + { + [Fact] + public void NullString() + { + var seq = new Sequence(); + var writer = new MessagePackWriter(seq); + writer.WriteNil(); + writer.Flush(); + + var reader = new MessagePackReader(seq); + string result = StandardResolver.Instance.GetFormatter().Deserialize(ref reader, MessagePackSerializerOptions.Standard); + Assert.Null(result); + } + + [Fact] + public void EmptyString() + { + var seq = new Sequence(); + var writer = new MessagePackWriter(seq); + writer.Write(string.Empty); + writer.Flush(); + + var reader = new MessagePackReader(seq); + string result = StandardResolver.Instance.GetFormatter().Deserialize(ref reader, MessagePackSerializerOptions.Standard); + Assert.Same(string.Empty, result); + } + + [Theory] + [InlineData(3)] + [InlineData(1024 * 1024)] + public void EquivalentStringsGetSharedInstance(int length) + { + string originalValue1 = new string('a', length); + string originalValue3 = new string('b', length); + var seq = new Sequence(); + var writer = new MessagePackWriter(seq); + writer.Write(originalValue1); + writer.Write(originalValue1); + writer.Write(originalValue3); + writer.Flush(); + + var reader = new MessagePackReader(seq); + var formatter = new StringInterningFormatter(); + string value1 = formatter.Deserialize(ref reader, MessagePackSerializerOptions.Standard); + string value2 = formatter.Deserialize(ref reader, MessagePackSerializerOptions.Standard); + string value3 = formatter.Deserialize(ref reader, MessagePackSerializerOptions.Standard); + + Assert.Equal(originalValue1, value1); + Assert.Equal(originalValue3, value3); + + Assert.Same(value1, value2); + } + + [Fact] + public void StringMemberInterning() + { + ClassOfStrings before = new ClassOfStrings { InternedString = "abc", OrdinaryString = "def" }; + ClassOfStrings after1 = MessagePackSerializer.Deserialize(MessagePackSerializer.Serialize(before, MessagePackSerializerOptions.Standard), MessagePackSerializerOptions.Standard); + ClassOfStrings after2 = MessagePackSerializer.Deserialize(MessagePackSerializer.Serialize(before, MessagePackSerializerOptions.Standard), MessagePackSerializerOptions.Standard); + Assert.Equal(after1.InternedString, after2.InternedString); + Assert.Equal(after1.OrdinaryString, after2.OrdinaryString); + + Assert.Same(after1.InternedString, after2.InternedString); + Assert.NotSame(after1.OrdinaryString, after2.OrdinaryString); + } + + [Fact] + public void StringMemberInterning_CustomResolver() + { + var options = MessagePackSerializerOptions.Standard.WithResolver( + CompositeResolver.Create( + new IMessagePackFormatter[] { new StringInterningFormatter() }, + new IFormatterResolver[] { StandardResolver.Instance })); + + ClassOfStrings before = new ClassOfStrings { InternedString = "abc", OrdinaryString = "def" }; + ClassOfStrings after1 = MessagePackSerializer.Deserialize(MessagePackSerializer.Serialize(before, options), options); + ClassOfStrings after2 = MessagePackSerializer.Deserialize(MessagePackSerializer.Serialize(before, options), options); + Assert.Equal(after1.InternedString, after2.InternedString); + Assert.Equal(after1.OrdinaryString, after2.OrdinaryString); + + Assert.Same(after1.InternedString, after2.InternedString); + Assert.Same(after1.OrdinaryString, after2.OrdinaryString); + } + + [MessagePackObject] + public class ClassOfStrings + { + [Key(0)] + [MessagePackFormatter(typeof(StringInterningFormatter))] + public string InternedString { get; set; } + + [Key(1)] + public string OrdinaryString { get; set; } + } + } +} diff --git a/src/MessagePack.UnityClient/Assets/Scripts/Tests/ShareTests/StringInterningTests.cs.meta b/src/MessagePack.UnityClient/Assets/Scripts/Tests/ShareTests/StringInterningTests.cs.meta new file mode 100644 index 000000000..a6117b9c2 --- /dev/null +++ b/src/MessagePack.UnityClient/Assets/Scripts/Tests/ShareTests/StringInterningTests.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 593d09755237d984a95626a65167c3a7 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/src/MessagePack.UnityClient/Assets/Scripts/Tests/ShareTests/TestUtilities.cs b/src/MessagePack.UnityClient/Assets/Scripts/Tests/ShareTests/TestUtilities.cs index 0a4bf9fbf..abc85b0fb 100644 --- a/src/MessagePack.UnityClient/Assets/Scripts/Tests/ShareTests/TestUtilities.cs +++ b/src/MessagePack.UnityClient/Assets/Scripts/Tests/ShareTests/TestUtilities.cs @@ -15,6 +15,8 @@ internal static class TestUtilities /// Gets a value indicating whether the mono runtime is executing this code. /// internal static bool IsRunningOnMono => Type.GetType("Mono.Runtime") != null; + + internal static string ToHex(byte[] buffer) => BitConverter.ToString(buffer).Replace("-", string.Empty).ToLowerInvariant(); } public class NullTestOutputHelper : ITestOutputHelper diff --git a/src/MessagePack.UnityClient/Assets/Scripts/Tests/Shims/XUnit.cs b/src/MessagePack.UnityClient/Assets/Scripts/Tests/Shims/XUnit.cs index 86efef462..f1eee2694 100644 --- a/src/MessagePack.UnityClient/Assets/Scripts/Tests/Shims/XUnit.cs +++ b/src/MessagePack.UnityClient/Assets/Scripts/Tests/Shims/XUnit.cs @@ -87,6 +87,19 @@ public static void Null(object expected) NUnit.Framework.Assert.IsNull(expected); } + public static void Empty(System.Collections.IEnumerable enumerable) + { + Assert.False(enumerable.GetEnumerator().MoveNext()); + } + + public static void All(IEnumerable collection, Action predicate) + { + foreach (T item in collection) + { + predicate(item); + } + } + public static T IsType(object o) { NUnit.Framework.Assert.AreEqual(typeof(T), o.GetType()); @@ -117,6 +130,11 @@ public static void Same(object expected, object actual) { NUnit.Framework.Assert.AreSame(expected, actual); } + + public static void NotSame(object expected, object actual) + { + NUnit.Framework.Assert.AreNotSame(expected, actual); + } } [Serializable] diff --git a/src/MessagePack.UnityClient/Assets/Scripts/Tests/Tests.asmdef b/src/MessagePack.UnityClient/Assets/Scripts/Tests/Tests.asmdef index 9fb3f1719..b02d5a89d 100644 --- a/src/MessagePack.UnityClient/Assets/Scripts/Tests/Tests.asmdef +++ b/src/MessagePack.UnityClient/Assets/Scripts/Tests/Tests.asmdef @@ -1,19 +1,30 @@ { "name": "MessagePack.Tests", + "rootNamespace": "", "references": [ "MessagePack", "MessagePack.Annotations", - "RuntimeUnitTestToolkit" - ], - "optionalUnityReferences": [ - "TestAssemblies" + "RuntimeUnitTestToolkit", + "UnityEngine.TestRunner", + "UnityEditor.TestRunner" ], "includePlatforms": [], "excludePlatforms": [], "allowUnsafeCode": true, - "overrideReferences": false, - "precompiledReferences": [], - "autoReferenced": true, - "defineConstraints": [], - "versionDefines": [] + "overrideReferences": true, + "precompiledReferences": [ + "System.Memory.dll", + "System.Buffers.dll", + "System.Threading.Tasks.Extensions.dll", + "System.Runtime.CompilerServices.Unsafe.dll", + "System.Runtime.Extensions.dll", + "nunit.framework.dll", + "MsgPack.dll" + ], + "autoReferenced": false, + "defineConstraints": [ + "UNITY_INCLUDE_TESTS" + ], + "versionDefines": [], + "noEngineReferences": false } \ No newline at end of file diff --git a/src/MessagePack.UnityClient/copy_assets.bat b/src/MessagePack.UnityClient/copy_assets.bat index bb7232df3..c2b03f0e0 100644 --- a/src/MessagePack.UnityClient/copy_assets.bat +++ b/src/MessagePack.UnityClient/copy_assets.bat @@ -11,6 +11,7 @@ echo F | xcopy "..\..\bin\MessagePack\release\netstandard2.0\publish\System.Buffers.dll" ".\Assets\Plugins\System.Buffers.dll" /Y /I echo F | xcopy "..\..\bin\MessagePack\release\netstandard2.0\publish\System.Memory.dll" ".\Assets\Plugins\System.Memory.dll" /Y /I echo F | xcopy "..\..\bin\MessagePack\release\netstandard2.0\publish\System.Runtime.CompilerServices.Unsafe.dll" ".\Assets\Plugins\System.Runtime.CompilerServices.Unsafe.dll" /Y /I +echo F | xcopy "..\..\bin\MessagePack\release\netstandard2.0\publish\Microsoft.NET.StringTools.dll" ".\Assets\Plugins\Microsoft.NET.StringTools.dll" /Y /I echo F | xcopy "..\..\bin\MessagePack\release\netstandard2.0\publish\System.Threading.Tasks.Extensions.dll" ".\Assets\Plugins\System.Threading.Tasks.Extensions.dll" /Y /I @popd diff --git a/src/MessagePack.UnityClient/copy_assets.sh b/src/MessagePack.UnityClient/copy_assets.sh index 9912ab972..7743fd666 100755 --- a/src/MessagePack.UnityClient/copy_assets.sh +++ b/src/MessagePack.UnityClient/copy_assets.sh @@ -21,4 +21,5 @@ fi cp ${SCRIPT_DIR}/../../bin/MessagePack/${BUILDCONFIGURATION}/netstandard2.0/publish/System.Buffers.dll ${SCRIPT_DIR}/Assets/Plugins/System.Buffers.dll cp ${SCRIPT_DIR}/../../bin/MessagePack/${BUILDCONFIGURATION}/netstandard2.0/publish/System.Memory.dll ${SCRIPT_DIR}/Assets/Plugins/System.Memory.dll cp ${SCRIPT_DIR}/../../bin/MessagePack/${BUILDCONFIGURATION}/netstandard2.0/publish/System.Runtime.CompilerServices.Unsafe.dll ${SCRIPT_DIR}/Assets/Plugins/System.Runtime.CompilerServices.Unsafe.dll +cp ${SCRIPT_DIR}/../../bin/MessagePack/${BUILDCONFIGURATION}/netstandard2.0/publish/Microsoft.NET.StringTools.dll ${SCRIPT_DIR}/Assets/Plugins/Microsoft.NET.StringTools.dll cp ${SCRIPT_DIR}/../../bin/MessagePack/${BUILDCONFIGURATION}/netstandard2.0/publish/System.Threading.Tasks.Extensions.dll ${SCRIPT_DIR}/Assets/Plugins/System.Threading.Tasks.Extensions.dll diff --git a/src/MessagePack/MessagePack.csproj b/src/MessagePack/MessagePack.csproj index f0d53003f..801ab7de1 100644 --- a/src/MessagePack/MessagePack.csproj +++ b/src/MessagePack/MessagePack.csproj @@ -1,7 +1,7 @@  - netstandard2.0;netcoreapp2.1;netcoreapp3.1 + netstandard2.0;netcoreapp3.1;net6.0 $(NoWarn);CS0649 True $(DefineConstants);SPAN_BUILTIN @@ -28,21 +28,20 @@ - - + + - + + - - - - - - - - + + + + + + diff --git a/src/MessagePack/MessagePackStreamReader.Arrays.cs b/src/MessagePack/MessagePackStreamReader.Arrays.cs index 2735e27ee..c44095b6b 100644 --- a/src/MessagePack/MessagePackStreamReader.Arrays.cs +++ b/src/MessagePack/MessagePackStreamReader.Arrays.cs @@ -8,12 +8,38 @@ using System.Runtime.CompilerServices; using System.Threading; using System.Threading.Tasks; -using Nerdbank.Streams; namespace MessagePack { public partial class MessagePackStreamReader : IDisposable { + /// + /// Reads the next messagepack array header. + /// + /// A cancellation token. + /// + /// A task whose result is the length of the next array from the stream. + /// + /// + /// Any extra bytes read (between the last complete message and the end of the stream) will be available via the property. + /// + public async ValueTask ReadArrayHeaderAsync(CancellationToken cancellationToken) + { + this.RecycleLastMessage(); + + cancellationToken.ThrowIfCancellationRequested(); + int count; + while (!this.TryReadArrayHeader(out count)) + { + if (!await this.TryReadMoreDataAsync(cancellationToken).ConfigureAwait(false)) + { + throw new EndOfStreamException("The stream ended before a map header could be found."); + } + } + + return count; + } + /// /// Reads the next messagepack array and produces each element individually. /// diff --git a/src/MessagePack/MessagePackStreamReader.Maps.cs b/src/MessagePack/MessagePackStreamReader.Maps.cs new file mode 100644 index 000000000..7fa4f28d3 --- /dev/null +++ b/src/MessagePack/MessagePackStreamReader.Maps.cs @@ -0,0 +1,62 @@ +// Copyright (c) All contributors. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +using System; +using System.IO; +using System.Threading; +using System.Threading.Tasks; + +namespace MessagePack +{ + public partial class MessagePackStreamReader : IDisposable + { + /// + /// Reads the next messagepack map header. + /// + /// A cancellation token. + /// + /// A task whose result is the size of the next map from the stream. + /// + /// + /// Any extra bytes read (between the last complete message and the end of the stream) will be available via the property. + /// + public async ValueTask ReadMapHeaderAsync(CancellationToken cancellationToken) + { + this.RecycleLastMessage(); + + cancellationToken.ThrowIfCancellationRequested(); + int count; + while (!this.TryReadMapHeader(out count)) + { + if (!await this.TryReadMoreDataAsync(cancellationToken).ConfigureAwait(false)) + { + throw new EndOfStreamException("The stream ended before a map header could be found."); + } + } + + return count; + } + + /// + /// Reads a map header from if there are enough bytes to do so. + /// + /// Receives the size of the map, if its header could be read. + /// true if the map header was found and complete; false if there were insufficient bytes to read the header. + /// Thrown if the next msgpack structure is not a map header. + private bool TryReadMapHeader(out int count) + { + if (this.ReadData.Length > 0) + { + var reader = new MessagePackReader(this.ReadData); + if (reader.TryReadMapHeader(out count)) + { + this.endOfLastMessage = reader.Position; + return true; + } + } + + count = 0; + return false; + } + } +} diff --git a/src/MessagePack/PublicAPI.Unshipped.txt b/src/MessagePack/PublicAPI.Unshipped.txt deleted file mode 100644 index d31186945..000000000 --- a/src/MessagePack/PublicAPI.Unshipped.txt +++ /dev/null @@ -1,127 +0,0 @@ -MessagePack.Formatters.ByteMemoryFormatter -MessagePack.Formatters.ByteMemoryFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> System.Memory -MessagePack.Formatters.ByteMemoryFormatter.Serialize(ref MessagePack.MessagePackWriter writer, System.Memory value, MessagePack.MessagePackSerializerOptions options) -> void -MessagePack.Formatters.ByteReadOnlyMemoryFormatter -MessagePack.Formatters.ByteReadOnlyMemoryFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> System.ReadOnlyMemory -MessagePack.Formatters.ByteReadOnlyMemoryFormatter.Serialize(ref MessagePack.MessagePackWriter writer, System.ReadOnlyMemory value, MessagePack.MessagePackSerializerOptions options) -> void -MessagePack.Formatters.ByteReadOnlySequenceFormatter -MessagePack.Formatters.ByteReadOnlySequenceFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> System.Buffers.ReadOnlySequence -MessagePack.Formatters.ByteReadOnlySequenceFormatter.Serialize(ref MessagePack.MessagePackWriter writer, System.Buffers.ReadOnlySequence value, MessagePack.MessagePackSerializerOptions options) -> void -MessagePack.Formatters.ExpandoObjectFormatter -MessagePack.Formatters.ExpandoObjectFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> System.Dynamic.ExpandoObject -MessagePack.Formatters.ExpandoObjectFormatter.Serialize(ref MessagePack.MessagePackWriter writer, System.Dynamic.ExpandoObject value, MessagePack.MessagePackSerializerOptions options) -> void -MessagePack.Formatters.ForceTypelessFormatter -MessagePack.Formatters.ForceTypelessFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> T -MessagePack.Formatters.ForceTypelessFormatter.ForceTypelessFormatter() -> void -MessagePack.Formatters.ForceTypelessFormatter.Serialize(ref MessagePack.MessagePackWriter writer, T value, MessagePack.MessagePackSerializerOptions options) -> void -MessagePack.Formatters.MemoryFormatter -MessagePack.Formatters.MemoryFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> System.Memory -MessagePack.Formatters.MemoryFormatter.MemoryFormatter() -> void -MessagePack.Formatters.MemoryFormatter.Serialize(ref MessagePack.MessagePackWriter writer, System.Memory value, MessagePack.MessagePackSerializerOptions options) -> void -MessagePack.Formatters.NonGenericInterfaceCollectionFormatter -MessagePack.Formatters.NonGenericInterfaceCollectionFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> System.Collections.ICollection -MessagePack.Formatters.NonGenericInterfaceCollectionFormatter.Serialize(ref MessagePack.MessagePackWriter writer, System.Collections.ICollection value, MessagePack.MessagePackSerializerOptions options) -> void -MessagePack.Formatters.NonGenericInterfaceEnumerableFormatter -MessagePack.Formatters.NonGenericInterfaceEnumerableFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> System.Collections.IEnumerable -MessagePack.Formatters.NonGenericInterfaceEnumerableFormatter.Serialize(ref MessagePack.MessagePackWriter writer, System.Collections.IEnumerable value, MessagePack.MessagePackSerializerOptions options) -> void -MessagePack.Formatters.PrimitiveObjectFormatter.PrimitiveObjectFormatter() -> void -MessagePack.Formatters.ReadOnlyMemoryFormatter -MessagePack.Formatters.ReadOnlyMemoryFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> System.ReadOnlyMemory -MessagePack.Formatters.ReadOnlyMemoryFormatter.ReadOnlyMemoryFormatter() -> void -MessagePack.Formatters.ReadOnlyMemoryFormatter.Serialize(ref MessagePack.MessagePackWriter writer, System.ReadOnlyMemory value, MessagePack.MessagePackSerializerOptions options) -> void -MessagePack.Formatters.ReadOnlySequenceFormatter -MessagePack.Formatters.ReadOnlySequenceFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> System.Buffers.ReadOnlySequence -MessagePack.Formatters.ReadOnlySequenceFormatter.ReadOnlySequenceFormatter() -> void -MessagePack.Formatters.ReadOnlySequenceFormatter.Serialize(ref MessagePack.MessagePackWriter writer, System.Buffers.ReadOnlySequence value, MessagePack.MessagePackSerializerOptions options) -> void -MessagePack.Formatters.TypeFormatter -MessagePack.Formatters.TypeFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> T -MessagePack.Formatters.TypeFormatter.Serialize(ref MessagePack.MessagePackWriter writer, T value, MessagePack.MessagePackSerializerOptions options) -> void -MessagePack.Formatters.TypelessFormatter.TypelessFormatter() -> void -MessagePack.ImmutableCollection.ImmutableArrayFormatter -MessagePack.ImmutableCollection.ImmutableArrayFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> System.Collections.Immutable.ImmutableArray -MessagePack.ImmutableCollection.ImmutableArrayFormatter.ImmutableArrayFormatter() -> void -MessagePack.ImmutableCollection.ImmutableArrayFormatter.Serialize(ref MessagePack.MessagePackWriter writer, System.Collections.Immutable.ImmutableArray value, MessagePack.MessagePackSerializerOptions options) -> void -MessagePack.ImmutableCollection.ImmutableCollectionResolver -MessagePack.ImmutableCollection.ImmutableCollectionResolver.GetFormatter() -> MessagePack.Formatters.IMessagePackFormatter -MessagePack.ImmutableCollection.ImmutableDictionaryFormatter -MessagePack.ImmutableCollection.ImmutableDictionaryFormatter.ImmutableDictionaryFormatter() -> void -MessagePack.ImmutableCollection.ImmutableHashSetFormatter -MessagePack.ImmutableCollection.ImmutableHashSetFormatter.ImmutableHashSetFormatter() -> void -MessagePack.ImmutableCollection.ImmutableListFormatter -MessagePack.ImmutableCollection.ImmutableListFormatter.ImmutableListFormatter() -> void -MessagePack.ImmutableCollection.ImmutableQueueBuilder -MessagePack.ImmutableCollection.ImmutableQueueBuilder.Add(T value) -> void -MessagePack.ImmutableCollection.ImmutableQueueBuilder.ImmutableQueueBuilder() -> void -MessagePack.ImmutableCollection.ImmutableQueueBuilder.Q.get -> System.Collections.Immutable.ImmutableQueue -MessagePack.ImmutableCollection.ImmutableQueueBuilder.Q.set -> void -MessagePack.ImmutableCollection.ImmutableQueueFormatter -MessagePack.ImmutableCollection.ImmutableQueueFormatter.ImmutableQueueFormatter() -> void -MessagePack.ImmutableCollection.ImmutableSortedDictionaryFormatter -MessagePack.ImmutableCollection.ImmutableSortedDictionaryFormatter.ImmutableSortedDictionaryFormatter() -> void -MessagePack.ImmutableCollection.ImmutableSortedSetFormatter -MessagePack.ImmutableCollection.ImmutableSortedSetFormatter.ImmutableSortedSetFormatter() -> void -MessagePack.ImmutableCollection.ImmutableStackFormatter -MessagePack.ImmutableCollection.ImmutableStackFormatter.ImmutableStackFormatter() -> void -MessagePack.ImmutableCollection.InterfaceImmutableDictionaryFormatter -MessagePack.ImmutableCollection.InterfaceImmutableDictionaryFormatter.InterfaceImmutableDictionaryFormatter() -> void -MessagePack.ImmutableCollection.InterfaceImmutableListFormatter -MessagePack.ImmutableCollection.InterfaceImmutableListFormatter.InterfaceImmutableListFormatter() -> void -MessagePack.ImmutableCollection.InterfaceImmutableQueueFormatter -MessagePack.ImmutableCollection.InterfaceImmutableQueueFormatter.InterfaceImmutableQueueFormatter() -> void -MessagePack.ImmutableCollection.InterfaceImmutableSetFormatter -MessagePack.ImmutableCollection.InterfaceImmutableSetFormatter.InterfaceImmutableSetFormatter() -> void -MessagePack.ImmutableCollection.InterfaceImmutableStackFormatter -MessagePack.ImmutableCollection.InterfaceImmutableStackFormatter.InterfaceImmutableStackFormatter() -> void -MessagePack.Resolvers.ExpandoObjectResolver -override MessagePack.ImmutableCollection.ImmutableDictionaryFormatter.Add(System.Collections.Immutable.ImmutableDictionary.Builder collection, int index, TKey key, TValue value, MessagePack.MessagePackSerializerOptions options) -> void -override MessagePack.ImmutableCollection.ImmutableDictionaryFormatter.Complete(System.Collections.Immutable.ImmutableDictionary.Builder intermediateCollection) -> System.Collections.Immutable.ImmutableDictionary -override MessagePack.ImmutableCollection.ImmutableDictionaryFormatter.Create(int count, MessagePack.MessagePackSerializerOptions options) -> System.Collections.Immutable.ImmutableDictionary.Builder -override MessagePack.ImmutableCollection.ImmutableDictionaryFormatter.GetSourceEnumerator(System.Collections.Immutable.ImmutableDictionary source) -> System.Collections.Immutable.ImmutableDictionary.Enumerator -override MessagePack.ImmutableCollection.ImmutableHashSetFormatter.Add(System.Collections.Immutable.ImmutableHashSet.Builder collection, int index, T value, MessagePack.MessagePackSerializerOptions options) -> void -override MessagePack.ImmutableCollection.ImmutableHashSetFormatter.Complete(System.Collections.Immutable.ImmutableHashSet.Builder intermediateCollection) -> System.Collections.Immutable.ImmutableHashSet -override MessagePack.ImmutableCollection.ImmutableHashSetFormatter.Create(int count, MessagePack.MessagePackSerializerOptions options) -> System.Collections.Immutable.ImmutableHashSet.Builder -override MessagePack.ImmutableCollection.ImmutableHashSetFormatter.GetSourceEnumerator(System.Collections.Immutable.ImmutableHashSet source) -> System.Collections.Immutable.ImmutableHashSet.Enumerator -override MessagePack.ImmutableCollection.ImmutableListFormatter.Add(System.Collections.Immutable.ImmutableList.Builder collection, int index, T value, MessagePack.MessagePackSerializerOptions options) -> void -override MessagePack.ImmutableCollection.ImmutableListFormatter.Complete(System.Collections.Immutable.ImmutableList.Builder intermediateCollection) -> System.Collections.Immutable.ImmutableList -override MessagePack.ImmutableCollection.ImmutableListFormatter.Create(int count, MessagePack.MessagePackSerializerOptions options) -> System.Collections.Immutable.ImmutableList.Builder -override MessagePack.ImmutableCollection.ImmutableListFormatter.GetSourceEnumerator(System.Collections.Immutable.ImmutableList source) -> System.Collections.Immutable.ImmutableList.Enumerator -override MessagePack.ImmutableCollection.ImmutableQueueFormatter.Add(MessagePack.ImmutableCollection.ImmutableQueueBuilder collection, int index, T value, MessagePack.MessagePackSerializerOptions options) -> void -override MessagePack.ImmutableCollection.ImmutableQueueFormatter.Complete(MessagePack.ImmutableCollection.ImmutableQueueBuilder intermediateCollection) -> System.Collections.Immutable.ImmutableQueue -override MessagePack.ImmutableCollection.ImmutableQueueFormatter.Create(int count, MessagePack.MessagePackSerializerOptions options) -> MessagePack.ImmutableCollection.ImmutableQueueBuilder -override MessagePack.ImmutableCollection.ImmutableSortedDictionaryFormatter.Add(System.Collections.Immutable.ImmutableSortedDictionary.Builder collection, int index, TKey key, TValue value, MessagePack.MessagePackSerializerOptions options) -> void -override MessagePack.ImmutableCollection.ImmutableSortedDictionaryFormatter.Complete(System.Collections.Immutable.ImmutableSortedDictionary.Builder intermediateCollection) -> System.Collections.Immutable.ImmutableSortedDictionary -override MessagePack.ImmutableCollection.ImmutableSortedDictionaryFormatter.Create(int count, MessagePack.MessagePackSerializerOptions options) -> System.Collections.Immutable.ImmutableSortedDictionary.Builder -override MessagePack.ImmutableCollection.ImmutableSortedDictionaryFormatter.GetSourceEnumerator(System.Collections.Immutable.ImmutableSortedDictionary source) -> System.Collections.Immutable.ImmutableSortedDictionary.Enumerator -override MessagePack.ImmutableCollection.ImmutableSortedSetFormatter.Add(System.Collections.Immutable.ImmutableSortedSet.Builder collection, int index, T value, MessagePack.MessagePackSerializerOptions options) -> void -override MessagePack.ImmutableCollection.ImmutableSortedSetFormatter.Complete(System.Collections.Immutable.ImmutableSortedSet.Builder intermediateCollection) -> System.Collections.Immutable.ImmutableSortedSet -override MessagePack.ImmutableCollection.ImmutableSortedSetFormatter.Create(int count, MessagePack.MessagePackSerializerOptions options) -> System.Collections.Immutable.ImmutableSortedSet.Builder -override MessagePack.ImmutableCollection.ImmutableSortedSetFormatter.GetSourceEnumerator(System.Collections.Immutable.ImmutableSortedSet source) -> System.Collections.Immutable.ImmutableSortedSet.Enumerator -override MessagePack.ImmutableCollection.ImmutableStackFormatter.Add(T[] collection, int index, T value, MessagePack.MessagePackSerializerOptions options) -> void -override MessagePack.ImmutableCollection.ImmutableStackFormatter.Complete(T[] intermediateCollection) -> System.Collections.Immutable.ImmutableStack -override MessagePack.ImmutableCollection.ImmutableStackFormatter.Create(int count, MessagePack.MessagePackSerializerOptions options) -> T[] -override MessagePack.ImmutableCollection.InterfaceImmutableDictionaryFormatter.Add(System.Collections.Immutable.ImmutableDictionary.Builder collection, int index, TKey key, TValue value, MessagePack.MessagePackSerializerOptions options) -> void -override MessagePack.ImmutableCollection.InterfaceImmutableDictionaryFormatter.Complete(System.Collections.Immutable.ImmutableDictionary.Builder intermediateCollection) -> System.Collections.Immutable.IImmutableDictionary -override MessagePack.ImmutableCollection.InterfaceImmutableDictionaryFormatter.Create(int count, MessagePack.MessagePackSerializerOptions options) -> System.Collections.Immutable.ImmutableDictionary.Builder -override MessagePack.ImmutableCollection.InterfaceImmutableListFormatter.Add(System.Collections.Immutable.ImmutableList.Builder collection, int index, T value, MessagePack.MessagePackSerializerOptions options) -> void -override MessagePack.ImmutableCollection.InterfaceImmutableListFormatter.Complete(System.Collections.Immutable.ImmutableList.Builder intermediateCollection) -> System.Collections.Immutable.IImmutableList -override MessagePack.ImmutableCollection.InterfaceImmutableListFormatter.Create(int count, MessagePack.MessagePackSerializerOptions options) -> System.Collections.Immutable.ImmutableList.Builder -override MessagePack.ImmutableCollection.InterfaceImmutableQueueFormatter.Add(MessagePack.ImmutableCollection.ImmutableQueueBuilder collection, int index, T value, MessagePack.MessagePackSerializerOptions options) -> void -override MessagePack.ImmutableCollection.InterfaceImmutableQueueFormatter.Complete(MessagePack.ImmutableCollection.ImmutableQueueBuilder intermediateCollection) -> System.Collections.Immutable.IImmutableQueue -override MessagePack.ImmutableCollection.InterfaceImmutableQueueFormatter.Create(int count, MessagePack.MessagePackSerializerOptions options) -> MessagePack.ImmutableCollection.ImmutableQueueBuilder -override MessagePack.ImmutableCollection.InterfaceImmutableSetFormatter.Add(System.Collections.Immutable.ImmutableHashSet.Builder collection, int index, T value, MessagePack.MessagePackSerializerOptions options) -> void -override MessagePack.ImmutableCollection.InterfaceImmutableSetFormatter.Complete(System.Collections.Immutable.ImmutableHashSet.Builder intermediateCollection) -> System.Collections.Immutable.IImmutableSet -override MessagePack.ImmutableCollection.InterfaceImmutableSetFormatter.Create(int count, MessagePack.MessagePackSerializerOptions options) -> System.Collections.Immutable.ImmutableHashSet.Builder -override MessagePack.ImmutableCollection.InterfaceImmutableStackFormatter.Add(T[] collection, int index, T value, MessagePack.MessagePackSerializerOptions options) -> void -override MessagePack.ImmutableCollection.InterfaceImmutableStackFormatter.Complete(T[] intermediateCollection) -> System.Collections.Immutable.IImmutableStack -override MessagePack.ImmutableCollection.InterfaceImmutableStackFormatter.Create(int count, MessagePack.MessagePackSerializerOptions options) -> T[] -static readonly MessagePack.Formatters.ByteMemoryFormatter.Instance -> MessagePack.Formatters.ByteMemoryFormatter -static readonly MessagePack.Formatters.ByteReadOnlyMemoryFormatter.Instance -> MessagePack.Formatters.ByteReadOnlyMemoryFormatter -static readonly MessagePack.Formatters.ByteReadOnlySequenceFormatter.Instance -> MessagePack.Formatters.ByteReadOnlySequenceFormatter -static readonly MessagePack.Formatters.ExpandoObjectFormatter.Instance -> MessagePack.Formatters.IMessagePackFormatter -static readonly MessagePack.Formatters.NonGenericInterfaceCollectionFormatter.Instance -> MessagePack.Formatters.IMessagePackFormatter -static readonly MessagePack.Formatters.NonGenericInterfaceEnumerableFormatter.Instance -> MessagePack.Formatters.IMessagePackFormatter -static readonly MessagePack.Formatters.TypeFormatter.Instance -> MessagePack.Formatters.IMessagePackFormatter -static readonly MessagePack.ImmutableCollection.ImmutableCollectionResolver.Instance -> MessagePack.ImmutableCollection.ImmutableCollectionResolver -static readonly MessagePack.Resolvers.ExpandoObjectResolver.Instance -> MessagePack.IFormatterResolver -static readonly MessagePack.Resolvers.ExpandoObjectResolver.Options -> MessagePack.MessagePackSerializerOptions -virtual MessagePack.Formatters.PrimitiveObjectFormatter.DeserializeMap(ref MessagePack.MessagePackReader reader, int length, MessagePack.MessagePackSerializerOptions options) -> object diff --git a/src/MessagePack/net5.0/PublicAPI.Shipped.txt b/src/MessagePack/net5.0/PublicAPI.Shipped.txt new file mode 100644 index 000000000..b0a1a3dc2 --- /dev/null +++ b/src/MessagePack/net5.0/PublicAPI.Shipped.txt @@ -0,0 +1,1180 @@ +MessagePack.ExtensionHeader +MessagePack.ExtensionHeader.ExtensionHeader(sbyte typeCode, int length) -> void +MessagePack.ExtensionHeader.ExtensionHeader(sbyte typeCode, uint length) -> void +MessagePack.ExtensionHeader.Length.get -> uint +MessagePack.ExtensionHeader.TypeCode.get -> sbyte +MessagePack.ExtensionResult +MessagePack.ExtensionResult.Data.get -> System.Buffers.ReadOnlySequence +MessagePack.ExtensionResult.ExtensionResult(sbyte typeCode, System.Buffers.ReadOnlySequence data) -> void +MessagePack.ExtensionResult.ExtensionResult(sbyte typeCode, System.Memory data) -> void +MessagePack.ExtensionResult.Header.get -> MessagePack.ExtensionHeader +MessagePack.ExtensionResult.TypeCode.get -> sbyte +MessagePack.FormatterNotRegisteredException +MessagePack.FormatterNotRegisteredException.FormatterNotRegisteredException(string message) -> void +MessagePack.FormatterResolverExtensions +MessagePack.Formatters.ArrayFormatter +MessagePack.Formatters.ArrayFormatter.ArrayFormatter() -> void +MessagePack.Formatters.ArrayFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> T[] +MessagePack.Formatters.ArrayFormatter.Serialize(ref MessagePack.MessagePackWriter writer, T[] value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.ArraySegmentFormatter +MessagePack.Formatters.ArraySegmentFormatter.ArraySegmentFormatter() -> void +MessagePack.Formatters.ArraySegmentFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> System.ArraySegment +MessagePack.Formatters.ArraySegmentFormatter.Serialize(ref MessagePack.MessagePackWriter writer, System.ArraySegment value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.BigIntegerFormatter +MessagePack.Formatters.BigIntegerFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> System.Numerics.BigInteger +MessagePack.Formatters.BigIntegerFormatter.Serialize(ref MessagePack.MessagePackWriter writer, System.Numerics.BigInteger value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.BitArrayFormatter +MessagePack.Formatters.BitArrayFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> System.Collections.BitArray +MessagePack.Formatters.BitArrayFormatter.Serialize(ref MessagePack.MessagePackWriter writer, System.Collections.BitArray value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.BooleanArrayFormatter +MessagePack.Formatters.BooleanArrayFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> bool[] +MessagePack.Formatters.BooleanArrayFormatter.Serialize(ref MessagePack.MessagePackWriter writer, bool[] value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.BooleanFormatter +MessagePack.Formatters.BooleanFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> bool +MessagePack.Formatters.BooleanFormatter.Serialize(ref MessagePack.MessagePackWriter writer, bool value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.ByteArrayFormatter +MessagePack.Formatters.ByteArrayFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> byte[] +MessagePack.Formatters.ByteArrayFormatter.Serialize(ref MessagePack.MessagePackWriter writer, byte[] value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.ByteArraySegmentFormatter +MessagePack.Formatters.ByteArraySegmentFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> System.ArraySegment +MessagePack.Formatters.ByteArraySegmentFormatter.Serialize(ref MessagePack.MessagePackWriter writer, System.ArraySegment value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.ByteFormatter +MessagePack.Formatters.ByteFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> byte +MessagePack.Formatters.ByteFormatter.Serialize(ref MessagePack.MessagePackWriter writer, byte value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.CharArrayFormatter +MessagePack.Formatters.CharArrayFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> char[] +MessagePack.Formatters.CharArrayFormatter.Serialize(ref MessagePack.MessagePackWriter writer, char[] value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.CharFormatter +MessagePack.Formatters.CharFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> char +MessagePack.Formatters.CharFormatter.Serialize(ref MessagePack.MessagePackWriter writer, char value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.CollectionFormatterBase +MessagePack.Formatters.CollectionFormatterBase.CollectionFormatterBase() -> void +MessagePack.Formatters.CollectionFormatterBase +MessagePack.Formatters.CollectionFormatterBase.CollectionFormatterBase() -> void +MessagePack.Formatters.CollectionFormatterBase +MessagePack.Formatters.CollectionFormatterBase.CollectionFormatterBase() -> void +MessagePack.Formatters.CollectionFormatterBase.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> TCollection +MessagePack.Formatters.CollectionFormatterBase.Serialize(ref MessagePack.MessagePackWriter writer, TCollection value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.ComplexFormatter +MessagePack.Formatters.ComplexFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> System.Numerics.Complex +MessagePack.Formatters.ComplexFormatter.Serialize(ref MessagePack.MessagePackWriter writer, System.Numerics.Complex value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.ConcurrentBagFormatter +MessagePack.Formatters.ConcurrentBagFormatter.ConcurrentBagFormatter() -> void +MessagePack.Formatters.ConcurrentDictionaryFormatter +MessagePack.Formatters.ConcurrentDictionaryFormatter.ConcurrentDictionaryFormatter() -> void +MessagePack.Formatters.ConcurrentQueueFormatter +MessagePack.Formatters.ConcurrentQueueFormatter.ConcurrentQueueFormatter() -> void +MessagePack.Formatters.ConcurrentStackFormatter +MessagePack.Formatters.ConcurrentStackFormatter.ConcurrentStackFormatter() -> void +MessagePack.Formatters.DateTimeArrayFormatter +MessagePack.Formatters.DateTimeArrayFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> System.DateTime[] +MessagePack.Formatters.DateTimeArrayFormatter.Serialize(ref MessagePack.MessagePackWriter writer, System.DateTime[] value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.DateTimeFormatter +MessagePack.Formatters.DateTimeFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> System.DateTime +MessagePack.Formatters.DateTimeFormatter.Serialize(ref MessagePack.MessagePackWriter writer, System.DateTime value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.DateTimeOffsetFormatter +MessagePack.Formatters.DateTimeOffsetFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> System.DateTimeOffset +MessagePack.Formatters.DateTimeOffsetFormatter.Serialize(ref MessagePack.MessagePackWriter writer, System.DateTimeOffset value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.DecimalFormatter +MessagePack.Formatters.DecimalFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> decimal +MessagePack.Formatters.DecimalFormatter.Serialize(ref MessagePack.MessagePackWriter writer, decimal value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.DictionaryFormatter +MessagePack.Formatters.DictionaryFormatter.DictionaryFormatter() -> void +MessagePack.Formatters.DictionaryFormatterBase +MessagePack.Formatters.DictionaryFormatterBase.DictionaryFormatterBase() -> void +MessagePack.Formatters.DictionaryFormatterBase +MessagePack.Formatters.DictionaryFormatterBase.DictionaryFormatterBase() -> void +MessagePack.Formatters.DictionaryFormatterBase +MessagePack.Formatters.DictionaryFormatterBase.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> TDictionary +MessagePack.Formatters.DictionaryFormatterBase.DictionaryFormatterBase() -> void +MessagePack.Formatters.DictionaryFormatterBase.Serialize(ref MessagePack.MessagePackWriter writer, TDictionary value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.DoubleArrayFormatter +MessagePack.Formatters.DoubleArrayFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> double[] +MessagePack.Formatters.DoubleArrayFormatter.Serialize(ref MessagePack.MessagePackWriter writer, double[] value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.DoubleFormatter +MessagePack.Formatters.DoubleFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> double +MessagePack.Formatters.DoubleFormatter.Serialize(ref MessagePack.MessagePackWriter writer, double value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.DynamicObjectTypeFallbackFormatter +MessagePack.Formatters.DynamicObjectTypeFallbackFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> object +MessagePack.Formatters.DynamicObjectTypeFallbackFormatter.Serialize(ref MessagePack.MessagePackWriter writer, object value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.EnumAsStringFormatter +MessagePack.Formatters.EnumAsStringFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> T +MessagePack.Formatters.EnumAsStringFormatter.EnumAsStringFormatter() -> void +MessagePack.Formatters.EnumAsStringFormatter.Serialize(ref MessagePack.MessagePackWriter writer, T value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.ForceByteBlockFormatter +MessagePack.Formatters.ForceByteBlockFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> byte +MessagePack.Formatters.ForceByteBlockFormatter.Serialize(ref MessagePack.MessagePackWriter writer, byte value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.ForceInt16BlockArrayFormatter +MessagePack.Formatters.ForceInt16BlockArrayFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> short[] +MessagePack.Formatters.ForceInt16BlockArrayFormatter.Serialize(ref MessagePack.MessagePackWriter writer, short[] value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.ForceInt16BlockFormatter +MessagePack.Formatters.ForceInt16BlockFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> short +MessagePack.Formatters.ForceInt16BlockFormatter.Serialize(ref MessagePack.MessagePackWriter writer, short value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.ForceInt32BlockArrayFormatter +MessagePack.Formatters.ForceInt32BlockArrayFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> int[] +MessagePack.Formatters.ForceInt32BlockArrayFormatter.Serialize(ref MessagePack.MessagePackWriter writer, int[] value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.ForceInt32BlockFormatter +MessagePack.Formatters.ForceInt32BlockFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> int +MessagePack.Formatters.ForceInt32BlockFormatter.Serialize(ref MessagePack.MessagePackWriter writer, int value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.ForceInt64BlockArrayFormatter +MessagePack.Formatters.ForceInt64BlockArrayFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> long[] +MessagePack.Formatters.ForceInt64BlockArrayFormatter.Serialize(ref MessagePack.MessagePackWriter writer, long[] value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.ForceInt64BlockFormatter +MessagePack.Formatters.ForceInt64BlockFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> long +MessagePack.Formatters.ForceInt64BlockFormatter.Serialize(ref MessagePack.MessagePackWriter writer, long value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.ForceSByteBlockArrayFormatter +MessagePack.Formatters.ForceSByteBlockArrayFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> sbyte[] +MessagePack.Formatters.ForceSByteBlockArrayFormatter.Serialize(ref MessagePack.MessagePackWriter writer, sbyte[] value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.ForceSByteBlockFormatter +MessagePack.Formatters.ForceSByteBlockFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> sbyte +MessagePack.Formatters.ForceSByteBlockFormatter.Serialize(ref MessagePack.MessagePackWriter writer, sbyte value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.ForceUInt16BlockArrayFormatter +MessagePack.Formatters.ForceUInt16BlockArrayFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> ushort[] +MessagePack.Formatters.ForceUInt16BlockArrayFormatter.Serialize(ref MessagePack.MessagePackWriter writer, ushort[] value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.ForceUInt16BlockFormatter +MessagePack.Formatters.ForceUInt16BlockFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> ushort +MessagePack.Formatters.ForceUInt16BlockFormatter.Serialize(ref MessagePack.MessagePackWriter writer, ushort value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.ForceUInt32BlockArrayFormatter +MessagePack.Formatters.ForceUInt32BlockArrayFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> uint[] +MessagePack.Formatters.ForceUInt32BlockArrayFormatter.Serialize(ref MessagePack.MessagePackWriter writer, uint[] value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.ForceUInt32BlockFormatter +MessagePack.Formatters.ForceUInt32BlockFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> uint +MessagePack.Formatters.ForceUInt32BlockFormatter.Serialize(ref MessagePack.MessagePackWriter writer, uint value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.ForceUInt64BlockArrayFormatter +MessagePack.Formatters.ForceUInt64BlockArrayFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> ulong[] +MessagePack.Formatters.ForceUInt64BlockArrayFormatter.Serialize(ref MessagePack.MessagePackWriter writer, ulong[] value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.ForceUInt64BlockFormatter +MessagePack.Formatters.ForceUInt64BlockFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> ulong +MessagePack.Formatters.ForceUInt64BlockFormatter.Serialize(ref MessagePack.MessagePackWriter writer, ulong value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.FourDimensionalArrayFormatter +MessagePack.Formatters.FourDimensionalArrayFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> T[,,,] +MessagePack.Formatters.FourDimensionalArrayFormatter.FourDimensionalArrayFormatter() -> void +MessagePack.Formatters.FourDimensionalArrayFormatter.Serialize(ref MessagePack.MessagePackWriter writer, T[,,,] value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.GenericCollectionFormatter +MessagePack.Formatters.GenericCollectionFormatter.GenericCollectionFormatter() -> void +MessagePack.Formatters.GenericDictionaryFormatter +MessagePack.Formatters.GenericDictionaryFormatter.GenericDictionaryFormatter() -> void +MessagePack.Formatters.GenericEnumFormatter +MessagePack.Formatters.GenericEnumFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> T +MessagePack.Formatters.GenericEnumFormatter.GenericEnumFormatter() -> void +MessagePack.Formatters.GenericEnumFormatter.Serialize(ref MessagePack.MessagePackWriter writer, T value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.GuidFormatter +MessagePack.Formatters.GuidFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> System.Guid +MessagePack.Formatters.GuidFormatter.Serialize(ref MessagePack.MessagePackWriter writer, System.Guid value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.HashSetFormatter +MessagePack.Formatters.HashSetFormatter.HashSetFormatter() -> void +MessagePack.Formatters.IMessagePackFormatter +MessagePack.Formatters.IMessagePackFormatter +MessagePack.Formatters.IMessagePackFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> T +MessagePack.Formatters.IMessagePackFormatter.Serialize(ref MessagePack.MessagePackWriter writer, T value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.IgnoreFormatter +MessagePack.Formatters.IgnoreFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> T +MessagePack.Formatters.IgnoreFormatter.IgnoreFormatter() -> void +MessagePack.Formatters.IgnoreFormatter.Serialize(ref MessagePack.MessagePackWriter writer, T value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.Int16ArrayFormatter +MessagePack.Formatters.Int16ArrayFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> short[] +MessagePack.Formatters.Int16ArrayFormatter.Serialize(ref MessagePack.MessagePackWriter writer, short[] value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.Int16Formatter +MessagePack.Formatters.Int16Formatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> short +MessagePack.Formatters.Int16Formatter.Serialize(ref MessagePack.MessagePackWriter writer, short value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.Int32ArrayFormatter +MessagePack.Formatters.Int32ArrayFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> int[] +MessagePack.Formatters.Int32ArrayFormatter.Serialize(ref MessagePack.MessagePackWriter writer, int[] value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.Int32Formatter +MessagePack.Formatters.Int32Formatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> int +MessagePack.Formatters.Int32Formatter.Serialize(ref MessagePack.MessagePackWriter writer, int value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.Int64ArrayFormatter +MessagePack.Formatters.Int64ArrayFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> long[] +MessagePack.Formatters.Int64ArrayFormatter.Serialize(ref MessagePack.MessagePackWriter writer, long[] value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.Int64Formatter +MessagePack.Formatters.Int64Formatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> long +MessagePack.Formatters.Int64Formatter.Serialize(ref MessagePack.MessagePackWriter writer, long value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.InterfaceCollectionFormatter +MessagePack.Formatters.InterfaceCollectionFormatter.InterfaceCollectionFormatter() -> void +MessagePack.Formatters.InterfaceDictionaryFormatter +MessagePack.Formatters.InterfaceDictionaryFormatter.InterfaceDictionaryFormatter() -> void +MessagePack.Formatters.InterfaceEnumerableFormatter +MessagePack.Formatters.InterfaceEnumerableFormatter.InterfaceEnumerableFormatter() -> void +MessagePack.Formatters.InterfaceGroupingFormatter +MessagePack.Formatters.InterfaceGroupingFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> System.Linq.IGrouping +MessagePack.Formatters.InterfaceGroupingFormatter.InterfaceGroupingFormatter() -> void +MessagePack.Formatters.InterfaceGroupingFormatter.Serialize(ref MessagePack.MessagePackWriter writer, System.Linq.IGrouping value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.InterfaceListFormatter +MessagePack.Formatters.InterfaceListFormatter.InterfaceListFormatter() -> void +MessagePack.Formatters.InterfaceLookupFormatter +MessagePack.Formatters.InterfaceLookupFormatter.InterfaceLookupFormatter() -> void +MessagePack.Formatters.InterfaceReadOnlyCollectionFormatter +MessagePack.Formatters.InterfaceReadOnlyCollectionFormatter.InterfaceReadOnlyCollectionFormatter() -> void +MessagePack.Formatters.InterfaceReadOnlyDictionaryFormatter +MessagePack.Formatters.InterfaceReadOnlyDictionaryFormatter.InterfaceReadOnlyDictionaryFormatter() -> void +MessagePack.Formatters.InterfaceReadOnlyListFormatter +MessagePack.Formatters.InterfaceReadOnlyListFormatter.InterfaceReadOnlyListFormatter() -> void +MessagePack.Formatters.InterfaceSetFormatter +MessagePack.Formatters.InterfaceSetFormatter.InterfaceSetFormatter() -> void +MessagePack.Formatters.KeyValuePairFormatter +MessagePack.Formatters.KeyValuePairFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> System.Collections.Generic.KeyValuePair +MessagePack.Formatters.KeyValuePairFormatter.KeyValuePairFormatter() -> void +MessagePack.Formatters.KeyValuePairFormatter.Serialize(ref MessagePack.MessagePackWriter writer, System.Collections.Generic.KeyValuePair value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.LazyFormatter +MessagePack.Formatters.LazyFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> System.Lazy +MessagePack.Formatters.LazyFormatter.LazyFormatter() -> void +MessagePack.Formatters.LazyFormatter.Serialize(ref MessagePack.MessagePackWriter writer, System.Lazy value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.LinkedListFormatter +MessagePack.Formatters.LinkedListFormatter.LinkedListFormatter() -> void +MessagePack.Formatters.ListFormatter +MessagePack.Formatters.ListFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> System.Collections.Generic.List +MessagePack.Formatters.ListFormatter.ListFormatter() -> void +MessagePack.Formatters.ListFormatter.Serialize(ref MessagePack.MessagePackWriter writer, System.Collections.Generic.List value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.NativeDateTimeArrayFormatter +MessagePack.Formatters.NativeDateTimeArrayFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> System.DateTime[] +MessagePack.Formatters.NativeDateTimeArrayFormatter.NativeDateTimeArrayFormatter() -> void +MessagePack.Formatters.NativeDateTimeArrayFormatter.Serialize(ref MessagePack.MessagePackWriter writer, System.DateTime[] value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.NativeDateTimeFormatter +MessagePack.Formatters.NativeDateTimeFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> System.DateTime +MessagePack.Formatters.NativeDateTimeFormatter.NativeDateTimeFormatter() -> void +MessagePack.Formatters.NativeDateTimeFormatter.Serialize(ref MessagePack.MessagePackWriter writer, System.DateTime value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.NativeDecimalFormatter +MessagePack.Formatters.NativeDecimalFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> decimal +MessagePack.Formatters.NativeDecimalFormatter.Serialize(ref MessagePack.MessagePackWriter writer, decimal value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.NativeGuidFormatter +MessagePack.Formatters.NativeGuidFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> System.Guid +MessagePack.Formatters.NativeGuidFormatter.Serialize(ref MessagePack.MessagePackWriter writer, System.Guid value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.NilFormatter +MessagePack.Formatters.NilFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> MessagePack.Nil +MessagePack.Formatters.NilFormatter.Serialize(ref MessagePack.MessagePackWriter writer, MessagePack.Nil value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.NonGenericDictionaryFormatter +MessagePack.Formatters.NonGenericDictionaryFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> T +MessagePack.Formatters.NonGenericDictionaryFormatter.NonGenericDictionaryFormatter() -> void +MessagePack.Formatters.NonGenericDictionaryFormatter.Serialize(ref MessagePack.MessagePackWriter writer, T value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.NonGenericInterfaceDictionaryFormatter +MessagePack.Formatters.NonGenericInterfaceDictionaryFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> System.Collections.IDictionary +MessagePack.Formatters.NonGenericInterfaceDictionaryFormatter.Serialize(ref MessagePack.MessagePackWriter writer, System.Collections.IDictionary value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.NonGenericInterfaceListFormatter +MessagePack.Formatters.NonGenericInterfaceListFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> System.Collections.IList +MessagePack.Formatters.NonGenericInterfaceListFormatter.Serialize(ref MessagePack.MessagePackWriter writer, System.Collections.IList value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.NonGenericListFormatter +MessagePack.Formatters.NonGenericListFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> T +MessagePack.Formatters.NonGenericListFormatter.NonGenericListFormatter() -> void +MessagePack.Formatters.NonGenericListFormatter.Serialize(ref MessagePack.MessagePackWriter writer, T value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.NullableBooleanFormatter +MessagePack.Formatters.NullableBooleanFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> bool? +MessagePack.Formatters.NullableBooleanFormatter.Serialize(ref MessagePack.MessagePackWriter writer, bool? value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.NullableByteFormatter +MessagePack.Formatters.NullableByteFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> byte? +MessagePack.Formatters.NullableByteFormatter.Serialize(ref MessagePack.MessagePackWriter writer, byte? value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.NullableCharFormatter +MessagePack.Formatters.NullableCharFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> char? +MessagePack.Formatters.NullableCharFormatter.Serialize(ref MessagePack.MessagePackWriter writer, char? value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.NullableDateTimeFormatter +MessagePack.Formatters.NullableDateTimeFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> System.DateTime? +MessagePack.Formatters.NullableDateTimeFormatter.Serialize(ref MessagePack.MessagePackWriter writer, System.DateTime? value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.NullableDoubleFormatter +MessagePack.Formatters.NullableDoubleFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> double? +MessagePack.Formatters.NullableDoubleFormatter.Serialize(ref MessagePack.MessagePackWriter writer, double? value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.NullableForceByteBlockFormatter +MessagePack.Formatters.NullableForceByteBlockFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> byte? +MessagePack.Formatters.NullableForceByteBlockFormatter.Serialize(ref MessagePack.MessagePackWriter writer, byte? value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.NullableForceInt16BlockFormatter +MessagePack.Formatters.NullableForceInt16BlockFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> short? +MessagePack.Formatters.NullableForceInt16BlockFormatter.Serialize(ref MessagePack.MessagePackWriter writer, short? value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.NullableForceInt32BlockFormatter +MessagePack.Formatters.NullableForceInt32BlockFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> int? +MessagePack.Formatters.NullableForceInt32BlockFormatter.Serialize(ref MessagePack.MessagePackWriter writer, int? value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.NullableForceInt64BlockFormatter +MessagePack.Formatters.NullableForceInt64BlockFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> long? +MessagePack.Formatters.NullableForceInt64BlockFormatter.Serialize(ref MessagePack.MessagePackWriter writer, long? value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.NullableForceSByteBlockFormatter +MessagePack.Formatters.NullableForceSByteBlockFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> sbyte? +MessagePack.Formatters.NullableForceSByteBlockFormatter.Serialize(ref MessagePack.MessagePackWriter writer, sbyte? value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.NullableForceUInt16BlockFormatter +MessagePack.Formatters.NullableForceUInt16BlockFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> ushort? +MessagePack.Formatters.NullableForceUInt16BlockFormatter.Serialize(ref MessagePack.MessagePackWriter writer, ushort? value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.NullableForceUInt32BlockFormatter +MessagePack.Formatters.NullableForceUInt32BlockFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> uint? +MessagePack.Formatters.NullableForceUInt32BlockFormatter.Serialize(ref MessagePack.MessagePackWriter writer, uint? value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.NullableForceUInt64BlockFormatter +MessagePack.Formatters.NullableForceUInt64BlockFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> ulong? +MessagePack.Formatters.NullableForceUInt64BlockFormatter.Serialize(ref MessagePack.MessagePackWriter writer, ulong? value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.NullableFormatter +MessagePack.Formatters.NullableFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> T? +MessagePack.Formatters.NullableFormatter.NullableFormatter() -> void +MessagePack.Formatters.NullableFormatter.Serialize(ref MessagePack.MessagePackWriter writer, T? value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.NullableInt16Formatter +MessagePack.Formatters.NullableInt16Formatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> short? +MessagePack.Formatters.NullableInt16Formatter.Serialize(ref MessagePack.MessagePackWriter writer, short? value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.NullableInt32Formatter +MessagePack.Formatters.NullableInt32Formatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> int? +MessagePack.Formatters.NullableInt32Formatter.Serialize(ref MessagePack.MessagePackWriter writer, int? value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.NullableInt64Formatter +MessagePack.Formatters.NullableInt64Formatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> long? +MessagePack.Formatters.NullableInt64Formatter.Serialize(ref MessagePack.MessagePackWriter writer, long? value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.NullableNilFormatter +MessagePack.Formatters.NullableNilFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> MessagePack.Nil? +MessagePack.Formatters.NullableNilFormatter.Serialize(ref MessagePack.MessagePackWriter writer, MessagePack.Nil? value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.NullableSByteFormatter +MessagePack.Formatters.NullableSByteFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> sbyte? +MessagePack.Formatters.NullableSByteFormatter.Serialize(ref MessagePack.MessagePackWriter writer, sbyte? value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.NullableSingleFormatter +MessagePack.Formatters.NullableSingleFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> float? +MessagePack.Formatters.NullableSingleFormatter.Serialize(ref MessagePack.MessagePackWriter writer, float? value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.NullableStringArrayFormatter +MessagePack.Formatters.NullableStringArrayFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> string[] +MessagePack.Formatters.NullableStringArrayFormatter.Serialize(ref MessagePack.MessagePackWriter writer, string[] value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.NullableStringFormatter +MessagePack.Formatters.NullableStringFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> string +MessagePack.Formatters.NullableStringFormatter.Serialize(ref MessagePack.MessagePackWriter writer, string value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.NullableUInt16Formatter +MessagePack.Formatters.NullableUInt16Formatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> ushort? +MessagePack.Formatters.NullableUInt16Formatter.Serialize(ref MessagePack.MessagePackWriter writer, ushort? value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.NullableUInt32Formatter +MessagePack.Formatters.NullableUInt32Formatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> uint? +MessagePack.Formatters.NullableUInt32Formatter.Serialize(ref MessagePack.MessagePackWriter writer, uint? value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.NullableUInt64Formatter +MessagePack.Formatters.NullableUInt64Formatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> ulong? +MessagePack.Formatters.NullableUInt64Formatter.Serialize(ref MessagePack.MessagePackWriter writer, ulong? value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.ObservableCollectionFormatter +MessagePack.Formatters.ObservableCollectionFormatter.ObservableCollectionFormatter() -> void +MessagePack.Formatters.PrimitiveObjectFormatter +MessagePack.Formatters.PrimitiveObjectFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> object +MessagePack.Formatters.PrimitiveObjectFormatter.Serialize(ref MessagePack.MessagePackWriter writer, object value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.QueueFormatter +MessagePack.Formatters.QueueFormatter.QueueFormatter() -> void +MessagePack.Formatters.ReadOnlyCollectionFormatter +MessagePack.Formatters.ReadOnlyCollectionFormatter.ReadOnlyCollectionFormatter() -> void +MessagePack.Formatters.ReadOnlyDictionaryFormatter +MessagePack.Formatters.ReadOnlyDictionaryFormatter.ReadOnlyDictionaryFormatter() -> void +MessagePack.Formatters.ReadOnlyObservableCollectionFormatter +MessagePack.Formatters.ReadOnlyObservableCollectionFormatter.ReadOnlyObservableCollectionFormatter() -> void +MessagePack.Formatters.SByteArrayFormatter +MessagePack.Formatters.SByteArrayFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> sbyte[] +MessagePack.Formatters.SByteArrayFormatter.Serialize(ref MessagePack.MessagePackWriter writer, sbyte[] value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.SByteFormatter +MessagePack.Formatters.SByteFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> sbyte +MessagePack.Formatters.SByteFormatter.Serialize(ref MessagePack.MessagePackWriter writer, sbyte value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.SingleArrayFormatter +MessagePack.Formatters.SingleArrayFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> float[] +MessagePack.Formatters.SingleArrayFormatter.Serialize(ref MessagePack.MessagePackWriter writer, float[] value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.SingleFormatter +MessagePack.Formatters.SingleFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> float +MessagePack.Formatters.SingleFormatter.Serialize(ref MessagePack.MessagePackWriter writer, float value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.SortedDictionaryFormatter +MessagePack.Formatters.SortedDictionaryFormatter.SortedDictionaryFormatter() -> void +MessagePack.Formatters.SortedListFormatter +MessagePack.Formatters.SortedListFormatter.SortedListFormatter() -> void +MessagePack.Formatters.StackFormatter +MessagePack.Formatters.StackFormatter.StackFormatter() -> void +MessagePack.Formatters.StaticNullableFormatter +MessagePack.Formatters.StaticNullableFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> T? +MessagePack.Formatters.StaticNullableFormatter.Serialize(ref MessagePack.MessagePackWriter writer, T? value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.StaticNullableFormatter.StaticNullableFormatter(MessagePack.Formatters.IMessagePackFormatter underlyingFormatter) -> void +MessagePack.Formatters.StringBuilderFormatter +MessagePack.Formatters.StringBuilderFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> System.Text.StringBuilder +MessagePack.Formatters.StringBuilderFormatter.Serialize(ref MessagePack.MessagePackWriter writer, System.Text.StringBuilder value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.ThreeDimensionalArrayFormatter +MessagePack.Formatters.ThreeDimensionalArrayFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> T[,,] +MessagePack.Formatters.ThreeDimensionalArrayFormatter.Serialize(ref MessagePack.MessagePackWriter writer, T[,,] value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.ThreeDimensionalArrayFormatter.ThreeDimensionalArrayFormatter() -> void +MessagePack.Formatters.TimeSpanFormatter +MessagePack.Formatters.TimeSpanFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> System.TimeSpan +MessagePack.Formatters.TimeSpanFormatter.Serialize(ref MessagePack.MessagePackWriter writer, System.TimeSpan value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.TupleFormatter +MessagePack.Formatters.TupleFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> System.Tuple +MessagePack.Formatters.TupleFormatter.Serialize(ref MessagePack.MessagePackWriter writer, System.Tuple value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.TupleFormatter.TupleFormatter() -> void +MessagePack.Formatters.TupleFormatter +MessagePack.Formatters.TupleFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> System.Tuple +MessagePack.Formatters.TupleFormatter.Serialize(ref MessagePack.MessagePackWriter writer, System.Tuple value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.TupleFormatter.TupleFormatter() -> void +MessagePack.Formatters.TupleFormatter +MessagePack.Formatters.TupleFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> System.Tuple +MessagePack.Formatters.TupleFormatter.Serialize(ref MessagePack.MessagePackWriter writer, System.Tuple value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.TupleFormatter.TupleFormatter() -> void +MessagePack.Formatters.TupleFormatter +MessagePack.Formatters.TupleFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> System.Tuple +MessagePack.Formatters.TupleFormatter.Serialize(ref MessagePack.MessagePackWriter writer, System.Tuple value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.TupleFormatter.TupleFormatter() -> void +MessagePack.Formatters.TupleFormatter +MessagePack.Formatters.TupleFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> System.Tuple +MessagePack.Formatters.TupleFormatter.Serialize(ref MessagePack.MessagePackWriter writer, System.Tuple value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.TupleFormatter.TupleFormatter() -> void +MessagePack.Formatters.TupleFormatter +MessagePack.Formatters.TupleFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> System.Tuple +MessagePack.Formatters.TupleFormatter.Serialize(ref MessagePack.MessagePackWriter writer, System.Tuple value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.TupleFormatter.TupleFormatter() -> void +MessagePack.Formatters.TupleFormatter +MessagePack.Formatters.TupleFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> System.Tuple +MessagePack.Formatters.TupleFormatter.Serialize(ref MessagePack.MessagePackWriter writer, System.Tuple value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.TupleFormatter.TupleFormatter() -> void +MessagePack.Formatters.TupleFormatter +MessagePack.Formatters.TupleFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> System.Tuple +MessagePack.Formatters.TupleFormatter.Serialize(ref MessagePack.MessagePackWriter writer, System.Tuple value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.TupleFormatter.TupleFormatter() -> void +MessagePack.Formatters.TwoDimensionalArrayFormatter +MessagePack.Formatters.TwoDimensionalArrayFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> T[,] +MessagePack.Formatters.TwoDimensionalArrayFormatter.Serialize(ref MessagePack.MessagePackWriter writer, T[,] value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.TwoDimensionalArrayFormatter.TwoDimensionalArrayFormatter() -> void +MessagePack.Formatters.TypelessFormatter +MessagePack.Formatters.TypelessFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> object +MessagePack.Formatters.TypelessFormatter.Serialize(ref MessagePack.MessagePackWriter writer, object value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.UInt16ArrayFormatter +MessagePack.Formatters.UInt16ArrayFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> ushort[] +MessagePack.Formatters.UInt16ArrayFormatter.Serialize(ref MessagePack.MessagePackWriter writer, ushort[] value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.UInt16Formatter +MessagePack.Formatters.UInt16Formatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> ushort +MessagePack.Formatters.UInt16Formatter.Serialize(ref MessagePack.MessagePackWriter writer, ushort value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.UInt32ArrayFormatter +MessagePack.Formatters.UInt32ArrayFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> uint[] +MessagePack.Formatters.UInt32ArrayFormatter.Serialize(ref MessagePack.MessagePackWriter writer, uint[] value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.UInt32Formatter +MessagePack.Formatters.UInt32Formatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> uint +MessagePack.Formatters.UInt32Formatter.Serialize(ref MessagePack.MessagePackWriter writer, uint value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.UInt64ArrayFormatter +MessagePack.Formatters.UInt64ArrayFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> ulong[] +MessagePack.Formatters.UInt64ArrayFormatter.Serialize(ref MessagePack.MessagePackWriter writer, ulong[] value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.UInt64Formatter +MessagePack.Formatters.UInt64Formatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> ulong +MessagePack.Formatters.UInt64Formatter.Serialize(ref MessagePack.MessagePackWriter writer, ulong value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.UriFormatter +MessagePack.Formatters.UriFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> System.Uri +MessagePack.Formatters.UriFormatter.Serialize(ref MessagePack.MessagePackWriter writer, System.Uri value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.ValueTupleFormatter +MessagePack.Formatters.ValueTupleFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> System.ValueTuple +MessagePack.Formatters.ValueTupleFormatter.Serialize(ref MessagePack.MessagePackWriter writer, System.ValueTuple value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.ValueTupleFormatter.ValueTupleFormatter() -> void +MessagePack.Formatters.ValueTupleFormatter +MessagePack.Formatters.ValueTupleFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> (T1, T2, T3, T4, T5, T6, T7) +MessagePack.Formatters.ValueTupleFormatter.Serialize(ref MessagePack.MessagePackWriter writer, (T1, T2, T3, T4, T5, T6, T7) value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.ValueTupleFormatter.ValueTupleFormatter() -> void +MessagePack.Formatters.ValueTupleFormatter +MessagePack.Formatters.ValueTupleFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> (T1, T2, T3, T4, T5, T6) +MessagePack.Formatters.ValueTupleFormatter.Serialize(ref MessagePack.MessagePackWriter writer, (T1, T2, T3, T4, T5, T6) value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.ValueTupleFormatter.ValueTupleFormatter() -> void +MessagePack.Formatters.ValueTupleFormatter +MessagePack.Formatters.ValueTupleFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> (T1, T2, T3, T4, T5) +MessagePack.Formatters.ValueTupleFormatter.Serialize(ref MessagePack.MessagePackWriter writer, (T1, T2, T3, T4, T5) value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.ValueTupleFormatter.ValueTupleFormatter() -> void +MessagePack.Formatters.ValueTupleFormatter +MessagePack.Formatters.ValueTupleFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> (T1, T2, T3, T4) +MessagePack.Formatters.ValueTupleFormatter.Serialize(ref MessagePack.MessagePackWriter writer, (T1, T2, T3, T4) value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.ValueTupleFormatter.ValueTupleFormatter() -> void +MessagePack.Formatters.ValueTupleFormatter +MessagePack.Formatters.ValueTupleFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> (T1, T2, T3) +MessagePack.Formatters.ValueTupleFormatter.Serialize(ref MessagePack.MessagePackWriter writer, (T1, T2, T3) value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.ValueTupleFormatter.ValueTupleFormatter() -> void +MessagePack.Formatters.ValueTupleFormatter +MessagePack.Formatters.ValueTupleFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> (T1, T2) +MessagePack.Formatters.ValueTupleFormatter.Serialize(ref MessagePack.MessagePackWriter writer, (T1, T2) value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.ValueTupleFormatter.ValueTupleFormatter() -> void +MessagePack.Formatters.ValueTupleFormatter +MessagePack.Formatters.ValueTupleFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> System.ValueTuple +MessagePack.Formatters.ValueTupleFormatter.Serialize(ref MessagePack.MessagePackWriter writer, System.ValueTuple value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.ValueTupleFormatter.ValueTupleFormatter() -> void +MessagePack.Formatters.VersionFormatter +MessagePack.Formatters.VersionFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> System.Version +MessagePack.Formatters.VersionFormatter.Serialize(ref MessagePack.MessagePackWriter writer, System.Version value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.IFormatterResolver +MessagePack.IFormatterResolver.GetFormatter() -> MessagePack.Formatters.IMessagePackFormatter +MessagePack.Internal.AutomataDictionary +MessagePack.Internal.AutomataDictionary.Add(string str, int value) -> void +MessagePack.Internal.AutomataDictionary.AutomataDictionary() -> void +MessagePack.Internal.AutomataDictionary.EmitMatch(System.Reflection.Emit.ILGenerator il, System.Reflection.Emit.LocalBuilder bytesSpan, System.Reflection.Emit.LocalBuilder key, System.Action> onFound, System.Action onNotFound) -> void +MessagePack.Internal.AutomataDictionary.GetEnumerator() -> System.Collections.Generic.IEnumerator> +MessagePack.Internal.AutomataDictionary.TryGetValue(System.ReadOnlySpan bytes, out int value) -> bool +MessagePack.Internal.AutomataDictionary.TryGetValue(in System.Buffers.ReadOnlySequence bytes, out int value) -> bool +MessagePack.Internal.AutomataKeyGen +MessagePack.Internal.ByteArrayStringHashTable +MessagePack.Internal.ByteArrayStringHashTable.Add(byte[] key, int value) -> void +MessagePack.Internal.ByteArrayStringHashTable.Add(string key, int value) -> void +MessagePack.Internal.ByteArrayStringHashTable.ByteArrayStringHashTable(int capacity) -> void +MessagePack.Internal.ByteArrayStringHashTable.ByteArrayStringHashTable(int capacity, float loadFactor) -> void +MessagePack.Internal.ByteArrayStringHashTable.GetEnumerator() -> System.Collections.Generic.IEnumerator> +MessagePack.Internal.ByteArrayStringHashTable.TryGetValue(System.ReadOnlySpan key, out int value) -> bool +MessagePack.Internal.ByteArrayStringHashTable.TryGetValue(in System.Buffers.ReadOnlySequence key, out int value) -> bool +MessagePack.Internal.CodeGenHelpers +MessagePack.Internal.RuntimeTypeHandleEqualityComparer +MessagePack.Internal.RuntimeTypeHandleEqualityComparer.Equals(System.RuntimeTypeHandle x, System.RuntimeTypeHandle y) -> bool +MessagePack.Internal.RuntimeTypeHandleEqualityComparer.GetHashCode(System.RuntimeTypeHandle obj) -> int +MessagePack.Internal.UnsafeMemory +MessagePack.Internal.UnsafeMemory32 +MessagePack.Internal.UnsafeMemory64 +MessagePack.MessagePackCode +MessagePack.MessagePackCompression +MessagePack.MessagePackCompression.Lz4Block = 1 -> MessagePack.MessagePackCompression +MessagePack.MessagePackCompression.Lz4BlockArray = 2 -> MessagePack.MessagePackCompression +MessagePack.MessagePackCompression.None = 0 -> MessagePack.MessagePackCompression +MessagePack.MessagePackRange +MessagePack.MessagePackReader +MessagePack.MessagePackReader.CancellationToken.get -> System.Threading.CancellationToken +MessagePack.MessagePackReader.CancellationToken.set -> void +MessagePack.MessagePackReader.Clone(in System.Buffers.ReadOnlySequence readOnlySequence) -> MessagePack.MessagePackReader +MessagePack.MessagePackReader.Consumed.get -> long +MessagePack.MessagePackReader.CreatePeekReader() -> MessagePack.MessagePackReader +MessagePack.MessagePackReader.End.get -> bool +MessagePack.MessagePackReader.IsNil.get -> bool +MessagePack.MessagePackReader.MessagePackReader(System.ReadOnlyMemory memory) -> void +MessagePack.MessagePackReader.MessagePackReader(in System.Buffers.ReadOnlySequence readOnlySequence) -> void +MessagePack.MessagePackReader.NextCode.get -> byte +MessagePack.MessagePackReader.NextMessagePackType.get -> MessagePack.MessagePackType +MessagePack.MessagePackReader.Position.get -> System.SequencePosition +MessagePack.MessagePackReader.ReadArrayHeader() -> int +MessagePack.MessagePackReader.ReadBoolean() -> bool +MessagePack.MessagePackReader.ReadByte() -> byte +MessagePack.MessagePackReader.ReadBytes() -> System.Buffers.ReadOnlySequence? +MessagePack.MessagePackReader.ReadChar() -> char +MessagePack.MessagePackReader.ReadDateTime() -> System.DateTime +MessagePack.MessagePackReader.ReadDouble() -> double +MessagePack.MessagePackReader.ReadExtensionFormat() -> MessagePack.ExtensionResult +MessagePack.MessagePackReader.ReadExtensionFormatHeader() -> MessagePack.ExtensionHeader +MessagePack.MessagePackReader.ReadInt16() -> short +MessagePack.MessagePackReader.ReadInt32() -> int +MessagePack.MessagePackReader.ReadInt64() -> long +MessagePack.MessagePackReader.ReadMapHeader() -> int +MessagePack.MessagePackReader.ReadNil() -> MessagePack.Nil +MessagePack.MessagePackReader.ReadRaw() -> System.Buffers.ReadOnlySequence +MessagePack.MessagePackReader.ReadRaw(long length) -> System.Buffers.ReadOnlySequence +MessagePack.MessagePackReader.ReadSByte() -> sbyte +MessagePack.MessagePackReader.ReadSingle() -> float +MessagePack.MessagePackReader.ReadString() -> string +MessagePack.MessagePackReader.ReadStringSequence() -> System.Buffers.ReadOnlySequence? +MessagePack.MessagePackReader.ReadUInt16() -> ushort +MessagePack.MessagePackReader.ReadUInt32() -> uint +MessagePack.MessagePackReader.ReadUInt64() -> ulong +MessagePack.MessagePackReader.Sequence.get -> System.Buffers.ReadOnlySequence +MessagePack.MessagePackReader.Skip() -> void +MessagePack.MessagePackReader.TryReadNil() -> bool +MessagePack.MessagePackReader.TryReadStringSpan(out System.ReadOnlySpan span) -> bool +MessagePack.MessagePackSerializationException +MessagePack.MessagePackSerializationException.MessagePackSerializationException() -> void +MessagePack.MessagePackSerializationException.MessagePackSerializationException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) -> void +MessagePack.MessagePackSerializationException.MessagePackSerializationException(string message) -> void +MessagePack.MessagePackSerializationException.MessagePackSerializationException(string message, System.Exception inner) -> void +MessagePack.MessagePackSerializer +MessagePack.MessagePackSerializer.Typeless +MessagePack.MessagePackSerializerOptions +MessagePack.MessagePackSerializerOptions.AllowAssemblyVersionMismatch.get -> bool +MessagePack.MessagePackSerializerOptions.Compression.get -> MessagePack.MessagePackCompression +MessagePack.MessagePackSerializerOptions.MessagePackSerializerOptions(MessagePack.IFormatterResolver resolver) -> void +MessagePack.MessagePackSerializerOptions.MessagePackSerializerOptions(MessagePack.MessagePackSerializerOptions copyFrom) -> void +MessagePack.MessagePackSerializerOptions.OldSpec.get -> bool? +MessagePack.MessagePackSerializerOptions.OmitAssemblyVersion.get -> bool +MessagePack.MessagePackSerializerOptions.Resolver.get -> MessagePack.IFormatterResolver +MessagePack.MessagePackSerializerOptions.WithAllowAssemblyVersionMismatch(bool allowAssemblyVersionMismatch) -> MessagePack.MessagePackSerializerOptions +MessagePack.MessagePackSerializerOptions.WithCompression(MessagePack.MessagePackCompression compression) -> MessagePack.MessagePackSerializerOptions +MessagePack.MessagePackSerializerOptions.WithOldSpec(bool? oldSpec = true) -> MessagePack.MessagePackSerializerOptions +MessagePack.MessagePackSerializerOptions.WithOmitAssemblyVersion(bool omitAssemblyVersion) -> MessagePack.MessagePackSerializerOptions +MessagePack.MessagePackSerializerOptions.WithResolver(MessagePack.IFormatterResolver resolver) -> MessagePack.MessagePackSerializerOptions +MessagePack.MessagePackStreamReader +MessagePack.MessagePackStreamReader.Dispose() -> void +MessagePack.MessagePackStreamReader.MessagePackStreamReader(System.IO.Stream stream) -> void +MessagePack.MessagePackStreamReader.ReadAsync(System.Threading.CancellationToken cancellationToken) -> System.Threading.Tasks.ValueTask?> +MessagePack.MessagePackStreamReader.RemainingBytes.get -> System.Buffers.ReadOnlySequence +MessagePack.MessagePackType +MessagePack.MessagePackType.Array = 7 -> MessagePack.MessagePackType +MessagePack.MessagePackType.Binary = 6 -> MessagePack.MessagePackType +MessagePack.MessagePackType.Boolean = 3 -> MessagePack.MessagePackType +MessagePack.MessagePackType.Extension = 9 -> MessagePack.MessagePackType +MessagePack.MessagePackType.Float = 4 -> MessagePack.MessagePackType +MessagePack.MessagePackType.Integer = 1 -> MessagePack.MessagePackType +MessagePack.MessagePackType.Map = 8 -> MessagePack.MessagePackType +MessagePack.MessagePackType.Nil = 2 -> MessagePack.MessagePackType +MessagePack.MessagePackType.String = 5 -> MessagePack.MessagePackType +MessagePack.MessagePackType.Unknown = 0 -> MessagePack.MessagePackType +MessagePack.MessagePackWriter +MessagePack.MessagePackWriter.Advance(int length) -> void +MessagePack.MessagePackWriter.CancellationToken.get -> System.Threading.CancellationToken +MessagePack.MessagePackWriter.CancellationToken.set -> void +MessagePack.MessagePackWriter.Clone(System.Buffers.IBufferWriter writer) -> MessagePack.MessagePackWriter +MessagePack.MessagePackWriter.Flush() -> void +MessagePack.MessagePackWriter.GetSpan(int length) -> System.Span +MessagePack.MessagePackWriter.MessagePackWriter(System.Buffers.IBufferWriter writer) -> void +MessagePack.MessagePackWriter.OldSpec.get -> bool +MessagePack.MessagePackWriter.OldSpec.set -> void +MessagePack.MessagePackWriter.Write(System.DateTime dateTime) -> void +MessagePack.MessagePackWriter.Write(System.ReadOnlySpan src) -> void +MessagePack.MessagePackWriter.Write(System.ReadOnlySpan value) -> void +MessagePack.MessagePackWriter.Write(bool value) -> void +MessagePack.MessagePackWriter.Write(byte value) -> void +MessagePack.MessagePackWriter.Write(byte[] src) -> void +MessagePack.MessagePackWriter.Write(char value) -> void +MessagePack.MessagePackWriter.Write(double value) -> void +MessagePack.MessagePackWriter.Write(float value) -> void +MessagePack.MessagePackWriter.Write(in System.Buffers.ReadOnlySequence src) -> void +MessagePack.MessagePackWriter.Write(int value) -> void +MessagePack.MessagePackWriter.Write(long value) -> void +MessagePack.MessagePackWriter.Write(sbyte value) -> void +MessagePack.MessagePackWriter.Write(short value) -> void +MessagePack.MessagePackWriter.Write(string value) -> void +MessagePack.MessagePackWriter.Write(uint value) -> void +MessagePack.MessagePackWriter.Write(ulong value) -> void +MessagePack.MessagePackWriter.Write(ushort value) -> void +MessagePack.MessagePackWriter.WriteArrayHeader(int count) -> void +MessagePack.MessagePackWriter.WriteArrayHeader(uint count) -> void +MessagePack.MessagePackWriter.WriteExtensionFormat(MessagePack.ExtensionResult extensionData) -> void +MessagePack.MessagePackWriter.WriteExtensionFormatHeader(MessagePack.ExtensionHeader extensionHeader) -> void +MessagePack.MessagePackWriter.WriteInt16(short value) -> void +MessagePack.MessagePackWriter.WriteInt32(int value) -> void +MessagePack.MessagePackWriter.WriteInt64(long value) -> void +MessagePack.MessagePackWriter.WriteInt8(sbyte value) -> void +MessagePack.MessagePackWriter.WriteMapHeader(int count) -> void +MessagePack.MessagePackWriter.WriteMapHeader(uint count) -> void +MessagePack.MessagePackWriter.WriteNil() -> void +MessagePack.MessagePackWriter.WriteRaw(System.ReadOnlySpan rawMessagePackBlock) -> void +MessagePack.MessagePackWriter.WriteRaw(in System.Buffers.ReadOnlySequence rawMessagePackBlock) -> void +MessagePack.MessagePackWriter.WriteString(System.ReadOnlySpan utf8stringBytes) -> void +MessagePack.MessagePackWriter.WriteString(in System.Buffers.ReadOnlySequence utf8stringBytes) -> void +MessagePack.MessagePackWriter.WriteUInt16(ushort value) -> void +MessagePack.MessagePackWriter.WriteUInt32(uint value) -> void +MessagePack.MessagePackWriter.WriteUInt64(ulong value) -> void +MessagePack.MessagePackWriter.WriteUInt8(byte value) -> void +MessagePack.Nil +MessagePack.Nil.Equals(MessagePack.Nil other) -> bool +MessagePack.Nil.Nil() -> void +MessagePack.ReservedMessagePackExtensionTypeCode +MessagePack.Resolvers.AttributeFormatterResolver +MessagePack.Resolvers.AttributeFormatterResolver.GetFormatter() -> MessagePack.Formatters.IMessagePackFormatter +MessagePack.Resolvers.BuiltinResolver +MessagePack.Resolvers.BuiltinResolver.GetFormatter() -> MessagePack.Formatters.IMessagePackFormatter +MessagePack.Resolvers.CompositeResolver +MessagePack.Resolvers.ContractlessStandardResolver +MessagePack.Resolvers.ContractlessStandardResolver.GetFormatter() -> MessagePack.Formatters.IMessagePackFormatter +MessagePack.Resolvers.ContractlessStandardResolverAllowPrivate +MessagePack.Resolvers.ContractlessStandardResolverAllowPrivate.GetFormatter() -> MessagePack.Formatters.IMessagePackFormatter +MessagePack.Resolvers.DynamicContractlessObjectResolver +MessagePack.Resolvers.DynamicContractlessObjectResolver.GetFormatter() -> MessagePack.Formatters.IMessagePackFormatter +MessagePack.Resolvers.DynamicContractlessObjectResolverAllowPrivate +MessagePack.Resolvers.DynamicContractlessObjectResolverAllowPrivate.DynamicContractlessObjectResolverAllowPrivate() -> void +MessagePack.Resolvers.DynamicContractlessObjectResolverAllowPrivate.GetFormatter() -> MessagePack.Formatters.IMessagePackFormatter +MessagePack.Resolvers.DynamicEnumAsStringResolver +MessagePack.Resolvers.DynamicEnumAsStringResolver.GetFormatter() -> MessagePack.Formatters.IMessagePackFormatter +MessagePack.Resolvers.DynamicEnumResolver +MessagePack.Resolvers.DynamicEnumResolver.GetFormatter() -> MessagePack.Formatters.IMessagePackFormatter +MessagePack.Resolvers.DynamicGenericResolver +MessagePack.Resolvers.DynamicGenericResolver.GetFormatter() -> MessagePack.Formatters.IMessagePackFormatter +MessagePack.Resolvers.DynamicObjectResolver +MessagePack.Resolvers.DynamicObjectResolver.GetFormatter() -> MessagePack.Formatters.IMessagePackFormatter +MessagePack.Resolvers.DynamicObjectResolverAllowPrivate +MessagePack.Resolvers.DynamicObjectResolverAllowPrivate.GetFormatter() -> MessagePack.Formatters.IMessagePackFormatter +MessagePack.Resolvers.DynamicUnionResolver +MessagePack.Resolvers.DynamicUnionResolver.GetFormatter() -> MessagePack.Formatters.IMessagePackFormatter +MessagePack.Resolvers.NativeDateTimeResolver +MessagePack.Resolvers.NativeDateTimeResolver.GetFormatter() -> MessagePack.Formatters.IMessagePackFormatter +MessagePack.Resolvers.NativeDecimalResolver +MessagePack.Resolvers.NativeDecimalResolver.GetFormatter() -> MessagePack.Formatters.IMessagePackFormatter +MessagePack.Resolvers.NativeGuidResolver +MessagePack.Resolvers.NativeGuidResolver.GetFormatter() -> MessagePack.Formatters.IMessagePackFormatter +MessagePack.Resolvers.PrimitiveObjectResolver +MessagePack.Resolvers.PrimitiveObjectResolver.GetFormatter() -> MessagePack.Formatters.IMessagePackFormatter +MessagePack.Resolvers.StandardResolver +MessagePack.Resolvers.StandardResolver.GetFormatter() -> MessagePack.Formatters.IMessagePackFormatter +MessagePack.Resolvers.StandardResolverAllowPrivate +MessagePack.Resolvers.StandardResolverAllowPrivate.GetFormatter() -> MessagePack.Formatters.IMessagePackFormatter +MessagePack.Resolvers.StaticCompositeResolver +MessagePack.Resolvers.StaticCompositeResolver.GetFormatter() -> MessagePack.Formatters.IMessagePackFormatter +MessagePack.Resolvers.StaticCompositeResolver.Register(System.Collections.Generic.IReadOnlyList formatters, System.Collections.Generic.IReadOnlyList resolvers) -> void +MessagePack.Resolvers.StaticCompositeResolver.Register(params MessagePack.Formatters.IMessagePackFormatter[] formatters) -> void +MessagePack.Resolvers.StaticCompositeResolver.Register(params MessagePack.IFormatterResolver[] resolvers) -> void +MessagePack.Resolvers.TypelessContractlessStandardResolver +MessagePack.Resolvers.TypelessContractlessStandardResolver.GetFormatter() -> MessagePack.Formatters.IMessagePackFormatter +MessagePack.Resolvers.TypelessContractlessStandardResolver.TypelessContractlessStandardResolver() -> void +MessagePack.Resolvers.TypelessObjectResolver +MessagePack.Resolvers.TypelessObjectResolver.GetFormatter() -> MessagePack.Formatters.IMessagePackFormatter +MessagePack.TinyJsonException +MessagePack.TinyJsonException.TinyJsonException(string message) -> void +abstract MessagePack.Formatters.CollectionFormatterBase.Add(TIntermediate collection, int index, TElement value, MessagePack.MessagePackSerializerOptions options) -> void +abstract MessagePack.Formatters.CollectionFormatterBase.Complete(TIntermediate intermediateCollection) -> TCollection +abstract MessagePack.Formatters.CollectionFormatterBase.Create(int count, MessagePack.MessagePackSerializerOptions options) -> TIntermediate +abstract MessagePack.Formatters.CollectionFormatterBase.GetSourceEnumerator(TCollection source) -> TEnumerator +abstract MessagePack.Formatters.DictionaryFormatterBase.Add(TIntermediate collection, int index, TKey key, TValue value, MessagePack.MessagePackSerializerOptions options) -> void +abstract MessagePack.Formatters.DictionaryFormatterBase.Complete(TIntermediate intermediateCollection) -> TDictionary +abstract MessagePack.Formatters.DictionaryFormatterBase.Create(int count, MessagePack.MessagePackSerializerOptions options) -> TIntermediate +abstract MessagePack.Formatters.DictionaryFormatterBase.GetSourceEnumerator(TDictionary source) -> TEnumerator +const MessagePack.MessagePackCode.Array16 = 220 -> byte +const MessagePack.MessagePackCode.Array32 = 221 -> byte +const MessagePack.MessagePackCode.Bin16 = 197 -> byte +const MessagePack.MessagePackCode.Bin32 = 198 -> byte +const MessagePack.MessagePackCode.Bin8 = 196 -> byte +const MessagePack.MessagePackCode.Ext16 = 200 -> byte +const MessagePack.MessagePackCode.Ext32 = 201 -> byte +const MessagePack.MessagePackCode.Ext8 = 199 -> byte +const MessagePack.MessagePackCode.False = 194 -> byte +const MessagePack.MessagePackCode.FixExt1 = 212 -> byte +const MessagePack.MessagePackCode.FixExt16 = 216 -> byte +const MessagePack.MessagePackCode.FixExt2 = 213 -> byte +const MessagePack.MessagePackCode.FixExt4 = 214 -> byte +const MessagePack.MessagePackCode.FixExt8 = 215 -> byte +const MessagePack.MessagePackCode.Float32 = 202 -> byte +const MessagePack.MessagePackCode.Float64 = 203 -> byte +const MessagePack.MessagePackCode.Int16 = 209 -> byte +const MessagePack.MessagePackCode.Int32 = 210 -> byte +const MessagePack.MessagePackCode.Int64 = 211 -> byte +const MessagePack.MessagePackCode.Int8 = 208 -> byte +const MessagePack.MessagePackCode.Map16 = 222 -> byte +const MessagePack.MessagePackCode.Map32 = 223 -> byte +const MessagePack.MessagePackCode.MaxFixArray = 159 -> byte +const MessagePack.MessagePackCode.MaxFixInt = 127 -> byte +const MessagePack.MessagePackCode.MaxFixMap = 143 -> byte +const MessagePack.MessagePackCode.MaxFixStr = 191 -> byte +const MessagePack.MessagePackCode.MaxNegativeFixInt = 255 -> byte +const MessagePack.MessagePackCode.MinFixArray = 144 -> byte +const MessagePack.MessagePackCode.MinFixInt = 0 -> byte +const MessagePack.MessagePackCode.MinFixMap = 128 -> byte +const MessagePack.MessagePackCode.MinFixStr = 160 -> byte +const MessagePack.MessagePackCode.MinNegativeFixInt = 224 -> byte +const MessagePack.MessagePackCode.NeverUsed = 193 -> byte +const MessagePack.MessagePackCode.Nil = 192 -> byte +const MessagePack.MessagePackCode.Str16 = 218 -> byte +const MessagePack.MessagePackCode.Str32 = 219 -> byte +const MessagePack.MessagePackCode.Str8 = 217 -> byte +const MessagePack.MessagePackCode.True = 195 -> byte +const MessagePack.MessagePackCode.UInt16 = 205 -> byte +const MessagePack.MessagePackCode.UInt32 = 206 -> byte +const MessagePack.MessagePackCode.UInt64 = 207 -> byte +const MessagePack.MessagePackCode.UInt8 = 204 -> byte +const MessagePack.MessagePackRange.MaxFixArrayCount = 15 -> int +const MessagePack.MessagePackRange.MaxFixMapCount = 15 -> int +const MessagePack.MessagePackRange.MaxFixNegativeInt = -1 -> int +const MessagePack.MessagePackRange.MaxFixPositiveInt = 127 -> int +const MessagePack.MessagePackRange.MaxFixStringLength = 31 -> int +const MessagePack.MessagePackRange.MinFixNegativeInt = -32 -> int +const MessagePack.MessagePackRange.MinFixStringLength = 0 -> int +const MessagePack.ReservedMessagePackExtensionTypeCode.DateTime = -1 -> sbyte +override MessagePack.Formatters.CollectionFormatterBase.GetSourceEnumerator(TCollection source) -> System.Collections.Generic.IEnumerator +override MessagePack.Formatters.DictionaryFormatterBase.Complete(TDictionary intermediateCollection) -> TDictionary +override MessagePack.Formatters.DictionaryFormatterBase.GetSourceEnumerator(TDictionary source) -> System.Collections.Generic.IEnumerator> +override MessagePack.Internal.AutomataDictionary.ToString() -> string +override MessagePack.Nil.Equals(object obj) -> bool +override MessagePack.Nil.GetHashCode() -> int +override MessagePack.Nil.ToString() -> string +override sealed MessagePack.Formatters.CollectionFormatterBase.Complete(TCollection intermediateCollection) -> TCollection +static MessagePack.FormatterResolverExtensions.GetFormatterDynamic(this MessagePack.IFormatterResolver resolver, System.Type type) -> object +static MessagePack.FormatterResolverExtensions.GetFormatterWithVerify(this MessagePack.IFormatterResolver resolver) -> MessagePack.Formatters.IMessagePackFormatter +static MessagePack.Formatters.PrimitiveObjectFormatter.IsSupportedType(System.Type type, System.Reflection.TypeInfo typeInfo, object value) -> bool +static MessagePack.Internal.AutomataKeyGen.GetKey(ref System.ReadOnlySpan span) -> ulong +static MessagePack.Internal.CodeGenHelpers.GetArrayFromNullableSequence(in System.Buffers.ReadOnlySequence? sequence) -> byte[] +static MessagePack.Internal.CodeGenHelpers.GetEncodedStringBytes(string value) -> byte[] +static MessagePack.Internal.CodeGenHelpers.GetSpanFromSequence(in System.Buffers.ReadOnlySequence sequence) -> System.ReadOnlySpan +static MessagePack.Internal.CodeGenHelpers.ReadStringSpan(ref MessagePack.MessagePackReader reader) -> System.ReadOnlySpan +static MessagePack.Internal.UnsafeMemory32.WriteRaw1(ref MessagePack.MessagePackWriter writer, System.ReadOnlySpan src) -> void +static MessagePack.Internal.UnsafeMemory32.WriteRaw10(ref MessagePack.MessagePackWriter writer, System.ReadOnlySpan src) -> void +static MessagePack.Internal.UnsafeMemory32.WriteRaw11(ref MessagePack.MessagePackWriter writer, System.ReadOnlySpan src) -> void +static MessagePack.Internal.UnsafeMemory32.WriteRaw12(ref MessagePack.MessagePackWriter writer, System.ReadOnlySpan src) -> void +static MessagePack.Internal.UnsafeMemory32.WriteRaw13(ref MessagePack.MessagePackWriter writer, System.ReadOnlySpan src) -> void +static MessagePack.Internal.UnsafeMemory32.WriteRaw14(ref MessagePack.MessagePackWriter writer, System.ReadOnlySpan src) -> void +static MessagePack.Internal.UnsafeMemory32.WriteRaw15(ref MessagePack.MessagePackWriter writer, System.ReadOnlySpan src) -> void +static MessagePack.Internal.UnsafeMemory32.WriteRaw16(ref MessagePack.MessagePackWriter writer, System.ReadOnlySpan src) -> void +static MessagePack.Internal.UnsafeMemory32.WriteRaw17(ref MessagePack.MessagePackWriter writer, System.ReadOnlySpan src) -> void +static MessagePack.Internal.UnsafeMemory32.WriteRaw18(ref MessagePack.MessagePackWriter writer, System.ReadOnlySpan src) -> void +static MessagePack.Internal.UnsafeMemory32.WriteRaw19(ref MessagePack.MessagePackWriter writer, System.ReadOnlySpan src) -> void +static MessagePack.Internal.UnsafeMemory32.WriteRaw2(ref MessagePack.MessagePackWriter writer, System.ReadOnlySpan src) -> void +static MessagePack.Internal.UnsafeMemory32.WriteRaw20(ref MessagePack.MessagePackWriter writer, System.ReadOnlySpan src) -> void +static MessagePack.Internal.UnsafeMemory32.WriteRaw21(ref MessagePack.MessagePackWriter writer, System.ReadOnlySpan src) -> void +static MessagePack.Internal.UnsafeMemory32.WriteRaw22(ref MessagePack.MessagePackWriter writer, System.ReadOnlySpan src) -> void +static MessagePack.Internal.UnsafeMemory32.WriteRaw23(ref MessagePack.MessagePackWriter writer, System.ReadOnlySpan src) -> void +static MessagePack.Internal.UnsafeMemory32.WriteRaw24(ref MessagePack.MessagePackWriter writer, System.ReadOnlySpan src) -> void +static MessagePack.Internal.UnsafeMemory32.WriteRaw25(ref MessagePack.MessagePackWriter writer, System.ReadOnlySpan src) -> void +static MessagePack.Internal.UnsafeMemory32.WriteRaw26(ref MessagePack.MessagePackWriter writer, System.ReadOnlySpan src) -> void +static MessagePack.Internal.UnsafeMemory32.WriteRaw27(ref MessagePack.MessagePackWriter writer, System.ReadOnlySpan src) -> void +static MessagePack.Internal.UnsafeMemory32.WriteRaw28(ref MessagePack.MessagePackWriter writer, System.ReadOnlySpan src) -> void +static MessagePack.Internal.UnsafeMemory32.WriteRaw29(ref MessagePack.MessagePackWriter writer, System.ReadOnlySpan src) -> void +static MessagePack.Internal.UnsafeMemory32.WriteRaw3(ref MessagePack.MessagePackWriter writer, System.ReadOnlySpan src) -> void +static MessagePack.Internal.UnsafeMemory32.WriteRaw30(ref MessagePack.MessagePackWriter writer, System.ReadOnlySpan src) -> void +static MessagePack.Internal.UnsafeMemory32.WriteRaw31(ref MessagePack.MessagePackWriter writer, System.ReadOnlySpan src) -> void +static MessagePack.Internal.UnsafeMemory32.WriteRaw4(ref MessagePack.MessagePackWriter writer, System.ReadOnlySpan src) -> void +static MessagePack.Internal.UnsafeMemory32.WriteRaw5(ref MessagePack.MessagePackWriter writer, System.ReadOnlySpan src) -> void +static MessagePack.Internal.UnsafeMemory32.WriteRaw6(ref MessagePack.MessagePackWriter writer, System.ReadOnlySpan src) -> void +static MessagePack.Internal.UnsafeMemory32.WriteRaw7(ref MessagePack.MessagePackWriter writer, System.ReadOnlySpan src) -> void +static MessagePack.Internal.UnsafeMemory32.WriteRaw8(ref MessagePack.MessagePackWriter writer, System.ReadOnlySpan src) -> void +static MessagePack.Internal.UnsafeMemory32.WriteRaw9(ref MessagePack.MessagePackWriter writer, System.ReadOnlySpan src) -> void +static MessagePack.Internal.UnsafeMemory64.WriteRaw1(ref MessagePack.MessagePackWriter writer, System.ReadOnlySpan src) -> void +static MessagePack.Internal.UnsafeMemory64.WriteRaw10(ref MessagePack.MessagePackWriter writer, System.ReadOnlySpan src) -> void +static MessagePack.Internal.UnsafeMemory64.WriteRaw11(ref MessagePack.MessagePackWriter writer, System.ReadOnlySpan src) -> void +static MessagePack.Internal.UnsafeMemory64.WriteRaw12(ref MessagePack.MessagePackWriter writer, System.ReadOnlySpan src) -> void +static MessagePack.Internal.UnsafeMemory64.WriteRaw13(ref MessagePack.MessagePackWriter writer, System.ReadOnlySpan src) -> void +static MessagePack.Internal.UnsafeMemory64.WriteRaw14(ref MessagePack.MessagePackWriter writer, System.ReadOnlySpan src) -> void +static MessagePack.Internal.UnsafeMemory64.WriteRaw15(ref MessagePack.MessagePackWriter writer, System.ReadOnlySpan src) -> void +static MessagePack.Internal.UnsafeMemory64.WriteRaw16(ref MessagePack.MessagePackWriter writer, System.ReadOnlySpan src) -> void +static MessagePack.Internal.UnsafeMemory64.WriteRaw17(ref MessagePack.MessagePackWriter writer, System.ReadOnlySpan src) -> void +static MessagePack.Internal.UnsafeMemory64.WriteRaw18(ref MessagePack.MessagePackWriter writer, System.ReadOnlySpan src) -> void +static MessagePack.Internal.UnsafeMemory64.WriteRaw19(ref MessagePack.MessagePackWriter writer, System.ReadOnlySpan src) -> void +static MessagePack.Internal.UnsafeMemory64.WriteRaw2(ref MessagePack.MessagePackWriter writer, System.ReadOnlySpan src) -> void +static MessagePack.Internal.UnsafeMemory64.WriteRaw20(ref MessagePack.MessagePackWriter writer, System.ReadOnlySpan src) -> void +static MessagePack.Internal.UnsafeMemory64.WriteRaw21(ref MessagePack.MessagePackWriter writer, System.ReadOnlySpan src) -> void +static MessagePack.Internal.UnsafeMemory64.WriteRaw22(ref MessagePack.MessagePackWriter writer, System.ReadOnlySpan src) -> void +static MessagePack.Internal.UnsafeMemory64.WriteRaw23(ref MessagePack.MessagePackWriter writer, System.ReadOnlySpan src) -> void +static MessagePack.Internal.UnsafeMemory64.WriteRaw24(ref MessagePack.MessagePackWriter writer, System.ReadOnlySpan src) -> void +static MessagePack.Internal.UnsafeMemory64.WriteRaw25(ref MessagePack.MessagePackWriter writer, System.ReadOnlySpan src) -> void +static MessagePack.Internal.UnsafeMemory64.WriteRaw26(ref MessagePack.MessagePackWriter writer, System.ReadOnlySpan src) -> void +static MessagePack.Internal.UnsafeMemory64.WriteRaw27(ref MessagePack.MessagePackWriter writer, System.ReadOnlySpan src) -> void +static MessagePack.Internal.UnsafeMemory64.WriteRaw28(ref MessagePack.MessagePackWriter writer, System.ReadOnlySpan src) -> void +static MessagePack.Internal.UnsafeMemory64.WriteRaw29(ref MessagePack.MessagePackWriter writer, System.ReadOnlySpan src) -> void +static MessagePack.Internal.UnsafeMemory64.WriteRaw3(ref MessagePack.MessagePackWriter writer, System.ReadOnlySpan src) -> void +static MessagePack.Internal.UnsafeMemory64.WriteRaw30(ref MessagePack.MessagePackWriter writer, System.ReadOnlySpan src) -> void +static MessagePack.Internal.UnsafeMemory64.WriteRaw31(ref MessagePack.MessagePackWriter writer, System.ReadOnlySpan src) -> void +static MessagePack.Internal.UnsafeMemory64.WriteRaw4(ref MessagePack.MessagePackWriter writer, System.ReadOnlySpan src) -> void +static MessagePack.Internal.UnsafeMemory64.WriteRaw5(ref MessagePack.MessagePackWriter writer, System.ReadOnlySpan src) -> void +static MessagePack.Internal.UnsafeMemory64.WriteRaw6(ref MessagePack.MessagePackWriter writer, System.ReadOnlySpan src) -> void +static MessagePack.Internal.UnsafeMemory64.WriteRaw7(ref MessagePack.MessagePackWriter writer, System.ReadOnlySpan src) -> void +static MessagePack.Internal.UnsafeMemory64.WriteRaw8(ref MessagePack.MessagePackWriter writer, System.ReadOnlySpan src) -> void +static MessagePack.Internal.UnsafeMemory64.WriteRaw9(ref MessagePack.MessagePackWriter writer, System.ReadOnlySpan src) -> void +static MessagePack.MessagePackCode.ToFormatName(byte code) -> string +static MessagePack.MessagePackCode.ToMessagePackType(byte code) -> MessagePack.MessagePackType +static MessagePack.MessagePackSerializer.ConvertFromJson(System.IO.TextReader reader, ref MessagePack.MessagePackWriter writer, MessagePack.MessagePackSerializerOptions options = null) -> void +static MessagePack.MessagePackSerializer.ConvertFromJson(string str, MessagePack.MessagePackSerializerOptions options = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) -> byte[] +static MessagePack.MessagePackSerializer.ConvertFromJson(string str, ref MessagePack.MessagePackWriter writer, MessagePack.MessagePackSerializerOptions options = null) -> void +static MessagePack.MessagePackSerializer.ConvertToJson(System.ReadOnlyMemory bytes, MessagePack.MessagePackSerializerOptions options = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) -> string +static MessagePack.MessagePackSerializer.ConvertToJson(in System.Buffers.ReadOnlySequence bytes, MessagePack.MessagePackSerializerOptions options = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) -> string +static MessagePack.MessagePackSerializer.ConvertToJson(ref MessagePack.MessagePackReader reader, System.IO.TextWriter jsonWriter, MessagePack.MessagePackSerializerOptions options = null) -> void +static MessagePack.MessagePackSerializer.DefaultOptions.get -> MessagePack.MessagePackSerializerOptions +static MessagePack.MessagePackSerializer.DefaultOptions.set -> void +static MessagePack.MessagePackSerializer.Deserialize(System.Type type, System.Buffers.ReadOnlySequence bytes, MessagePack.MessagePackSerializerOptions options = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) -> object +static MessagePack.MessagePackSerializer.Deserialize(System.Type type, System.IO.Stream stream, MessagePack.MessagePackSerializerOptions options = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) -> object +static MessagePack.MessagePackSerializer.Deserialize(System.Type type, System.ReadOnlyMemory bytes, MessagePack.MessagePackSerializerOptions options = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) -> object +static MessagePack.MessagePackSerializer.Deserialize(System.Type type, ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options = null) -> object +static MessagePack.MessagePackSerializer.Deserialize(System.IO.Stream stream, MessagePack.MessagePackSerializerOptions options = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) -> T +static MessagePack.MessagePackSerializer.Deserialize(System.ReadOnlyMemory buffer, MessagePack.MessagePackSerializerOptions options = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) -> T +static MessagePack.MessagePackSerializer.Deserialize(System.ReadOnlyMemory buffer, MessagePack.MessagePackSerializerOptions options, out int bytesRead, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) -> T +static MessagePack.MessagePackSerializer.Deserialize(System.ReadOnlyMemory buffer, out int bytesRead, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) -> T +static MessagePack.MessagePackSerializer.Deserialize(in System.Buffers.ReadOnlySequence byteSequence, MessagePack.MessagePackSerializerOptions options = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) -> T +static MessagePack.MessagePackSerializer.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options = null) -> T +static MessagePack.MessagePackSerializer.DeserializeAsync(System.Type type, System.IO.Stream stream, MessagePack.MessagePackSerializerOptions options = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) -> System.Threading.Tasks.ValueTask +static MessagePack.MessagePackSerializer.DeserializeAsync(System.IO.Stream stream, MessagePack.MessagePackSerializerOptions options = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) -> System.Threading.Tasks.ValueTask +static MessagePack.MessagePackSerializer.Serialize(System.Type type, System.Buffers.IBufferWriter writer, object obj, MessagePack.MessagePackSerializerOptions options = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) -> void +static MessagePack.MessagePackSerializer.Serialize(System.Type type, System.IO.Stream stream, object obj, MessagePack.MessagePackSerializerOptions options = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) -> void +static MessagePack.MessagePackSerializer.Serialize(System.Type type, object obj, MessagePack.MessagePackSerializerOptions options = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) -> byte[] +static MessagePack.MessagePackSerializer.Serialize(System.Type type, ref MessagePack.MessagePackWriter writer, object obj, MessagePack.MessagePackSerializerOptions options = null) -> void +static MessagePack.MessagePackSerializer.Serialize(System.Buffers.IBufferWriter writer, T value, MessagePack.MessagePackSerializerOptions options = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) -> void +static MessagePack.MessagePackSerializer.Serialize(System.IO.Stream stream, T value, MessagePack.MessagePackSerializerOptions options = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) -> void +static MessagePack.MessagePackSerializer.Serialize(T value, MessagePack.MessagePackSerializerOptions options = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) -> byte[] +static MessagePack.MessagePackSerializer.Serialize(ref MessagePack.MessagePackWriter writer, T value, MessagePack.MessagePackSerializerOptions options = null) -> void +static MessagePack.MessagePackSerializer.SerializeAsync(System.Type type, System.IO.Stream stream, object obj, MessagePack.MessagePackSerializerOptions options = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) -> System.Threading.Tasks.Task +static MessagePack.MessagePackSerializer.SerializeAsync(System.IO.Stream stream, T value, MessagePack.MessagePackSerializerOptions options = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) -> System.Threading.Tasks.Task +static MessagePack.MessagePackSerializer.SerializeToJson(System.IO.TextWriter textWriter, T obj, MessagePack.MessagePackSerializerOptions options = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) -> void +static MessagePack.MessagePackSerializer.SerializeToJson(T obj, MessagePack.MessagePackSerializerOptions options = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) -> string +static MessagePack.MessagePackSerializer.Typeless.DefaultOptions.get -> MessagePack.MessagePackSerializerOptions +static MessagePack.MessagePackSerializer.Typeless.DefaultOptions.set -> void +static MessagePack.MessagePackSerializer.Typeless.Deserialize(System.IO.Stream stream, MessagePack.MessagePackSerializerOptions options = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) -> object +static MessagePack.MessagePackSerializer.Typeless.Deserialize(System.Memory bytes, MessagePack.MessagePackSerializerOptions options = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) -> object +static MessagePack.MessagePackSerializer.Typeless.Deserialize(in System.Buffers.ReadOnlySequence byteSequence, MessagePack.MessagePackSerializerOptions options = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) -> object +static MessagePack.MessagePackSerializer.Typeless.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options = null) -> object +static MessagePack.MessagePackSerializer.Typeless.DeserializeAsync(System.IO.Stream stream, MessagePack.MessagePackSerializerOptions options = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) -> System.Threading.Tasks.ValueTask +static MessagePack.MessagePackSerializer.Typeless.Serialize(System.Buffers.IBufferWriter writer, object obj, MessagePack.MessagePackSerializerOptions options = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) -> void +static MessagePack.MessagePackSerializer.Typeless.Serialize(System.IO.Stream stream, object obj, MessagePack.MessagePackSerializerOptions options = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) -> void +static MessagePack.MessagePackSerializer.Typeless.Serialize(object obj, MessagePack.MessagePackSerializerOptions options = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) -> byte[] +static MessagePack.MessagePackSerializer.Typeless.Serialize(ref MessagePack.MessagePackWriter writer, object obj, MessagePack.MessagePackSerializerOptions options = null) -> void +static MessagePack.MessagePackSerializer.Typeless.SerializeAsync(System.IO.Stream stream, object obj, MessagePack.MessagePackSerializerOptions options = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) -> System.Threading.Tasks.Task +static MessagePack.MessagePackSerializerOptions.Standard.get -> MessagePack.MessagePackSerializerOptions +static MessagePack.Resolvers.CompositeResolver.Create(System.Collections.Generic.IReadOnlyList formatters, System.Collections.Generic.IReadOnlyList resolvers) -> MessagePack.IFormatterResolver +static MessagePack.Resolvers.CompositeResolver.Create(params MessagePack.Formatters.IMessagePackFormatter[] formatters) -> MessagePack.IFormatterResolver +static MessagePack.Resolvers.CompositeResolver.Create(params MessagePack.IFormatterResolver[] resolvers) -> MessagePack.IFormatterResolver +static readonly MessagePack.Formatters.BigIntegerFormatter.Instance -> MessagePack.Formatters.IMessagePackFormatter +static readonly MessagePack.Formatters.BitArrayFormatter.Instance -> MessagePack.Formatters.IMessagePackFormatter +static readonly MessagePack.Formatters.BooleanArrayFormatter.Instance -> MessagePack.Formatters.BooleanArrayFormatter +static readonly MessagePack.Formatters.BooleanFormatter.Instance -> MessagePack.Formatters.BooleanFormatter +static readonly MessagePack.Formatters.ByteArrayFormatter.Instance -> MessagePack.Formatters.ByteArrayFormatter +static readonly MessagePack.Formatters.ByteArraySegmentFormatter.Instance -> MessagePack.Formatters.ByteArraySegmentFormatter +static readonly MessagePack.Formatters.ByteFormatter.Instance -> MessagePack.Formatters.ByteFormatter +static readonly MessagePack.Formatters.CharArrayFormatter.Instance -> MessagePack.Formatters.CharArrayFormatter +static readonly MessagePack.Formatters.CharFormatter.Instance -> MessagePack.Formatters.CharFormatter +static readonly MessagePack.Formatters.ComplexFormatter.Instance -> MessagePack.Formatters.IMessagePackFormatter +static readonly MessagePack.Formatters.DateTimeArrayFormatter.Instance -> MessagePack.Formatters.DateTimeArrayFormatter +static readonly MessagePack.Formatters.DateTimeFormatter.Instance -> MessagePack.Formatters.DateTimeFormatter +static readonly MessagePack.Formatters.DateTimeOffsetFormatter.Instance -> MessagePack.Formatters.IMessagePackFormatter +static readonly MessagePack.Formatters.DecimalFormatter.Instance -> MessagePack.Formatters.DecimalFormatter +static readonly MessagePack.Formatters.DoubleArrayFormatter.Instance -> MessagePack.Formatters.DoubleArrayFormatter +static readonly MessagePack.Formatters.DoubleFormatter.Instance -> MessagePack.Formatters.DoubleFormatter +static readonly MessagePack.Formatters.DynamicObjectTypeFallbackFormatter.Instance -> MessagePack.Formatters.IMessagePackFormatter +static readonly MessagePack.Formatters.ForceByteBlockFormatter.Instance -> MessagePack.Formatters.ForceByteBlockFormatter +static readonly MessagePack.Formatters.ForceInt16BlockArrayFormatter.Instance -> MessagePack.Formatters.ForceInt16BlockArrayFormatter +static readonly MessagePack.Formatters.ForceInt16BlockFormatter.Instance -> MessagePack.Formatters.ForceInt16BlockFormatter +static readonly MessagePack.Formatters.ForceInt32BlockArrayFormatter.Instance -> MessagePack.Formatters.ForceInt32BlockArrayFormatter +static readonly MessagePack.Formatters.ForceInt32BlockFormatter.Instance -> MessagePack.Formatters.ForceInt32BlockFormatter +static readonly MessagePack.Formatters.ForceInt64BlockArrayFormatter.Instance -> MessagePack.Formatters.ForceInt64BlockArrayFormatter +static readonly MessagePack.Formatters.ForceInt64BlockFormatter.Instance -> MessagePack.Formatters.ForceInt64BlockFormatter +static readonly MessagePack.Formatters.ForceSByteBlockArrayFormatter.Instance -> MessagePack.Formatters.ForceSByteBlockArrayFormatter +static readonly MessagePack.Formatters.ForceSByteBlockFormatter.Instance -> MessagePack.Formatters.ForceSByteBlockFormatter +static readonly MessagePack.Formatters.ForceUInt16BlockArrayFormatter.Instance -> MessagePack.Formatters.ForceUInt16BlockArrayFormatter +static readonly MessagePack.Formatters.ForceUInt16BlockFormatter.Instance -> MessagePack.Formatters.ForceUInt16BlockFormatter +static readonly MessagePack.Formatters.ForceUInt32BlockArrayFormatter.Instance -> MessagePack.Formatters.ForceUInt32BlockArrayFormatter +static readonly MessagePack.Formatters.ForceUInt32BlockFormatter.Instance -> MessagePack.Formatters.ForceUInt32BlockFormatter +static readonly MessagePack.Formatters.ForceUInt64BlockArrayFormatter.Instance -> MessagePack.Formatters.ForceUInt64BlockArrayFormatter +static readonly MessagePack.Formatters.ForceUInt64BlockFormatter.Instance -> MessagePack.Formatters.ForceUInt64BlockFormatter +static readonly MessagePack.Formatters.GuidFormatter.Instance -> MessagePack.Formatters.IMessagePackFormatter +static readonly MessagePack.Formatters.Int16ArrayFormatter.Instance -> MessagePack.Formatters.Int16ArrayFormatter +static readonly MessagePack.Formatters.Int16Formatter.Instance -> MessagePack.Formatters.Int16Formatter +static readonly MessagePack.Formatters.Int32ArrayFormatter.Instance -> MessagePack.Formatters.Int32ArrayFormatter +static readonly MessagePack.Formatters.Int32Formatter.Instance -> MessagePack.Formatters.Int32Formatter +static readonly MessagePack.Formatters.Int64ArrayFormatter.Instance -> MessagePack.Formatters.Int64ArrayFormatter +static readonly MessagePack.Formatters.Int64Formatter.Instance -> MessagePack.Formatters.Int64Formatter +static readonly MessagePack.Formatters.NativeDateTimeArrayFormatter.Instance -> MessagePack.Formatters.NativeDateTimeArrayFormatter +static readonly MessagePack.Formatters.NativeDateTimeFormatter.Instance -> MessagePack.Formatters.NativeDateTimeFormatter +static readonly MessagePack.Formatters.NativeDecimalFormatter.Instance -> MessagePack.Formatters.IMessagePackFormatter +static readonly MessagePack.Formatters.NativeGuidFormatter.Instance -> MessagePack.Formatters.IMessagePackFormatter +static readonly MessagePack.Formatters.NilFormatter.Instance -> MessagePack.Formatters.IMessagePackFormatter +static readonly MessagePack.Formatters.NonGenericInterfaceDictionaryFormatter.Instance -> MessagePack.Formatters.IMessagePackFormatter +static readonly MessagePack.Formatters.NonGenericInterfaceListFormatter.Instance -> MessagePack.Formatters.IMessagePackFormatter +static readonly MessagePack.Formatters.NullableBooleanFormatter.Instance -> MessagePack.Formatters.NullableBooleanFormatter +static readonly MessagePack.Formatters.NullableByteFormatter.Instance -> MessagePack.Formatters.NullableByteFormatter +static readonly MessagePack.Formatters.NullableCharFormatter.Instance -> MessagePack.Formatters.NullableCharFormatter +static readonly MessagePack.Formatters.NullableDateTimeFormatter.Instance -> MessagePack.Formatters.NullableDateTimeFormatter +static readonly MessagePack.Formatters.NullableDoubleFormatter.Instance -> MessagePack.Formatters.NullableDoubleFormatter +static readonly MessagePack.Formatters.NullableForceByteBlockFormatter.Instance -> MessagePack.Formatters.NullableForceByteBlockFormatter +static readonly MessagePack.Formatters.NullableForceInt16BlockFormatter.Instance -> MessagePack.Formatters.NullableForceInt16BlockFormatter +static readonly MessagePack.Formatters.NullableForceInt32BlockFormatter.Instance -> MessagePack.Formatters.NullableForceInt32BlockFormatter +static readonly MessagePack.Formatters.NullableForceInt64BlockFormatter.Instance -> MessagePack.Formatters.NullableForceInt64BlockFormatter +static readonly MessagePack.Formatters.NullableForceSByteBlockFormatter.Instance -> MessagePack.Formatters.NullableForceSByteBlockFormatter +static readonly MessagePack.Formatters.NullableForceUInt16BlockFormatter.Instance -> MessagePack.Formatters.NullableForceUInt16BlockFormatter +static readonly MessagePack.Formatters.NullableForceUInt32BlockFormatter.Instance -> MessagePack.Formatters.NullableForceUInt32BlockFormatter +static readonly MessagePack.Formatters.NullableForceUInt64BlockFormatter.Instance -> MessagePack.Formatters.NullableForceUInt64BlockFormatter +static readonly MessagePack.Formatters.NullableInt16Formatter.Instance -> MessagePack.Formatters.NullableInt16Formatter +static readonly MessagePack.Formatters.NullableInt32Formatter.Instance -> MessagePack.Formatters.NullableInt32Formatter +static readonly MessagePack.Formatters.NullableInt64Formatter.Instance -> MessagePack.Formatters.NullableInt64Formatter +static readonly MessagePack.Formatters.NullableNilFormatter.Instance -> MessagePack.Formatters.IMessagePackFormatter +static readonly MessagePack.Formatters.NullableSByteFormatter.Instance -> MessagePack.Formatters.NullableSByteFormatter +static readonly MessagePack.Formatters.NullableSingleFormatter.Instance -> MessagePack.Formatters.NullableSingleFormatter +static readonly MessagePack.Formatters.NullableStringArrayFormatter.Instance -> MessagePack.Formatters.NullableStringArrayFormatter +static readonly MessagePack.Formatters.NullableStringFormatter.Instance -> MessagePack.Formatters.NullableStringFormatter +static readonly MessagePack.Formatters.NullableUInt16Formatter.Instance -> MessagePack.Formatters.NullableUInt16Formatter +static readonly MessagePack.Formatters.NullableUInt32Formatter.Instance -> MessagePack.Formatters.NullableUInt32Formatter +static readonly MessagePack.Formatters.NullableUInt64Formatter.Instance -> MessagePack.Formatters.NullableUInt64Formatter +static readonly MessagePack.Formatters.PrimitiveObjectFormatter.Instance -> MessagePack.Formatters.IMessagePackFormatter +static readonly MessagePack.Formatters.SByteArrayFormatter.Instance -> MessagePack.Formatters.SByteArrayFormatter +static readonly MessagePack.Formatters.SByteFormatter.Instance -> MessagePack.Formatters.SByteFormatter +static readonly MessagePack.Formatters.SingleArrayFormatter.Instance -> MessagePack.Formatters.SingleArrayFormatter +static readonly MessagePack.Formatters.SingleFormatter.Instance -> MessagePack.Formatters.SingleFormatter +static readonly MessagePack.Formatters.StringBuilderFormatter.Instance -> MessagePack.Formatters.IMessagePackFormatter +static readonly MessagePack.Formatters.TimeSpanFormatter.Instance -> MessagePack.Formatters.IMessagePackFormatter +static readonly MessagePack.Formatters.TypelessFormatter.Instance -> MessagePack.Formatters.IMessagePackFormatter +static readonly MessagePack.Formatters.UInt16ArrayFormatter.Instance -> MessagePack.Formatters.UInt16ArrayFormatter +static readonly MessagePack.Formatters.UInt16Formatter.Instance -> MessagePack.Formatters.UInt16Formatter +static readonly MessagePack.Formatters.UInt32ArrayFormatter.Instance -> MessagePack.Formatters.UInt32ArrayFormatter +static readonly MessagePack.Formatters.UInt32Formatter.Instance -> MessagePack.Formatters.UInt32Formatter +static readonly MessagePack.Formatters.UInt64ArrayFormatter.Instance -> MessagePack.Formatters.UInt64ArrayFormatter +static readonly MessagePack.Formatters.UInt64Formatter.Instance -> MessagePack.Formatters.UInt64Formatter +static readonly MessagePack.Formatters.UriFormatter.Instance -> MessagePack.Formatters.IMessagePackFormatter +static readonly MessagePack.Formatters.VersionFormatter.Instance -> MessagePack.Formatters.IMessagePackFormatter +static readonly MessagePack.Internal.AutomataKeyGen.GetKeyMethod -> System.Reflection.MethodInfo +static readonly MessagePack.Internal.RuntimeTypeHandleEqualityComparer.Default -> System.Collections.Generic.IEqualityComparer +static readonly MessagePack.Internal.UnsafeMemory.Is32Bit -> bool +static readonly MessagePack.Nil.Default -> MessagePack.Nil +static readonly MessagePack.Resolvers.AttributeFormatterResolver.Instance -> MessagePack.Resolvers.AttributeFormatterResolver +static readonly MessagePack.Resolvers.BuiltinResolver.Instance -> MessagePack.Resolvers.BuiltinResolver +static readonly MessagePack.Resolvers.ContractlessStandardResolver.Instance -> MessagePack.Resolvers.ContractlessStandardResolver +static readonly MessagePack.Resolvers.ContractlessStandardResolver.Options -> MessagePack.MessagePackSerializerOptions +static readonly MessagePack.Resolvers.ContractlessStandardResolverAllowPrivate.Instance -> MessagePack.Resolvers.ContractlessStandardResolverAllowPrivate +static readonly MessagePack.Resolvers.ContractlessStandardResolverAllowPrivate.Options -> MessagePack.MessagePackSerializerOptions +static readonly MessagePack.Resolvers.DynamicContractlessObjectResolver.Instance -> MessagePack.Resolvers.DynamicContractlessObjectResolver +static readonly MessagePack.Resolvers.DynamicContractlessObjectResolverAllowPrivate.Instance -> MessagePack.Resolvers.DynamicContractlessObjectResolverAllowPrivate +static readonly MessagePack.Resolvers.DynamicEnumAsStringResolver.Instance -> MessagePack.Resolvers.DynamicEnumAsStringResolver +static readonly MessagePack.Resolvers.DynamicEnumAsStringResolver.Options -> MessagePack.MessagePackSerializerOptions +static readonly MessagePack.Resolvers.DynamicEnumResolver.Instance -> MessagePack.Resolvers.DynamicEnumResolver +static readonly MessagePack.Resolvers.DynamicGenericResolver.Instance -> MessagePack.Resolvers.DynamicGenericResolver +static readonly MessagePack.Resolvers.DynamicObjectResolver.Instance -> MessagePack.Resolvers.DynamicObjectResolver +static readonly MessagePack.Resolvers.DynamicObjectResolver.Options -> MessagePack.MessagePackSerializerOptions +static readonly MessagePack.Resolvers.DynamicObjectResolverAllowPrivate.Instance -> MessagePack.Resolvers.DynamicObjectResolverAllowPrivate +static readonly MessagePack.Resolvers.DynamicUnionResolver.Instance -> MessagePack.Resolvers.DynamicUnionResolver +static readonly MessagePack.Resolvers.DynamicUnionResolver.Options -> MessagePack.MessagePackSerializerOptions +static readonly MessagePack.Resolvers.NativeDateTimeResolver.Instance -> MessagePack.Resolvers.NativeDateTimeResolver +static readonly MessagePack.Resolvers.NativeDateTimeResolver.Options -> MessagePack.MessagePackSerializerOptions +static readonly MessagePack.Resolvers.NativeDecimalResolver.Instance -> MessagePack.Resolvers.NativeDecimalResolver +static readonly MessagePack.Resolvers.NativeGuidResolver.Instance -> MessagePack.Resolvers.NativeGuidResolver +static readonly MessagePack.Resolvers.PrimitiveObjectResolver.Instance -> MessagePack.Resolvers.PrimitiveObjectResolver +static readonly MessagePack.Resolvers.PrimitiveObjectResolver.Options -> MessagePack.MessagePackSerializerOptions +static readonly MessagePack.Resolvers.StandardResolver.Instance -> MessagePack.Resolvers.StandardResolver +static readonly MessagePack.Resolvers.StandardResolver.Options -> MessagePack.MessagePackSerializerOptions +static readonly MessagePack.Resolvers.StandardResolverAllowPrivate.Instance -> MessagePack.Resolvers.StandardResolverAllowPrivate +static readonly MessagePack.Resolvers.StandardResolverAllowPrivate.Options -> MessagePack.MessagePackSerializerOptions +static readonly MessagePack.Resolvers.StaticCompositeResolver.Instance -> MessagePack.Resolvers.StaticCompositeResolver +static readonly MessagePack.Resolvers.TypelessContractlessStandardResolver.Instance -> MessagePack.Resolvers.TypelessContractlessStandardResolver +static readonly MessagePack.Resolvers.TypelessContractlessStandardResolver.Options -> MessagePack.MessagePackSerializerOptions +static readonly MessagePack.Resolvers.TypelessObjectResolver.Instance -> MessagePack.IFormatterResolver +virtual MessagePack.Formatters.CollectionFormatterBase.GetCount(TCollection sequence) -> int? +virtual MessagePack.MessagePackSerializerOptions.Clone() -> MessagePack.MessagePackSerializerOptions +virtual MessagePack.MessagePackSerializerOptions.LoadType(string typeName) -> System.Type +virtual MessagePack.MessagePackSerializerOptions.ThrowIfDeserializingTypeIsDisallowed(System.Type type) -> void +MessagePack.ExtensionHeader.Equals(MessagePack.ExtensionHeader other) -> bool +MessagePack.Formatters.InterfaceCollectionFormatter2 +MessagePack.Formatters.InterfaceCollectionFormatter2.InterfaceCollectionFormatter2() -> void +MessagePack.Formatters.InterfaceListFormatter2 +MessagePack.Formatters.InterfaceListFormatter2.InterfaceListFormatter2() -> void +MessagePack.MessagePackReader.Depth.get -> int +MessagePack.MessagePackReader.Depth.set -> void +MessagePack.MessagePackReader.ReadDateTime(MessagePack.ExtensionHeader header) -> System.DateTime +MessagePack.MessagePackReader.TryReadArrayHeader(out int count) -> bool +MessagePack.MessagePackReader.TryReadExtensionFormatHeader(out MessagePack.ExtensionHeader extensionHeader) -> bool +MessagePack.MessagePackReader.TryReadMapHeader(out int count) -> bool +MessagePack.MessagePackSecurity +MessagePack.MessagePackSecurity.DepthStep(ref MessagePack.MessagePackReader reader) -> void +MessagePack.MessagePackSecurity.GetEqualityComparer() -> System.Collections.IEqualityComparer +MessagePack.MessagePackSecurity.GetEqualityComparer() -> System.Collections.Generic.IEqualityComparer +MessagePack.MessagePackSecurity.HashCollisionResistant.get -> bool +MessagePack.MessagePackSecurity.MaximumObjectGraphDepth.get -> int +MessagePack.MessagePackSecurity.MessagePackSecurity(MessagePack.MessagePackSecurity copyFrom) -> void +MessagePack.MessagePackSecurity.WithHashCollisionResistant(bool hashCollisionResistant) -> MessagePack.MessagePackSecurity +MessagePack.MessagePackSecurity.WithMaximumObjectGraphDepth(int maximumObjectGraphDepth) -> MessagePack.MessagePackSecurity +MessagePack.MessagePackSerializerOptions.Security.get -> MessagePack.MessagePackSecurity +MessagePack.MessagePackSerializerOptions.WithSecurity(MessagePack.MessagePackSecurity security) -> MessagePack.MessagePackSerializerOptions +MessagePack.MessagePackStreamReader.DiscardBufferedData() -> void +MessagePack.MessagePackStreamReader.MessagePackStreamReader(System.IO.Stream stream, bool leaveOpen) -> void +MessagePack.MessagePackStreamReader.ReadArrayAsync(System.Threading.CancellationToken cancellationToken) -> System.Collections.Generic.IAsyncEnumerable> +MessagePack.MessagePackWriter.WriteBinHeader(int length) -> void +MessagePack.MessagePackWriter.WriteStringHeader(int byteCount) -> void +static readonly MessagePack.MessagePackSecurity.TrustedData -> MessagePack.MessagePackSecurity +static readonly MessagePack.MessagePackSecurity.UntrustedData -> MessagePack.MessagePackSecurity +virtual MessagePack.MessagePackSecurity.Clone() -> MessagePack.MessagePackSecurity +virtual MessagePack.MessagePackSecurity.GetHashCollisionResistantEqualityComparer() -> System.Collections.IEqualityComparer +virtual MessagePack.MessagePackSecurity.GetHashCollisionResistantEqualityComparer() -> System.Collections.Generic.IEqualityComparer +MessagePack.Formatters.ByteMemoryFormatter +MessagePack.Formatters.ByteMemoryFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> System.Memory +MessagePack.Formatters.ByteMemoryFormatter.Serialize(ref MessagePack.MessagePackWriter writer, System.Memory value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.ByteReadOnlyMemoryFormatter +MessagePack.Formatters.ByteReadOnlyMemoryFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> System.ReadOnlyMemory +MessagePack.Formatters.ByteReadOnlyMemoryFormatter.Serialize(ref MessagePack.MessagePackWriter writer, System.ReadOnlyMemory value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.ByteReadOnlySequenceFormatter +MessagePack.Formatters.ByteReadOnlySequenceFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> System.Buffers.ReadOnlySequence +MessagePack.Formatters.ByteReadOnlySequenceFormatter.Serialize(ref MessagePack.MessagePackWriter writer, System.Buffers.ReadOnlySequence value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.ExpandoObjectFormatter +MessagePack.Formatters.ExpandoObjectFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> System.Dynamic.ExpandoObject +MessagePack.Formatters.ExpandoObjectFormatter.Serialize(ref MessagePack.MessagePackWriter writer, System.Dynamic.ExpandoObject value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.ForceTypelessFormatter +MessagePack.Formatters.ForceTypelessFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> T +MessagePack.Formatters.ForceTypelessFormatter.ForceTypelessFormatter() -> void +MessagePack.Formatters.ForceTypelessFormatter.Serialize(ref MessagePack.MessagePackWriter writer, T value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.MemoryFormatter +MessagePack.Formatters.MemoryFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> System.Memory +MessagePack.Formatters.MemoryFormatter.MemoryFormatter() -> void +MessagePack.Formatters.MemoryFormatter.Serialize(ref MessagePack.MessagePackWriter writer, System.Memory value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.NonGenericInterfaceCollectionFormatter +MessagePack.Formatters.NonGenericInterfaceCollectionFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> System.Collections.ICollection +MessagePack.Formatters.NonGenericInterfaceCollectionFormatter.Serialize(ref MessagePack.MessagePackWriter writer, System.Collections.ICollection value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.NonGenericInterfaceEnumerableFormatter +MessagePack.Formatters.NonGenericInterfaceEnumerableFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> System.Collections.IEnumerable +MessagePack.Formatters.NonGenericInterfaceEnumerableFormatter.Serialize(ref MessagePack.MessagePackWriter writer, System.Collections.IEnumerable value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.PrimitiveObjectFormatter.PrimitiveObjectFormatter() -> void +MessagePack.Formatters.ReadOnlyMemoryFormatter +MessagePack.Formatters.ReadOnlyMemoryFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> System.ReadOnlyMemory +MessagePack.Formatters.ReadOnlyMemoryFormatter.ReadOnlyMemoryFormatter() -> void +MessagePack.Formatters.ReadOnlyMemoryFormatter.Serialize(ref MessagePack.MessagePackWriter writer, System.ReadOnlyMemory value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.ReadOnlySequenceFormatter +MessagePack.Formatters.ReadOnlySequenceFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> System.Buffers.ReadOnlySequence +MessagePack.Formatters.ReadOnlySequenceFormatter.ReadOnlySequenceFormatter() -> void +MessagePack.Formatters.ReadOnlySequenceFormatter.Serialize(ref MessagePack.MessagePackWriter writer, System.Buffers.ReadOnlySequence value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.TypeFormatter +MessagePack.Formatters.TypeFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> T +MessagePack.Formatters.TypeFormatter.Serialize(ref MessagePack.MessagePackWriter writer, T value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.TypelessFormatter.TypelessFormatter() -> void +MessagePack.ImmutableCollection.ImmutableArrayFormatter +MessagePack.ImmutableCollection.ImmutableArrayFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> System.Collections.Immutable.ImmutableArray +MessagePack.ImmutableCollection.ImmutableArrayFormatter.ImmutableArrayFormatter() -> void +MessagePack.ImmutableCollection.ImmutableArrayFormatter.Serialize(ref MessagePack.MessagePackWriter writer, System.Collections.Immutable.ImmutableArray value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.ImmutableCollection.ImmutableCollectionResolver +MessagePack.ImmutableCollection.ImmutableCollectionResolver.GetFormatter() -> MessagePack.Formatters.IMessagePackFormatter +MessagePack.ImmutableCollection.ImmutableDictionaryFormatter +MessagePack.ImmutableCollection.ImmutableDictionaryFormatter.ImmutableDictionaryFormatter() -> void +MessagePack.ImmutableCollection.ImmutableHashSetFormatter +MessagePack.ImmutableCollection.ImmutableHashSetFormatter.ImmutableHashSetFormatter() -> void +MessagePack.ImmutableCollection.ImmutableListFormatter +MessagePack.ImmutableCollection.ImmutableListFormatter.ImmutableListFormatter() -> void +MessagePack.ImmutableCollection.ImmutableQueueBuilder +MessagePack.ImmutableCollection.ImmutableQueueBuilder.Add(T value) -> void +MessagePack.ImmutableCollection.ImmutableQueueBuilder.ImmutableQueueBuilder() -> void +MessagePack.ImmutableCollection.ImmutableQueueBuilder.Q.get -> System.Collections.Immutable.ImmutableQueue +MessagePack.ImmutableCollection.ImmutableQueueBuilder.Q.set -> void +MessagePack.ImmutableCollection.ImmutableQueueFormatter +MessagePack.ImmutableCollection.ImmutableQueueFormatter.ImmutableQueueFormatter() -> void +MessagePack.ImmutableCollection.ImmutableSortedDictionaryFormatter +MessagePack.ImmutableCollection.ImmutableSortedDictionaryFormatter.ImmutableSortedDictionaryFormatter() -> void +MessagePack.ImmutableCollection.ImmutableSortedSetFormatter +MessagePack.ImmutableCollection.ImmutableSortedSetFormatter.ImmutableSortedSetFormatter() -> void +MessagePack.ImmutableCollection.ImmutableStackFormatter +MessagePack.ImmutableCollection.ImmutableStackFormatter.ImmutableStackFormatter() -> void +MessagePack.ImmutableCollection.InterfaceImmutableDictionaryFormatter +MessagePack.ImmutableCollection.InterfaceImmutableDictionaryFormatter.InterfaceImmutableDictionaryFormatter() -> void +MessagePack.ImmutableCollection.InterfaceImmutableListFormatter +MessagePack.ImmutableCollection.InterfaceImmutableListFormatter.InterfaceImmutableListFormatter() -> void +MessagePack.ImmutableCollection.InterfaceImmutableQueueFormatter +MessagePack.ImmutableCollection.InterfaceImmutableQueueFormatter.InterfaceImmutableQueueFormatter() -> void +MessagePack.ImmutableCollection.InterfaceImmutableSetFormatter +MessagePack.ImmutableCollection.InterfaceImmutableSetFormatter.InterfaceImmutableSetFormatter() -> void +MessagePack.ImmutableCollection.InterfaceImmutableStackFormatter +MessagePack.ImmutableCollection.InterfaceImmutableStackFormatter.InterfaceImmutableStackFormatter() -> void +MessagePack.Resolvers.ExpandoObjectResolver +override MessagePack.ImmutableCollection.ImmutableDictionaryFormatter.Add(System.Collections.Immutable.ImmutableDictionary.Builder collection, int index, TKey key, TValue value, MessagePack.MessagePackSerializerOptions options) -> void +override MessagePack.ImmutableCollection.ImmutableDictionaryFormatter.Complete(System.Collections.Immutable.ImmutableDictionary.Builder intermediateCollection) -> System.Collections.Immutable.ImmutableDictionary +override MessagePack.ImmutableCollection.ImmutableDictionaryFormatter.Create(int count, MessagePack.MessagePackSerializerOptions options) -> System.Collections.Immutable.ImmutableDictionary.Builder +override MessagePack.ImmutableCollection.ImmutableDictionaryFormatter.GetSourceEnumerator(System.Collections.Immutable.ImmutableDictionary source) -> System.Collections.Immutable.ImmutableDictionary.Enumerator +override MessagePack.ImmutableCollection.ImmutableHashSetFormatter.Add(System.Collections.Immutable.ImmutableHashSet.Builder collection, int index, T value, MessagePack.MessagePackSerializerOptions options) -> void +override MessagePack.ImmutableCollection.ImmutableHashSetFormatter.Complete(System.Collections.Immutable.ImmutableHashSet.Builder intermediateCollection) -> System.Collections.Immutable.ImmutableHashSet +override MessagePack.ImmutableCollection.ImmutableHashSetFormatter.Create(int count, MessagePack.MessagePackSerializerOptions options) -> System.Collections.Immutable.ImmutableHashSet.Builder +override MessagePack.ImmutableCollection.ImmutableHashSetFormatter.GetSourceEnumerator(System.Collections.Immutable.ImmutableHashSet source) -> System.Collections.Immutable.ImmutableHashSet.Enumerator +override MessagePack.ImmutableCollection.ImmutableListFormatter.Add(System.Collections.Immutable.ImmutableList.Builder collection, int index, T value, MessagePack.MessagePackSerializerOptions options) -> void +override MessagePack.ImmutableCollection.ImmutableListFormatter.Complete(System.Collections.Immutable.ImmutableList.Builder intermediateCollection) -> System.Collections.Immutable.ImmutableList +override MessagePack.ImmutableCollection.ImmutableListFormatter.Create(int count, MessagePack.MessagePackSerializerOptions options) -> System.Collections.Immutable.ImmutableList.Builder +override MessagePack.ImmutableCollection.ImmutableListFormatter.GetSourceEnumerator(System.Collections.Immutable.ImmutableList source) -> System.Collections.Immutable.ImmutableList.Enumerator +override MessagePack.ImmutableCollection.ImmutableQueueFormatter.Add(MessagePack.ImmutableCollection.ImmutableQueueBuilder collection, int index, T value, MessagePack.MessagePackSerializerOptions options) -> void +override MessagePack.ImmutableCollection.ImmutableQueueFormatter.Complete(MessagePack.ImmutableCollection.ImmutableQueueBuilder intermediateCollection) -> System.Collections.Immutable.ImmutableQueue +override MessagePack.ImmutableCollection.ImmutableQueueFormatter.Create(int count, MessagePack.MessagePackSerializerOptions options) -> MessagePack.ImmutableCollection.ImmutableQueueBuilder +override MessagePack.ImmutableCollection.ImmutableSortedDictionaryFormatter.Add(System.Collections.Immutable.ImmutableSortedDictionary.Builder collection, int index, TKey key, TValue value, MessagePack.MessagePackSerializerOptions options) -> void +override MessagePack.ImmutableCollection.ImmutableSortedDictionaryFormatter.Complete(System.Collections.Immutable.ImmutableSortedDictionary.Builder intermediateCollection) -> System.Collections.Immutable.ImmutableSortedDictionary +override MessagePack.ImmutableCollection.ImmutableSortedDictionaryFormatter.Create(int count, MessagePack.MessagePackSerializerOptions options) -> System.Collections.Immutable.ImmutableSortedDictionary.Builder +override MessagePack.ImmutableCollection.ImmutableSortedDictionaryFormatter.GetSourceEnumerator(System.Collections.Immutable.ImmutableSortedDictionary source) -> System.Collections.Immutable.ImmutableSortedDictionary.Enumerator +override MessagePack.ImmutableCollection.ImmutableSortedSetFormatter.Add(System.Collections.Immutable.ImmutableSortedSet.Builder collection, int index, T value, MessagePack.MessagePackSerializerOptions options) -> void +override MessagePack.ImmutableCollection.ImmutableSortedSetFormatter.Complete(System.Collections.Immutable.ImmutableSortedSet.Builder intermediateCollection) -> System.Collections.Immutable.ImmutableSortedSet +override MessagePack.ImmutableCollection.ImmutableSortedSetFormatter.Create(int count, MessagePack.MessagePackSerializerOptions options) -> System.Collections.Immutable.ImmutableSortedSet.Builder +override MessagePack.ImmutableCollection.ImmutableSortedSetFormatter.GetSourceEnumerator(System.Collections.Immutable.ImmutableSortedSet source) -> System.Collections.Immutable.ImmutableSortedSet.Enumerator +override MessagePack.ImmutableCollection.ImmutableStackFormatter.Add(T[] collection, int index, T value, MessagePack.MessagePackSerializerOptions options) -> void +override MessagePack.ImmutableCollection.ImmutableStackFormatter.Complete(T[] intermediateCollection) -> System.Collections.Immutable.ImmutableStack +override MessagePack.ImmutableCollection.ImmutableStackFormatter.Create(int count, MessagePack.MessagePackSerializerOptions options) -> T[] +override MessagePack.ImmutableCollection.InterfaceImmutableDictionaryFormatter.Add(System.Collections.Immutable.ImmutableDictionary.Builder collection, int index, TKey key, TValue value, MessagePack.MessagePackSerializerOptions options) -> void +override MessagePack.ImmutableCollection.InterfaceImmutableDictionaryFormatter.Complete(System.Collections.Immutable.ImmutableDictionary.Builder intermediateCollection) -> System.Collections.Immutable.IImmutableDictionary +override MessagePack.ImmutableCollection.InterfaceImmutableDictionaryFormatter.Create(int count, MessagePack.MessagePackSerializerOptions options) -> System.Collections.Immutable.ImmutableDictionary.Builder +override MessagePack.ImmutableCollection.InterfaceImmutableListFormatter.Add(System.Collections.Immutable.ImmutableList.Builder collection, int index, T value, MessagePack.MessagePackSerializerOptions options) -> void +override MessagePack.ImmutableCollection.InterfaceImmutableListFormatter.Complete(System.Collections.Immutable.ImmutableList.Builder intermediateCollection) -> System.Collections.Immutable.IImmutableList +override MessagePack.ImmutableCollection.InterfaceImmutableListFormatter.Create(int count, MessagePack.MessagePackSerializerOptions options) -> System.Collections.Immutable.ImmutableList.Builder +override MessagePack.ImmutableCollection.InterfaceImmutableQueueFormatter.Add(MessagePack.ImmutableCollection.ImmutableQueueBuilder collection, int index, T value, MessagePack.MessagePackSerializerOptions options) -> void +override MessagePack.ImmutableCollection.InterfaceImmutableQueueFormatter.Complete(MessagePack.ImmutableCollection.ImmutableQueueBuilder intermediateCollection) -> System.Collections.Immutable.IImmutableQueue +override MessagePack.ImmutableCollection.InterfaceImmutableQueueFormatter.Create(int count, MessagePack.MessagePackSerializerOptions options) -> MessagePack.ImmutableCollection.ImmutableQueueBuilder +override MessagePack.ImmutableCollection.InterfaceImmutableSetFormatter.Add(System.Collections.Immutable.ImmutableHashSet.Builder collection, int index, T value, MessagePack.MessagePackSerializerOptions options) -> void +override MessagePack.ImmutableCollection.InterfaceImmutableSetFormatter.Complete(System.Collections.Immutable.ImmutableHashSet.Builder intermediateCollection) -> System.Collections.Immutable.IImmutableSet +override MessagePack.ImmutableCollection.InterfaceImmutableSetFormatter.Create(int count, MessagePack.MessagePackSerializerOptions options) -> System.Collections.Immutable.ImmutableHashSet.Builder +override MessagePack.ImmutableCollection.InterfaceImmutableStackFormatter.Add(T[] collection, int index, T value, MessagePack.MessagePackSerializerOptions options) -> void +override MessagePack.ImmutableCollection.InterfaceImmutableStackFormatter.Complete(T[] intermediateCollection) -> System.Collections.Immutable.IImmutableStack +override MessagePack.ImmutableCollection.InterfaceImmutableStackFormatter.Create(int count, MessagePack.MessagePackSerializerOptions options) -> T[] +static readonly MessagePack.Formatters.ByteMemoryFormatter.Instance -> MessagePack.Formatters.ByteMemoryFormatter +static readonly MessagePack.Formatters.ByteReadOnlyMemoryFormatter.Instance -> MessagePack.Formatters.ByteReadOnlyMemoryFormatter +static readonly MessagePack.Formatters.ByteReadOnlySequenceFormatter.Instance -> MessagePack.Formatters.ByteReadOnlySequenceFormatter +static readonly MessagePack.Formatters.ExpandoObjectFormatter.Instance -> MessagePack.Formatters.IMessagePackFormatter +static readonly MessagePack.Formatters.NonGenericInterfaceCollectionFormatter.Instance -> MessagePack.Formatters.IMessagePackFormatter +static readonly MessagePack.Formatters.NonGenericInterfaceEnumerableFormatter.Instance -> MessagePack.Formatters.IMessagePackFormatter +static readonly MessagePack.Formatters.TypeFormatter.Instance -> MessagePack.Formatters.IMessagePackFormatter +static readonly MessagePack.ImmutableCollection.ImmutableCollectionResolver.Instance -> MessagePack.ImmutableCollection.ImmutableCollectionResolver +static readonly MessagePack.Resolvers.ExpandoObjectResolver.Instance -> MessagePack.IFormatterResolver +static readonly MessagePack.Resolvers.ExpandoObjectResolver.Options -> MessagePack.MessagePackSerializerOptions +virtual MessagePack.Formatters.PrimitiveObjectFormatter.DeserializeMap(ref MessagePack.MessagePackReader reader, int length, MessagePack.MessagePackSerializerOptions options) -> object +MessagePack.ExtensionHeader.ExtensionHeader() -> void +MessagePack.ExtensionResult.ExtensionResult() -> void +MessagePack.FormatterNotRegisteredException.FormatterNotRegisteredException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) -> void +MessagePack.Formatters.HalfFormatter +MessagePack.Formatters.HalfFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> System.Half +MessagePack.Formatters.HalfFormatter.Serialize(ref MessagePack.MessagePackWriter writer, System.Half value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.InterfaceReadOnlySetFormatter +MessagePack.Formatters.InterfaceReadOnlySetFormatter.InterfaceReadOnlySetFormatter() -> void +MessagePack.MessagePackReader.MessagePackReader() -> void +MessagePack.MessagePackSerializerOptions.SequencePool.get -> MessagePack.SequencePool +MessagePack.MessagePackSerializerOptions.WithPool(MessagePack.SequencePool pool) -> MessagePack.MessagePackSerializerOptions +MessagePack.MessagePackStreamReader.MessagePackStreamReader(System.IO.Stream stream, bool leaveOpen, MessagePack.SequencePool sequencePool) -> void +MessagePack.MessagePackStreamReader.ReadArrayHeaderAsync(System.Threading.CancellationToken cancellationToken) -> System.Threading.Tasks.ValueTask +MessagePack.MessagePackStreamReader.ReadMapHeaderAsync(System.Threading.CancellationToken cancellationToken) -> System.Threading.Tasks.ValueTask +MessagePack.MessagePackWriter.MessagePackWriter() -> void +MessagePack.SequencePool +MessagePack.SequencePool.SequencePool() -> void +MessagePack.SequencePool.SequencePool(int maxSize) -> void +MessagePack.SequencePool.SequencePool(int maxSize, System.Buffers.ArrayPool arrayPool) -> void +MessagePack.TinyJsonException.TinyJsonException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) -> void +static MessagePack.Nil.operator !=(MessagePack.Nil left, MessagePack.Nil right) -> bool +static MessagePack.Nil.operator ==(MessagePack.Nil left, MessagePack.Nil right) -> bool +static readonly MessagePack.Formatters.HalfFormatter.Instance -> MessagePack.Formatters.IMessagePackFormatter +virtual MessagePack.MessagePackStreamReader.Dispose(bool disposing) -> void +MessagePack.Formatters.GenericEnumerableFormatter +MessagePack.Formatters.GenericEnumerableFormatter.GenericEnumerableFormatter() -> void +MessagePack.Formatters.GenericReadOnlyDictionaryFormatter +MessagePack.Formatters.GenericReadOnlyDictionaryFormatter.GenericReadOnlyDictionaryFormatter() -> void diff --git a/src/MessagePack/net5.0/PublicAPI.Unshipped.txt b/src/MessagePack/net5.0/PublicAPI.Unshipped.txt new file mode 100644 index 000000000..49e84ad1e --- /dev/null +++ b/src/MessagePack/net5.0/PublicAPI.Unshipped.txt @@ -0,0 +1,6 @@ +MessagePack.Formatters.StringInterningFormatter +MessagePack.Formatters.StringInterningFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> string +MessagePack.Formatters.StringInterningFormatter.Serialize(ref MessagePack.MessagePackWriter writer, string value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.StringInterningFormatter.StringInterningFormatter() -> void +MessagePack.MessagePackSerializerOptions.CompressionMinLength.get -> int +MessagePack.MessagePackSerializerOptions.WithCompressionMinLength(int compressionMinLength) -> MessagePack.MessagePackSerializerOptions \ No newline at end of file diff --git a/src/MessagePack/net6.0/PublicAPI.Shipped.txt b/src/MessagePack/net6.0/PublicAPI.Shipped.txt new file mode 100644 index 000000000..b0a1a3dc2 --- /dev/null +++ b/src/MessagePack/net6.0/PublicAPI.Shipped.txt @@ -0,0 +1,1180 @@ +MessagePack.ExtensionHeader +MessagePack.ExtensionHeader.ExtensionHeader(sbyte typeCode, int length) -> void +MessagePack.ExtensionHeader.ExtensionHeader(sbyte typeCode, uint length) -> void +MessagePack.ExtensionHeader.Length.get -> uint +MessagePack.ExtensionHeader.TypeCode.get -> sbyte +MessagePack.ExtensionResult +MessagePack.ExtensionResult.Data.get -> System.Buffers.ReadOnlySequence +MessagePack.ExtensionResult.ExtensionResult(sbyte typeCode, System.Buffers.ReadOnlySequence data) -> void +MessagePack.ExtensionResult.ExtensionResult(sbyte typeCode, System.Memory data) -> void +MessagePack.ExtensionResult.Header.get -> MessagePack.ExtensionHeader +MessagePack.ExtensionResult.TypeCode.get -> sbyte +MessagePack.FormatterNotRegisteredException +MessagePack.FormatterNotRegisteredException.FormatterNotRegisteredException(string message) -> void +MessagePack.FormatterResolverExtensions +MessagePack.Formatters.ArrayFormatter +MessagePack.Formatters.ArrayFormatter.ArrayFormatter() -> void +MessagePack.Formatters.ArrayFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> T[] +MessagePack.Formatters.ArrayFormatter.Serialize(ref MessagePack.MessagePackWriter writer, T[] value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.ArraySegmentFormatter +MessagePack.Formatters.ArraySegmentFormatter.ArraySegmentFormatter() -> void +MessagePack.Formatters.ArraySegmentFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> System.ArraySegment +MessagePack.Formatters.ArraySegmentFormatter.Serialize(ref MessagePack.MessagePackWriter writer, System.ArraySegment value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.BigIntegerFormatter +MessagePack.Formatters.BigIntegerFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> System.Numerics.BigInteger +MessagePack.Formatters.BigIntegerFormatter.Serialize(ref MessagePack.MessagePackWriter writer, System.Numerics.BigInteger value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.BitArrayFormatter +MessagePack.Formatters.BitArrayFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> System.Collections.BitArray +MessagePack.Formatters.BitArrayFormatter.Serialize(ref MessagePack.MessagePackWriter writer, System.Collections.BitArray value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.BooleanArrayFormatter +MessagePack.Formatters.BooleanArrayFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> bool[] +MessagePack.Formatters.BooleanArrayFormatter.Serialize(ref MessagePack.MessagePackWriter writer, bool[] value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.BooleanFormatter +MessagePack.Formatters.BooleanFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> bool +MessagePack.Formatters.BooleanFormatter.Serialize(ref MessagePack.MessagePackWriter writer, bool value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.ByteArrayFormatter +MessagePack.Formatters.ByteArrayFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> byte[] +MessagePack.Formatters.ByteArrayFormatter.Serialize(ref MessagePack.MessagePackWriter writer, byte[] value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.ByteArraySegmentFormatter +MessagePack.Formatters.ByteArraySegmentFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> System.ArraySegment +MessagePack.Formatters.ByteArraySegmentFormatter.Serialize(ref MessagePack.MessagePackWriter writer, System.ArraySegment value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.ByteFormatter +MessagePack.Formatters.ByteFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> byte +MessagePack.Formatters.ByteFormatter.Serialize(ref MessagePack.MessagePackWriter writer, byte value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.CharArrayFormatter +MessagePack.Formatters.CharArrayFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> char[] +MessagePack.Formatters.CharArrayFormatter.Serialize(ref MessagePack.MessagePackWriter writer, char[] value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.CharFormatter +MessagePack.Formatters.CharFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> char +MessagePack.Formatters.CharFormatter.Serialize(ref MessagePack.MessagePackWriter writer, char value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.CollectionFormatterBase +MessagePack.Formatters.CollectionFormatterBase.CollectionFormatterBase() -> void +MessagePack.Formatters.CollectionFormatterBase +MessagePack.Formatters.CollectionFormatterBase.CollectionFormatterBase() -> void +MessagePack.Formatters.CollectionFormatterBase +MessagePack.Formatters.CollectionFormatterBase.CollectionFormatterBase() -> void +MessagePack.Formatters.CollectionFormatterBase.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> TCollection +MessagePack.Formatters.CollectionFormatterBase.Serialize(ref MessagePack.MessagePackWriter writer, TCollection value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.ComplexFormatter +MessagePack.Formatters.ComplexFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> System.Numerics.Complex +MessagePack.Formatters.ComplexFormatter.Serialize(ref MessagePack.MessagePackWriter writer, System.Numerics.Complex value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.ConcurrentBagFormatter +MessagePack.Formatters.ConcurrentBagFormatter.ConcurrentBagFormatter() -> void +MessagePack.Formatters.ConcurrentDictionaryFormatter +MessagePack.Formatters.ConcurrentDictionaryFormatter.ConcurrentDictionaryFormatter() -> void +MessagePack.Formatters.ConcurrentQueueFormatter +MessagePack.Formatters.ConcurrentQueueFormatter.ConcurrentQueueFormatter() -> void +MessagePack.Formatters.ConcurrentStackFormatter +MessagePack.Formatters.ConcurrentStackFormatter.ConcurrentStackFormatter() -> void +MessagePack.Formatters.DateTimeArrayFormatter +MessagePack.Formatters.DateTimeArrayFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> System.DateTime[] +MessagePack.Formatters.DateTimeArrayFormatter.Serialize(ref MessagePack.MessagePackWriter writer, System.DateTime[] value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.DateTimeFormatter +MessagePack.Formatters.DateTimeFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> System.DateTime +MessagePack.Formatters.DateTimeFormatter.Serialize(ref MessagePack.MessagePackWriter writer, System.DateTime value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.DateTimeOffsetFormatter +MessagePack.Formatters.DateTimeOffsetFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> System.DateTimeOffset +MessagePack.Formatters.DateTimeOffsetFormatter.Serialize(ref MessagePack.MessagePackWriter writer, System.DateTimeOffset value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.DecimalFormatter +MessagePack.Formatters.DecimalFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> decimal +MessagePack.Formatters.DecimalFormatter.Serialize(ref MessagePack.MessagePackWriter writer, decimal value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.DictionaryFormatter +MessagePack.Formatters.DictionaryFormatter.DictionaryFormatter() -> void +MessagePack.Formatters.DictionaryFormatterBase +MessagePack.Formatters.DictionaryFormatterBase.DictionaryFormatterBase() -> void +MessagePack.Formatters.DictionaryFormatterBase +MessagePack.Formatters.DictionaryFormatterBase.DictionaryFormatterBase() -> void +MessagePack.Formatters.DictionaryFormatterBase +MessagePack.Formatters.DictionaryFormatterBase.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> TDictionary +MessagePack.Formatters.DictionaryFormatterBase.DictionaryFormatterBase() -> void +MessagePack.Formatters.DictionaryFormatterBase.Serialize(ref MessagePack.MessagePackWriter writer, TDictionary value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.DoubleArrayFormatter +MessagePack.Formatters.DoubleArrayFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> double[] +MessagePack.Formatters.DoubleArrayFormatter.Serialize(ref MessagePack.MessagePackWriter writer, double[] value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.DoubleFormatter +MessagePack.Formatters.DoubleFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> double +MessagePack.Formatters.DoubleFormatter.Serialize(ref MessagePack.MessagePackWriter writer, double value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.DynamicObjectTypeFallbackFormatter +MessagePack.Formatters.DynamicObjectTypeFallbackFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> object +MessagePack.Formatters.DynamicObjectTypeFallbackFormatter.Serialize(ref MessagePack.MessagePackWriter writer, object value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.EnumAsStringFormatter +MessagePack.Formatters.EnumAsStringFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> T +MessagePack.Formatters.EnumAsStringFormatter.EnumAsStringFormatter() -> void +MessagePack.Formatters.EnumAsStringFormatter.Serialize(ref MessagePack.MessagePackWriter writer, T value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.ForceByteBlockFormatter +MessagePack.Formatters.ForceByteBlockFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> byte +MessagePack.Formatters.ForceByteBlockFormatter.Serialize(ref MessagePack.MessagePackWriter writer, byte value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.ForceInt16BlockArrayFormatter +MessagePack.Formatters.ForceInt16BlockArrayFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> short[] +MessagePack.Formatters.ForceInt16BlockArrayFormatter.Serialize(ref MessagePack.MessagePackWriter writer, short[] value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.ForceInt16BlockFormatter +MessagePack.Formatters.ForceInt16BlockFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> short +MessagePack.Formatters.ForceInt16BlockFormatter.Serialize(ref MessagePack.MessagePackWriter writer, short value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.ForceInt32BlockArrayFormatter +MessagePack.Formatters.ForceInt32BlockArrayFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> int[] +MessagePack.Formatters.ForceInt32BlockArrayFormatter.Serialize(ref MessagePack.MessagePackWriter writer, int[] value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.ForceInt32BlockFormatter +MessagePack.Formatters.ForceInt32BlockFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> int +MessagePack.Formatters.ForceInt32BlockFormatter.Serialize(ref MessagePack.MessagePackWriter writer, int value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.ForceInt64BlockArrayFormatter +MessagePack.Formatters.ForceInt64BlockArrayFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> long[] +MessagePack.Formatters.ForceInt64BlockArrayFormatter.Serialize(ref MessagePack.MessagePackWriter writer, long[] value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.ForceInt64BlockFormatter +MessagePack.Formatters.ForceInt64BlockFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> long +MessagePack.Formatters.ForceInt64BlockFormatter.Serialize(ref MessagePack.MessagePackWriter writer, long value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.ForceSByteBlockArrayFormatter +MessagePack.Formatters.ForceSByteBlockArrayFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> sbyte[] +MessagePack.Formatters.ForceSByteBlockArrayFormatter.Serialize(ref MessagePack.MessagePackWriter writer, sbyte[] value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.ForceSByteBlockFormatter +MessagePack.Formatters.ForceSByteBlockFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> sbyte +MessagePack.Formatters.ForceSByteBlockFormatter.Serialize(ref MessagePack.MessagePackWriter writer, sbyte value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.ForceUInt16BlockArrayFormatter +MessagePack.Formatters.ForceUInt16BlockArrayFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> ushort[] +MessagePack.Formatters.ForceUInt16BlockArrayFormatter.Serialize(ref MessagePack.MessagePackWriter writer, ushort[] value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.ForceUInt16BlockFormatter +MessagePack.Formatters.ForceUInt16BlockFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> ushort +MessagePack.Formatters.ForceUInt16BlockFormatter.Serialize(ref MessagePack.MessagePackWriter writer, ushort value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.ForceUInt32BlockArrayFormatter +MessagePack.Formatters.ForceUInt32BlockArrayFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> uint[] +MessagePack.Formatters.ForceUInt32BlockArrayFormatter.Serialize(ref MessagePack.MessagePackWriter writer, uint[] value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.ForceUInt32BlockFormatter +MessagePack.Formatters.ForceUInt32BlockFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> uint +MessagePack.Formatters.ForceUInt32BlockFormatter.Serialize(ref MessagePack.MessagePackWriter writer, uint value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.ForceUInt64BlockArrayFormatter +MessagePack.Formatters.ForceUInt64BlockArrayFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> ulong[] +MessagePack.Formatters.ForceUInt64BlockArrayFormatter.Serialize(ref MessagePack.MessagePackWriter writer, ulong[] value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.ForceUInt64BlockFormatter +MessagePack.Formatters.ForceUInt64BlockFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> ulong +MessagePack.Formatters.ForceUInt64BlockFormatter.Serialize(ref MessagePack.MessagePackWriter writer, ulong value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.FourDimensionalArrayFormatter +MessagePack.Formatters.FourDimensionalArrayFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> T[,,,] +MessagePack.Formatters.FourDimensionalArrayFormatter.FourDimensionalArrayFormatter() -> void +MessagePack.Formatters.FourDimensionalArrayFormatter.Serialize(ref MessagePack.MessagePackWriter writer, T[,,,] value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.GenericCollectionFormatter +MessagePack.Formatters.GenericCollectionFormatter.GenericCollectionFormatter() -> void +MessagePack.Formatters.GenericDictionaryFormatter +MessagePack.Formatters.GenericDictionaryFormatter.GenericDictionaryFormatter() -> void +MessagePack.Formatters.GenericEnumFormatter +MessagePack.Formatters.GenericEnumFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> T +MessagePack.Formatters.GenericEnumFormatter.GenericEnumFormatter() -> void +MessagePack.Formatters.GenericEnumFormatter.Serialize(ref MessagePack.MessagePackWriter writer, T value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.GuidFormatter +MessagePack.Formatters.GuidFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> System.Guid +MessagePack.Formatters.GuidFormatter.Serialize(ref MessagePack.MessagePackWriter writer, System.Guid value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.HashSetFormatter +MessagePack.Formatters.HashSetFormatter.HashSetFormatter() -> void +MessagePack.Formatters.IMessagePackFormatter +MessagePack.Formatters.IMessagePackFormatter +MessagePack.Formatters.IMessagePackFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> T +MessagePack.Formatters.IMessagePackFormatter.Serialize(ref MessagePack.MessagePackWriter writer, T value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.IgnoreFormatter +MessagePack.Formatters.IgnoreFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> T +MessagePack.Formatters.IgnoreFormatter.IgnoreFormatter() -> void +MessagePack.Formatters.IgnoreFormatter.Serialize(ref MessagePack.MessagePackWriter writer, T value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.Int16ArrayFormatter +MessagePack.Formatters.Int16ArrayFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> short[] +MessagePack.Formatters.Int16ArrayFormatter.Serialize(ref MessagePack.MessagePackWriter writer, short[] value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.Int16Formatter +MessagePack.Formatters.Int16Formatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> short +MessagePack.Formatters.Int16Formatter.Serialize(ref MessagePack.MessagePackWriter writer, short value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.Int32ArrayFormatter +MessagePack.Formatters.Int32ArrayFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> int[] +MessagePack.Formatters.Int32ArrayFormatter.Serialize(ref MessagePack.MessagePackWriter writer, int[] value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.Int32Formatter +MessagePack.Formatters.Int32Formatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> int +MessagePack.Formatters.Int32Formatter.Serialize(ref MessagePack.MessagePackWriter writer, int value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.Int64ArrayFormatter +MessagePack.Formatters.Int64ArrayFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> long[] +MessagePack.Formatters.Int64ArrayFormatter.Serialize(ref MessagePack.MessagePackWriter writer, long[] value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.Int64Formatter +MessagePack.Formatters.Int64Formatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> long +MessagePack.Formatters.Int64Formatter.Serialize(ref MessagePack.MessagePackWriter writer, long value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.InterfaceCollectionFormatter +MessagePack.Formatters.InterfaceCollectionFormatter.InterfaceCollectionFormatter() -> void +MessagePack.Formatters.InterfaceDictionaryFormatter +MessagePack.Formatters.InterfaceDictionaryFormatter.InterfaceDictionaryFormatter() -> void +MessagePack.Formatters.InterfaceEnumerableFormatter +MessagePack.Formatters.InterfaceEnumerableFormatter.InterfaceEnumerableFormatter() -> void +MessagePack.Formatters.InterfaceGroupingFormatter +MessagePack.Formatters.InterfaceGroupingFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> System.Linq.IGrouping +MessagePack.Formatters.InterfaceGroupingFormatter.InterfaceGroupingFormatter() -> void +MessagePack.Formatters.InterfaceGroupingFormatter.Serialize(ref MessagePack.MessagePackWriter writer, System.Linq.IGrouping value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.InterfaceListFormatter +MessagePack.Formatters.InterfaceListFormatter.InterfaceListFormatter() -> void +MessagePack.Formatters.InterfaceLookupFormatter +MessagePack.Formatters.InterfaceLookupFormatter.InterfaceLookupFormatter() -> void +MessagePack.Formatters.InterfaceReadOnlyCollectionFormatter +MessagePack.Formatters.InterfaceReadOnlyCollectionFormatter.InterfaceReadOnlyCollectionFormatter() -> void +MessagePack.Formatters.InterfaceReadOnlyDictionaryFormatter +MessagePack.Formatters.InterfaceReadOnlyDictionaryFormatter.InterfaceReadOnlyDictionaryFormatter() -> void +MessagePack.Formatters.InterfaceReadOnlyListFormatter +MessagePack.Formatters.InterfaceReadOnlyListFormatter.InterfaceReadOnlyListFormatter() -> void +MessagePack.Formatters.InterfaceSetFormatter +MessagePack.Formatters.InterfaceSetFormatter.InterfaceSetFormatter() -> void +MessagePack.Formatters.KeyValuePairFormatter +MessagePack.Formatters.KeyValuePairFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> System.Collections.Generic.KeyValuePair +MessagePack.Formatters.KeyValuePairFormatter.KeyValuePairFormatter() -> void +MessagePack.Formatters.KeyValuePairFormatter.Serialize(ref MessagePack.MessagePackWriter writer, System.Collections.Generic.KeyValuePair value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.LazyFormatter +MessagePack.Formatters.LazyFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> System.Lazy +MessagePack.Formatters.LazyFormatter.LazyFormatter() -> void +MessagePack.Formatters.LazyFormatter.Serialize(ref MessagePack.MessagePackWriter writer, System.Lazy value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.LinkedListFormatter +MessagePack.Formatters.LinkedListFormatter.LinkedListFormatter() -> void +MessagePack.Formatters.ListFormatter +MessagePack.Formatters.ListFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> System.Collections.Generic.List +MessagePack.Formatters.ListFormatter.ListFormatter() -> void +MessagePack.Formatters.ListFormatter.Serialize(ref MessagePack.MessagePackWriter writer, System.Collections.Generic.List value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.NativeDateTimeArrayFormatter +MessagePack.Formatters.NativeDateTimeArrayFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> System.DateTime[] +MessagePack.Formatters.NativeDateTimeArrayFormatter.NativeDateTimeArrayFormatter() -> void +MessagePack.Formatters.NativeDateTimeArrayFormatter.Serialize(ref MessagePack.MessagePackWriter writer, System.DateTime[] value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.NativeDateTimeFormatter +MessagePack.Formatters.NativeDateTimeFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> System.DateTime +MessagePack.Formatters.NativeDateTimeFormatter.NativeDateTimeFormatter() -> void +MessagePack.Formatters.NativeDateTimeFormatter.Serialize(ref MessagePack.MessagePackWriter writer, System.DateTime value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.NativeDecimalFormatter +MessagePack.Formatters.NativeDecimalFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> decimal +MessagePack.Formatters.NativeDecimalFormatter.Serialize(ref MessagePack.MessagePackWriter writer, decimal value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.NativeGuidFormatter +MessagePack.Formatters.NativeGuidFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> System.Guid +MessagePack.Formatters.NativeGuidFormatter.Serialize(ref MessagePack.MessagePackWriter writer, System.Guid value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.NilFormatter +MessagePack.Formatters.NilFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> MessagePack.Nil +MessagePack.Formatters.NilFormatter.Serialize(ref MessagePack.MessagePackWriter writer, MessagePack.Nil value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.NonGenericDictionaryFormatter +MessagePack.Formatters.NonGenericDictionaryFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> T +MessagePack.Formatters.NonGenericDictionaryFormatter.NonGenericDictionaryFormatter() -> void +MessagePack.Formatters.NonGenericDictionaryFormatter.Serialize(ref MessagePack.MessagePackWriter writer, T value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.NonGenericInterfaceDictionaryFormatter +MessagePack.Formatters.NonGenericInterfaceDictionaryFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> System.Collections.IDictionary +MessagePack.Formatters.NonGenericInterfaceDictionaryFormatter.Serialize(ref MessagePack.MessagePackWriter writer, System.Collections.IDictionary value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.NonGenericInterfaceListFormatter +MessagePack.Formatters.NonGenericInterfaceListFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> System.Collections.IList +MessagePack.Formatters.NonGenericInterfaceListFormatter.Serialize(ref MessagePack.MessagePackWriter writer, System.Collections.IList value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.NonGenericListFormatter +MessagePack.Formatters.NonGenericListFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> T +MessagePack.Formatters.NonGenericListFormatter.NonGenericListFormatter() -> void +MessagePack.Formatters.NonGenericListFormatter.Serialize(ref MessagePack.MessagePackWriter writer, T value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.NullableBooleanFormatter +MessagePack.Formatters.NullableBooleanFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> bool? +MessagePack.Formatters.NullableBooleanFormatter.Serialize(ref MessagePack.MessagePackWriter writer, bool? value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.NullableByteFormatter +MessagePack.Formatters.NullableByteFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> byte? +MessagePack.Formatters.NullableByteFormatter.Serialize(ref MessagePack.MessagePackWriter writer, byte? value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.NullableCharFormatter +MessagePack.Formatters.NullableCharFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> char? +MessagePack.Formatters.NullableCharFormatter.Serialize(ref MessagePack.MessagePackWriter writer, char? value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.NullableDateTimeFormatter +MessagePack.Formatters.NullableDateTimeFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> System.DateTime? +MessagePack.Formatters.NullableDateTimeFormatter.Serialize(ref MessagePack.MessagePackWriter writer, System.DateTime? value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.NullableDoubleFormatter +MessagePack.Formatters.NullableDoubleFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> double? +MessagePack.Formatters.NullableDoubleFormatter.Serialize(ref MessagePack.MessagePackWriter writer, double? value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.NullableForceByteBlockFormatter +MessagePack.Formatters.NullableForceByteBlockFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> byte? +MessagePack.Formatters.NullableForceByteBlockFormatter.Serialize(ref MessagePack.MessagePackWriter writer, byte? value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.NullableForceInt16BlockFormatter +MessagePack.Formatters.NullableForceInt16BlockFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> short? +MessagePack.Formatters.NullableForceInt16BlockFormatter.Serialize(ref MessagePack.MessagePackWriter writer, short? value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.NullableForceInt32BlockFormatter +MessagePack.Formatters.NullableForceInt32BlockFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> int? +MessagePack.Formatters.NullableForceInt32BlockFormatter.Serialize(ref MessagePack.MessagePackWriter writer, int? value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.NullableForceInt64BlockFormatter +MessagePack.Formatters.NullableForceInt64BlockFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> long? +MessagePack.Formatters.NullableForceInt64BlockFormatter.Serialize(ref MessagePack.MessagePackWriter writer, long? value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.NullableForceSByteBlockFormatter +MessagePack.Formatters.NullableForceSByteBlockFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> sbyte? +MessagePack.Formatters.NullableForceSByteBlockFormatter.Serialize(ref MessagePack.MessagePackWriter writer, sbyte? value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.NullableForceUInt16BlockFormatter +MessagePack.Formatters.NullableForceUInt16BlockFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> ushort? +MessagePack.Formatters.NullableForceUInt16BlockFormatter.Serialize(ref MessagePack.MessagePackWriter writer, ushort? value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.NullableForceUInt32BlockFormatter +MessagePack.Formatters.NullableForceUInt32BlockFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> uint? +MessagePack.Formatters.NullableForceUInt32BlockFormatter.Serialize(ref MessagePack.MessagePackWriter writer, uint? value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.NullableForceUInt64BlockFormatter +MessagePack.Formatters.NullableForceUInt64BlockFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> ulong? +MessagePack.Formatters.NullableForceUInt64BlockFormatter.Serialize(ref MessagePack.MessagePackWriter writer, ulong? value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.NullableFormatter +MessagePack.Formatters.NullableFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> T? +MessagePack.Formatters.NullableFormatter.NullableFormatter() -> void +MessagePack.Formatters.NullableFormatter.Serialize(ref MessagePack.MessagePackWriter writer, T? value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.NullableInt16Formatter +MessagePack.Formatters.NullableInt16Formatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> short? +MessagePack.Formatters.NullableInt16Formatter.Serialize(ref MessagePack.MessagePackWriter writer, short? value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.NullableInt32Formatter +MessagePack.Formatters.NullableInt32Formatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> int? +MessagePack.Formatters.NullableInt32Formatter.Serialize(ref MessagePack.MessagePackWriter writer, int? value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.NullableInt64Formatter +MessagePack.Formatters.NullableInt64Formatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> long? +MessagePack.Formatters.NullableInt64Formatter.Serialize(ref MessagePack.MessagePackWriter writer, long? value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.NullableNilFormatter +MessagePack.Formatters.NullableNilFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> MessagePack.Nil? +MessagePack.Formatters.NullableNilFormatter.Serialize(ref MessagePack.MessagePackWriter writer, MessagePack.Nil? value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.NullableSByteFormatter +MessagePack.Formatters.NullableSByteFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> sbyte? +MessagePack.Formatters.NullableSByteFormatter.Serialize(ref MessagePack.MessagePackWriter writer, sbyte? value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.NullableSingleFormatter +MessagePack.Formatters.NullableSingleFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> float? +MessagePack.Formatters.NullableSingleFormatter.Serialize(ref MessagePack.MessagePackWriter writer, float? value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.NullableStringArrayFormatter +MessagePack.Formatters.NullableStringArrayFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> string[] +MessagePack.Formatters.NullableStringArrayFormatter.Serialize(ref MessagePack.MessagePackWriter writer, string[] value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.NullableStringFormatter +MessagePack.Formatters.NullableStringFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> string +MessagePack.Formatters.NullableStringFormatter.Serialize(ref MessagePack.MessagePackWriter writer, string value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.NullableUInt16Formatter +MessagePack.Formatters.NullableUInt16Formatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> ushort? +MessagePack.Formatters.NullableUInt16Formatter.Serialize(ref MessagePack.MessagePackWriter writer, ushort? value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.NullableUInt32Formatter +MessagePack.Formatters.NullableUInt32Formatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> uint? +MessagePack.Formatters.NullableUInt32Formatter.Serialize(ref MessagePack.MessagePackWriter writer, uint? value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.NullableUInt64Formatter +MessagePack.Formatters.NullableUInt64Formatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> ulong? +MessagePack.Formatters.NullableUInt64Formatter.Serialize(ref MessagePack.MessagePackWriter writer, ulong? value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.ObservableCollectionFormatter +MessagePack.Formatters.ObservableCollectionFormatter.ObservableCollectionFormatter() -> void +MessagePack.Formatters.PrimitiveObjectFormatter +MessagePack.Formatters.PrimitiveObjectFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> object +MessagePack.Formatters.PrimitiveObjectFormatter.Serialize(ref MessagePack.MessagePackWriter writer, object value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.QueueFormatter +MessagePack.Formatters.QueueFormatter.QueueFormatter() -> void +MessagePack.Formatters.ReadOnlyCollectionFormatter +MessagePack.Formatters.ReadOnlyCollectionFormatter.ReadOnlyCollectionFormatter() -> void +MessagePack.Formatters.ReadOnlyDictionaryFormatter +MessagePack.Formatters.ReadOnlyDictionaryFormatter.ReadOnlyDictionaryFormatter() -> void +MessagePack.Formatters.ReadOnlyObservableCollectionFormatter +MessagePack.Formatters.ReadOnlyObservableCollectionFormatter.ReadOnlyObservableCollectionFormatter() -> void +MessagePack.Formatters.SByteArrayFormatter +MessagePack.Formatters.SByteArrayFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> sbyte[] +MessagePack.Formatters.SByteArrayFormatter.Serialize(ref MessagePack.MessagePackWriter writer, sbyte[] value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.SByteFormatter +MessagePack.Formatters.SByteFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> sbyte +MessagePack.Formatters.SByteFormatter.Serialize(ref MessagePack.MessagePackWriter writer, sbyte value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.SingleArrayFormatter +MessagePack.Formatters.SingleArrayFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> float[] +MessagePack.Formatters.SingleArrayFormatter.Serialize(ref MessagePack.MessagePackWriter writer, float[] value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.SingleFormatter +MessagePack.Formatters.SingleFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> float +MessagePack.Formatters.SingleFormatter.Serialize(ref MessagePack.MessagePackWriter writer, float value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.SortedDictionaryFormatter +MessagePack.Formatters.SortedDictionaryFormatter.SortedDictionaryFormatter() -> void +MessagePack.Formatters.SortedListFormatter +MessagePack.Formatters.SortedListFormatter.SortedListFormatter() -> void +MessagePack.Formatters.StackFormatter +MessagePack.Formatters.StackFormatter.StackFormatter() -> void +MessagePack.Formatters.StaticNullableFormatter +MessagePack.Formatters.StaticNullableFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> T? +MessagePack.Formatters.StaticNullableFormatter.Serialize(ref MessagePack.MessagePackWriter writer, T? value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.StaticNullableFormatter.StaticNullableFormatter(MessagePack.Formatters.IMessagePackFormatter underlyingFormatter) -> void +MessagePack.Formatters.StringBuilderFormatter +MessagePack.Formatters.StringBuilderFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> System.Text.StringBuilder +MessagePack.Formatters.StringBuilderFormatter.Serialize(ref MessagePack.MessagePackWriter writer, System.Text.StringBuilder value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.ThreeDimensionalArrayFormatter +MessagePack.Formatters.ThreeDimensionalArrayFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> T[,,] +MessagePack.Formatters.ThreeDimensionalArrayFormatter.Serialize(ref MessagePack.MessagePackWriter writer, T[,,] value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.ThreeDimensionalArrayFormatter.ThreeDimensionalArrayFormatter() -> void +MessagePack.Formatters.TimeSpanFormatter +MessagePack.Formatters.TimeSpanFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> System.TimeSpan +MessagePack.Formatters.TimeSpanFormatter.Serialize(ref MessagePack.MessagePackWriter writer, System.TimeSpan value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.TupleFormatter +MessagePack.Formatters.TupleFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> System.Tuple +MessagePack.Formatters.TupleFormatter.Serialize(ref MessagePack.MessagePackWriter writer, System.Tuple value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.TupleFormatter.TupleFormatter() -> void +MessagePack.Formatters.TupleFormatter +MessagePack.Formatters.TupleFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> System.Tuple +MessagePack.Formatters.TupleFormatter.Serialize(ref MessagePack.MessagePackWriter writer, System.Tuple value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.TupleFormatter.TupleFormatter() -> void +MessagePack.Formatters.TupleFormatter +MessagePack.Formatters.TupleFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> System.Tuple +MessagePack.Formatters.TupleFormatter.Serialize(ref MessagePack.MessagePackWriter writer, System.Tuple value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.TupleFormatter.TupleFormatter() -> void +MessagePack.Formatters.TupleFormatter +MessagePack.Formatters.TupleFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> System.Tuple +MessagePack.Formatters.TupleFormatter.Serialize(ref MessagePack.MessagePackWriter writer, System.Tuple value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.TupleFormatter.TupleFormatter() -> void +MessagePack.Formatters.TupleFormatter +MessagePack.Formatters.TupleFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> System.Tuple +MessagePack.Formatters.TupleFormatter.Serialize(ref MessagePack.MessagePackWriter writer, System.Tuple value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.TupleFormatter.TupleFormatter() -> void +MessagePack.Formatters.TupleFormatter +MessagePack.Formatters.TupleFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> System.Tuple +MessagePack.Formatters.TupleFormatter.Serialize(ref MessagePack.MessagePackWriter writer, System.Tuple value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.TupleFormatter.TupleFormatter() -> void +MessagePack.Formatters.TupleFormatter +MessagePack.Formatters.TupleFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> System.Tuple +MessagePack.Formatters.TupleFormatter.Serialize(ref MessagePack.MessagePackWriter writer, System.Tuple value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.TupleFormatter.TupleFormatter() -> void +MessagePack.Formatters.TupleFormatter +MessagePack.Formatters.TupleFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> System.Tuple +MessagePack.Formatters.TupleFormatter.Serialize(ref MessagePack.MessagePackWriter writer, System.Tuple value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.TupleFormatter.TupleFormatter() -> void +MessagePack.Formatters.TwoDimensionalArrayFormatter +MessagePack.Formatters.TwoDimensionalArrayFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> T[,] +MessagePack.Formatters.TwoDimensionalArrayFormatter.Serialize(ref MessagePack.MessagePackWriter writer, T[,] value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.TwoDimensionalArrayFormatter.TwoDimensionalArrayFormatter() -> void +MessagePack.Formatters.TypelessFormatter +MessagePack.Formatters.TypelessFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> object +MessagePack.Formatters.TypelessFormatter.Serialize(ref MessagePack.MessagePackWriter writer, object value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.UInt16ArrayFormatter +MessagePack.Formatters.UInt16ArrayFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> ushort[] +MessagePack.Formatters.UInt16ArrayFormatter.Serialize(ref MessagePack.MessagePackWriter writer, ushort[] value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.UInt16Formatter +MessagePack.Formatters.UInt16Formatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> ushort +MessagePack.Formatters.UInt16Formatter.Serialize(ref MessagePack.MessagePackWriter writer, ushort value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.UInt32ArrayFormatter +MessagePack.Formatters.UInt32ArrayFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> uint[] +MessagePack.Formatters.UInt32ArrayFormatter.Serialize(ref MessagePack.MessagePackWriter writer, uint[] value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.UInt32Formatter +MessagePack.Formatters.UInt32Formatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> uint +MessagePack.Formatters.UInt32Formatter.Serialize(ref MessagePack.MessagePackWriter writer, uint value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.UInt64ArrayFormatter +MessagePack.Formatters.UInt64ArrayFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> ulong[] +MessagePack.Formatters.UInt64ArrayFormatter.Serialize(ref MessagePack.MessagePackWriter writer, ulong[] value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.UInt64Formatter +MessagePack.Formatters.UInt64Formatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> ulong +MessagePack.Formatters.UInt64Formatter.Serialize(ref MessagePack.MessagePackWriter writer, ulong value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.UriFormatter +MessagePack.Formatters.UriFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> System.Uri +MessagePack.Formatters.UriFormatter.Serialize(ref MessagePack.MessagePackWriter writer, System.Uri value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.ValueTupleFormatter +MessagePack.Formatters.ValueTupleFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> System.ValueTuple +MessagePack.Formatters.ValueTupleFormatter.Serialize(ref MessagePack.MessagePackWriter writer, System.ValueTuple value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.ValueTupleFormatter.ValueTupleFormatter() -> void +MessagePack.Formatters.ValueTupleFormatter +MessagePack.Formatters.ValueTupleFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> (T1, T2, T3, T4, T5, T6, T7) +MessagePack.Formatters.ValueTupleFormatter.Serialize(ref MessagePack.MessagePackWriter writer, (T1, T2, T3, T4, T5, T6, T7) value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.ValueTupleFormatter.ValueTupleFormatter() -> void +MessagePack.Formatters.ValueTupleFormatter +MessagePack.Formatters.ValueTupleFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> (T1, T2, T3, T4, T5, T6) +MessagePack.Formatters.ValueTupleFormatter.Serialize(ref MessagePack.MessagePackWriter writer, (T1, T2, T3, T4, T5, T6) value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.ValueTupleFormatter.ValueTupleFormatter() -> void +MessagePack.Formatters.ValueTupleFormatter +MessagePack.Formatters.ValueTupleFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> (T1, T2, T3, T4, T5) +MessagePack.Formatters.ValueTupleFormatter.Serialize(ref MessagePack.MessagePackWriter writer, (T1, T2, T3, T4, T5) value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.ValueTupleFormatter.ValueTupleFormatter() -> void +MessagePack.Formatters.ValueTupleFormatter +MessagePack.Formatters.ValueTupleFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> (T1, T2, T3, T4) +MessagePack.Formatters.ValueTupleFormatter.Serialize(ref MessagePack.MessagePackWriter writer, (T1, T2, T3, T4) value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.ValueTupleFormatter.ValueTupleFormatter() -> void +MessagePack.Formatters.ValueTupleFormatter +MessagePack.Formatters.ValueTupleFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> (T1, T2, T3) +MessagePack.Formatters.ValueTupleFormatter.Serialize(ref MessagePack.MessagePackWriter writer, (T1, T2, T3) value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.ValueTupleFormatter.ValueTupleFormatter() -> void +MessagePack.Formatters.ValueTupleFormatter +MessagePack.Formatters.ValueTupleFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> (T1, T2) +MessagePack.Formatters.ValueTupleFormatter.Serialize(ref MessagePack.MessagePackWriter writer, (T1, T2) value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.ValueTupleFormatter.ValueTupleFormatter() -> void +MessagePack.Formatters.ValueTupleFormatter +MessagePack.Formatters.ValueTupleFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> System.ValueTuple +MessagePack.Formatters.ValueTupleFormatter.Serialize(ref MessagePack.MessagePackWriter writer, System.ValueTuple value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.ValueTupleFormatter.ValueTupleFormatter() -> void +MessagePack.Formatters.VersionFormatter +MessagePack.Formatters.VersionFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> System.Version +MessagePack.Formatters.VersionFormatter.Serialize(ref MessagePack.MessagePackWriter writer, System.Version value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.IFormatterResolver +MessagePack.IFormatterResolver.GetFormatter() -> MessagePack.Formatters.IMessagePackFormatter +MessagePack.Internal.AutomataDictionary +MessagePack.Internal.AutomataDictionary.Add(string str, int value) -> void +MessagePack.Internal.AutomataDictionary.AutomataDictionary() -> void +MessagePack.Internal.AutomataDictionary.EmitMatch(System.Reflection.Emit.ILGenerator il, System.Reflection.Emit.LocalBuilder bytesSpan, System.Reflection.Emit.LocalBuilder key, System.Action> onFound, System.Action onNotFound) -> void +MessagePack.Internal.AutomataDictionary.GetEnumerator() -> System.Collections.Generic.IEnumerator> +MessagePack.Internal.AutomataDictionary.TryGetValue(System.ReadOnlySpan bytes, out int value) -> bool +MessagePack.Internal.AutomataDictionary.TryGetValue(in System.Buffers.ReadOnlySequence bytes, out int value) -> bool +MessagePack.Internal.AutomataKeyGen +MessagePack.Internal.ByteArrayStringHashTable +MessagePack.Internal.ByteArrayStringHashTable.Add(byte[] key, int value) -> void +MessagePack.Internal.ByteArrayStringHashTable.Add(string key, int value) -> void +MessagePack.Internal.ByteArrayStringHashTable.ByteArrayStringHashTable(int capacity) -> void +MessagePack.Internal.ByteArrayStringHashTable.ByteArrayStringHashTable(int capacity, float loadFactor) -> void +MessagePack.Internal.ByteArrayStringHashTable.GetEnumerator() -> System.Collections.Generic.IEnumerator> +MessagePack.Internal.ByteArrayStringHashTable.TryGetValue(System.ReadOnlySpan key, out int value) -> bool +MessagePack.Internal.ByteArrayStringHashTable.TryGetValue(in System.Buffers.ReadOnlySequence key, out int value) -> bool +MessagePack.Internal.CodeGenHelpers +MessagePack.Internal.RuntimeTypeHandleEqualityComparer +MessagePack.Internal.RuntimeTypeHandleEqualityComparer.Equals(System.RuntimeTypeHandle x, System.RuntimeTypeHandle y) -> bool +MessagePack.Internal.RuntimeTypeHandleEqualityComparer.GetHashCode(System.RuntimeTypeHandle obj) -> int +MessagePack.Internal.UnsafeMemory +MessagePack.Internal.UnsafeMemory32 +MessagePack.Internal.UnsafeMemory64 +MessagePack.MessagePackCode +MessagePack.MessagePackCompression +MessagePack.MessagePackCompression.Lz4Block = 1 -> MessagePack.MessagePackCompression +MessagePack.MessagePackCompression.Lz4BlockArray = 2 -> MessagePack.MessagePackCompression +MessagePack.MessagePackCompression.None = 0 -> MessagePack.MessagePackCompression +MessagePack.MessagePackRange +MessagePack.MessagePackReader +MessagePack.MessagePackReader.CancellationToken.get -> System.Threading.CancellationToken +MessagePack.MessagePackReader.CancellationToken.set -> void +MessagePack.MessagePackReader.Clone(in System.Buffers.ReadOnlySequence readOnlySequence) -> MessagePack.MessagePackReader +MessagePack.MessagePackReader.Consumed.get -> long +MessagePack.MessagePackReader.CreatePeekReader() -> MessagePack.MessagePackReader +MessagePack.MessagePackReader.End.get -> bool +MessagePack.MessagePackReader.IsNil.get -> bool +MessagePack.MessagePackReader.MessagePackReader(System.ReadOnlyMemory memory) -> void +MessagePack.MessagePackReader.MessagePackReader(in System.Buffers.ReadOnlySequence readOnlySequence) -> void +MessagePack.MessagePackReader.NextCode.get -> byte +MessagePack.MessagePackReader.NextMessagePackType.get -> MessagePack.MessagePackType +MessagePack.MessagePackReader.Position.get -> System.SequencePosition +MessagePack.MessagePackReader.ReadArrayHeader() -> int +MessagePack.MessagePackReader.ReadBoolean() -> bool +MessagePack.MessagePackReader.ReadByte() -> byte +MessagePack.MessagePackReader.ReadBytes() -> System.Buffers.ReadOnlySequence? +MessagePack.MessagePackReader.ReadChar() -> char +MessagePack.MessagePackReader.ReadDateTime() -> System.DateTime +MessagePack.MessagePackReader.ReadDouble() -> double +MessagePack.MessagePackReader.ReadExtensionFormat() -> MessagePack.ExtensionResult +MessagePack.MessagePackReader.ReadExtensionFormatHeader() -> MessagePack.ExtensionHeader +MessagePack.MessagePackReader.ReadInt16() -> short +MessagePack.MessagePackReader.ReadInt32() -> int +MessagePack.MessagePackReader.ReadInt64() -> long +MessagePack.MessagePackReader.ReadMapHeader() -> int +MessagePack.MessagePackReader.ReadNil() -> MessagePack.Nil +MessagePack.MessagePackReader.ReadRaw() -> System.Buffers.ReadOnlySequence +MessagePack.MessagePackReader.ReadRaw(long length) -> System.Buffers.ReadOnlySequence +MessagePack.MessagePackReader.ReadSByte() -> sbyte +MessagePack.MessagePackReader.ReadSingle() -> float +MessagePack.MessagePackReader.ReadString() -> string +MessagePack.MessagePackReader.ReadStringSequence() -> System.Buffers.ReadOnlySequence? +MessagePack.MessagePackReader.ReadUInt16() -> ushort +MessagePack.MessagePackReader.ReadUInt32() -> uint +MessagePack.MessagePackReader.ReadUInt64() -> ulong +MessagePack.MessagePackReader.Sequence.get -> System.Buffers.ReadOnlySequence +MessagePack.MessagePackReader.Skip() -> void +MessagePack.MessagePackReader.TryReadNil() -> bool +MessagePack.MessagePackReader.TryReadStringSpan(out System.ReadOnlySpan span) -> bool +MessagePack.MessagePackSerializationException +MessagePack.MessagePackSerializationException.MessagePackSerializationException() -> void +MessagePack.MessagePackSerializationException.MessagePackSerializationException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) -> void +MessagePack.MessagePackSerializationException.MessagePackSerializationException(string message) -> void +MessagePack.MessagePackSerializationException.MessagePackSerializationException(string message, System.Exception inner) -> void +MessagePack.MessagePackSerializer +MessagePack.MessagePackSerializer.Typeless +MessagePack.MessagePackSerializerOptions +MessagePack.MessagePackSerializerOptions.AllowAssemblyVersionMismatch.get -> bool +MessagePack.MessagePackSerializerOptions.Compression.get -> MessagePack.MessagePackCompression +MessagePack.MessagePackSerializerOptions.MessagePackSerializerOptions(MessagePack.IFormatterResolver resolver) -> void +MessagePack.MessagePackSerializerOptions.MessagePackSerializerOptions(MessagePack.MessagePackSerializerOptions copyFrom) -> void +MessagePack.MessagePackSerializerOptions.OldSpec.get -> bool? +MessagePack.MessagePackSerializerOptions.OmitAssemblyVersion.get -> bool +MessagePack.MessagePackSerializerOptions.Resolver.get -> MessagePack.IFormatterResolver +MessagePack.MessagePackSerializerOptions.WithAllowAssemblyVersionMismatch(bool allowAssemblyVersionMismatch) -> MessagePack.MessagePackSerializerOptions +MessagePack.MessagePackSerializerOptions.WithCompression(MessagePack.MessagePackCompression compression) -> MessagePack.MessagePackSerializerOptions +MessagePack.MessagePackSerializerOptions.WithOldSpec(bool? oldSpec = true) -> MessagePack.MessagePackSerializerOptions +MessagePack.MessagePackSerializerOptions.WithOmitAssemblyVersion(bool omitAssemblyVersion) -> MessagePack.MessagePackSerializerOptions +MessagePack.MessagePackSerializerOptions.WithResolver(MessagePack.IFormatterResolver resolver) -> MessagePack.MessagePackSerializerOptions +MessagePack.MessagePackStreamReader +MessagePack.MessagePackStreamReader.Dispose() -> void +MessagePack.MessagePackStreamReader.MessagePackStreamReader(System.IO.Stream stream) -> void +MessagePack.MessagePackStreamReader.ReadAsync(System.Threading.CancellationToken cancellationToken) -> System.Threading.Tasks.ValueTask?> +MessagePack.MessagePackStreamReader.RemainingBytes.get -> System.Buffers.ReadOnlySequence +MessagePack.MessagePackType +MessagePack.MessagePackType.Array = 7 -> MessagePack.MessagePackType +MessagePack.MessagePackType.Binary = 6 -> MessagePack.MessagePackType +MessagePack.MessagePackType.Boolean = 3 -> MessagePack.MessagePackType +MessagePack.MessagePackType.Extension = 9 -> MessagePack.MessagePackType +MessagePack.MessagePackType.Float = 4 -> MessagePack.MessagePackType +MessagePack.MessagePackType.Integer = 1 -> MessagePack.MessagePackType +MessagePack.MessagePackType.Map = 8 -> MessagePack.MessagePackType +MessagePack.MessagePackType.Nil = 2 -> MessagePack.MessagePackType +MessagePack.MessagePackType.String = 5 -> MessagePack.MessagePackType +MessagePack.MessagePackType.Unknown = 0 -> MessagePack.MessagePackType +MessagePack.MessagePackWriter +MessagePack.MessagePackWriter.Advance(int length) -> void +MessagePack.MessagePackWriter.CancellationToken.get -> System.Threading.CancellationToken +MessagePack.MessagePackWriter.CancellationToken.set -> void +MessagePack.MessagePackWriter.Clone(System.Buffers.IBufferWriter writer) -> MessagePack.MessagePackWriter +MessagePack.MessagePackWriter.Flush() -> void +MessagePack.MessagePackWriter.GetSpan(int length) -> System.Span +MessagePack.MessagePackWriter.MessagePackWriter(System.Buffers.IBufferWriter writer) -> void +MessagePack.MessagePackWriter.OldSpec.get -> bool +MessagePack.MessagePackWriter.OldSpec.set -> void +MessagePack.MessagePackWriter.Write(System.DateTime dateTime) -> void +MessagePack.MessagePackWriter.Write(System.ReadOnlySpan src) -> void +MessagePack.MessagePackWriter.Write(System.ReadOnlySpan value) -> void +MessagePack.MessagePackWriter.Write(bool value) -> void +MessagePack.MessagePackWriter.Write(byte value) -> void +MessagePack.MessagePackWriter.Write(byte[] src) -> void +MessagePack.MessagePackWriter.Write(char value) -> void +MessagePack.MessagePackWriter.Write(double value) -> void +MessagePack.MessagePackWriter.Write(float value) -> void +MessagePack.MessagePackWriter.Write(in System.Buffers.ReadOnlySequence src) -> void +MessagePack.MessagePackWriter.Write(int value) -> void +MessagePack.MessagePackWriter.Write(long value) -> void +MessagePack.MessagePackWriter.Write(sbyte value) -> void +MessagePack.MessagePackWriter.Write(short value) -> void +MessagePack.MessagePackWriter.Write(string value) -> void +MessagePack.MessagePackWriter.Write(uint value) -> void +MessagePack.MessagePackWriter.Write(ulong value) -> void +MessagePack.MessagePackWriter.Write(ushort value) -> void +MessagePack.MessagePackWriter.WriteArrayHeader(int count) -> void +MessagePack.MessagePackWriter.WriteArrayHeader(uint count) -> void +MessagePack.MessagePackWriter.WriteExtensionFormat(MessagePack.ExtensionResult extensionData) -> void +MessagePack.MessagePackWriter.WriteExtensionFormatHeader(MessagePack.ExtensionHeader extensionHeader) -> void +MessagePack.MessagePackWriter.WriteInt16(short value) -> void +MessagePack.MessagePackWriter.WriteInt32(int value) -> void +MessagePack.MessagePackWriter.WriteInt64(long value) -> void +MessagePack.MessagePackWriter.WriteInt8(sbyte value) -> void +MessagePack.MessagePackWriter.WriteMapHeader(int count) -> void +MessagePack.MessagePackWriter.WriteMapHeader(uint count) -> void +MessagePack.MessagePackWriter.WriteNil() -> void +MessagePack.MessagePackWriter.WriteRaw(System.ReadOnlySpan rawMessagePackBlock) -> void +MessagePack.MessagePackWriter.WriteRaw(in System.Buffers.ReadOnlySequence rawMessagePackBlock) -> void +MessagePack.MessagePackWriter.WriteString(System.ReadOnlySpan utf8stringBytes) -> void +MessagePack.MessagePackWriter.WriteString(in System.Buffers.ReadOnlySequence utf8stringBytes) -> void +MessagePack.MessagePackWriter.WriteUInt16(ushort value) -> void +MessagePack.MessagePackWriter.WriteUInt32(uint value) -> void +MessagePack.MessagePackWriter.WriteUInt64(ulong value) -> void +MessagePack.MessagePackWriter.WriteUInt8(byte value) -> void +MessagePack.Nil +MessagePack.Nil.Equals(MessagePack.Nil other) -> bool +MessagePack.Nil.Nil() -> void +MessagePack.ReservedMessagePackExtensionTypeCode +MessagePack.Resolvers.AttributeFormatterResolver +MessagePack.Resolvers.AttributeFormatterResolver.GetFormatter() -> MessagePack.Formatters.IMessagePackFormatter +MessagePack.Resolvers.BuiltinResolver +MessagePack.Resolvers.BuiltinResolver.GetFormatter() -> MessagePack.Formatters.IMessagePackFormatter +MessagePack.Resolvers.CompositeResolver +MessagePack.Resolvers.ContractlessStandardResolver +MessagePack.Resolvers.ContractlessStandardResolver.GetFormatter() -> MessagePack.Formatters.IMessagePackFormatter +MessagePack.Resolvers.ContractlessStandardResolverAllowPrivate +MessagePack.Resolvers.ContractlessStandardResolverAllowPrivate.GetFormatter() -> MessagePack.Formatters.IMessagePackFormatter +MessagePack.Resolvers.DynamicContractlessObjectResolver +MessagePack.Resolvers.DynamicContractlessObjectResolver.GetFormatter() -> MessagePack.Formatters.IMessagePackFormatter +MessagePack.Resolvers.DynamicContractlessObjectResolverAllowPrivate +MessagePack.Resolvers.DynamicContractlessObjectResolverAllowPrivate.DynamicContractlessObjectResolverAllowPrivate() -> void +MessagePack.Resolvers.DynamicContractlessObjectResolverAllowPrivate.GetFormatter() -> MessagePack.Formatters.IMessagePackFormatter +MessagePack.Resolvers.DynamicEnumAsStringResolver +MessagePack.Resolvers.DynamicEnumAsStringResolver.GetFormatter() -> MessagePack.Formatters.IMessagePackFormatter +MessagePack.Resolvers.DynamicEnumResolver +MessagePack.Resolvers.DynamicEnumResolver.GetFormatter() -> MessagePack.Formatters.IMessagePackFormatter +MessagePack.Resolvers.DynamicGenericResolver +MessagePack.Resolvers.DynamicGenericResolver.GetFormatter() -> MessagePack.Formatters.IMessagePackFormatter +MessagePack.Resolvers.DynamicObjectResolver +MessagePack.Resolvers.DynamicObjectResolver.GetFormatter() -> MessagePack.Formatters.IMessagePackFormatter +MessagePack.Resolvers.DynamicObjectResolverAllowPrivate +MessagePack.Resolvers.DynamicObjectResolverAllowPrivate.GetFormatter() -> MessagePack.Formatters.IMessagePackFormatter +MessagePack.Resolvers.DynamicUnionResolver +MessagePack.Resolvers.DynamicUnionResolver.GetFormatter() -> MessagePack.Formatters.IMessagePackFormatter +MessagePack.Resolvers.NativeDateTimeResolver +MessagePack.Resolvers.NativeDateTimeResolver.GetFormatter() -> MessagePack.Formatters.IMessagePackFormatter +MessagePack.Resolvers.NativeDecimalResolver +MessagePack.Resolvers.NativeDecimalResolver.GetFormatter() -> MessagePack.Formatters.IMessagePackFormatter +MessagePack.Resolvers.NativeGuidResolver +MessagePack.Resolvers.NativeGuidResolver.GetFormatter() -> MessagePack.Formatters.IMessagePackFormatter +MessagePack.Resolvers.PrimitiveObjectResolver +MessagePack.Resolvers.PrimitiveObjectResolver.GetFormatter() -> MessagePack.Formatters.IMessagePackFormatter +MessagePack.Resolvers.StandardResolver +MessagePack.Resolvers.StandardResolver.GetFormatter() -> MessagePack.Formatters.IMessagePackFormatter +MessagePack.Resolvers.StandardResolverAllowPrivate +MessagePack.Resolvers.StandardResolverAllowPrivate.GetFormatter() -> MessagePack.Formatters.IMessagePackFormatter +MessagePack.Resolvers.StaticCompositeResolver +MessagePack.Resolvers.StaticCompositeResolver.GetFormatter() -> MessagePack.Formatters.IMessagePackFormatter +MessagePack.Resolvers.StaticCompositeResolver.Register(System.Collections.Generic.IReadOnlyList formatters, System.Collections.Generic.IReadOnlyList resolvers) -> void +MessagePack.Resolvers.StaticCompositeResolver.Register(params MessagePack.Formatters.IMessagePackFormatter[] formatters) -> void +MessagePack.Resolvers.StaticCompositeResolver.Register(params MessagePack.IFormatterResolver[] resolvers) -> void +MessagePack.Resolvers.TypelessContractlessStandardResolver +MessagePack.Resolvers.TypelessContractlessStandardResolver.GetFormatter() -> MessagePack.Formatters.IMessagePackFormatter +MessagePack.Resolvers.TypelessContractlessStandardResolver.TypelessContractlessStandardResolver() -> void +MessagePack.Resolvers.TypelessObjectResolver +MessagePack.Resolvers.TypelessObjectResolver.GetFormatter() -> MessagePack.Formatters.IMessagePackFormatter +MessagePack.TinyJsonException +MessagePack.TinyJsonException.TinyJsonException(string message) -> void +abstract MessagePack.Formatters.CollectionFormatterBase.Add(TIntermediate collection, int index, TElement value, MessagePack.MessagePackSerializerOptions options) -> void +abstract MessagePack.Formatters.CollectionFormatterBase.Complete(TIntermediate intermediateCollection) -> TCollection +abstract MessagePack.Formatters.CollectionFormatterBase.Create(int count, MessagePack.MessagePackSerializerOptions options) -> TIntermediate +abstract MessagePack.Formatters.CollectionFormatterBase.GetSourceEnumerator(TCollection source) -> TEnumerator +abstract MessagePack.Formatters.DictionaryFormatterBase.Add(TIntermediate collection, int index, TKey key, TValue value, MessagePack.MessagePackSerializerOptions options) -> void +abstract MessagePack.Formatters.DictionaryFormatterBase.Complete(TIntermediate intermediateCollection) -> TDictionary +abstract MessagePack.Formatters.DictionaryFormatterBase.Create(int count, MessagePack.MessagePackSerializerOptions options) -> TIntermediate +abstract MessagePack.Formatters.DictionaryFormatterBase.GetSourceEnumerator(TDictionary source) -> TEnumerator +const MessagePack.MessagePackCode.Array16 = 220 -> byte +const MessagePack.MessagePackCode.Array32 = 221 -> byte +const MessagePack.MessagePackCode.Bin16 = 197 -> byte +const MessagePack.MessagePackCode.Bin32 = 198 -> byte +const MessagePack.MessagePackCode.Bin8 = 196 -> byte +const MessagePack.MessagePackCode.Ext16 = 200 -> byte +const MessagePack.MessagePackCode.Ext32 = 201 -> byte +const MessagePack.MessagePackCode.Ext8 = 199 -> byte +const MessagePack.MessagePackCode.False = 194 -> byte +const MessagePack.MessagePackCode.FixExt1 = 212 -> byte +const MessagePack.MessagePackCode.FixExt16 = 216 -> byte +const MessagePack.MessagePackCode.FixExt2 = 213 -> byte +const MessagePack.MessagePackCode.FixExt4 = 214 -> byte +const MessagePack.MessagePackCode.FixExt8 = 215 -> byte +const MessagePack.MessagePackCode.Float32 = 202 -> byte +const MessagePack.MessagePackCode.Float64 = 203 -> byte +const MessagePack.MessagePackCode.Int16 = 209 -> byte +const MessagePack.MessagePackCode.Int32 = 210 -> byte +const MessagePack.MessagePackCode.Int64 = 211 -> byte +const MessagePack.MessagePackCode.Int8 = 208 -> byte +const MessagePack.MessagePackCode.Map16 = 222 -> byte +const MessagePack.MessagePackCode.Map32 = 223 -> byte +const MessagePack.MessagePackCode.MaxFixArray = 159 -> byte +const MessagePack.MessagePackCode.MaxFixInt = 127 -> byte +const MessagePack.MessagePackCode.MaxFixMap = 143 -> byte +const MessagePack.MessagePackCode.MaxFixStr = 191 -> byte +const MessagePack.MessagePackCode.MaxNegativeFixInt = 255 -> byte +const MessagePack.MessagePackCode.MinFixArray = 144 -> byte +const MessagePack.MessagePackCode.MinFixInt = 0 -> byte +const MessagePack.MessagePackCode.MinFixMap = 128 -> byte +const MessagePack.MessagePackCode.MinFixStr = 160 -> byte +const MessagePack.MessagePackCode.MinNegativeFixInt = 224 -> byte +const MessagePack.MessagePackCode.NeverUsed = 193 -> byte +const MessagePack.MessagePackCode.Nil = 192 -> byte +const MessagePack.MessagePackCode.Str16 = 218 -> byte +const MessagePack.MessagePackCode.Str32 = 219 -> byte +const MessagePack.MessagePackCode.Str8 = 217 -> byte +const MessagePack.MessagePackCode.True = 195 -> byte +const MessagePack.MessagePackCode.UInt16 = 205 -> byte +const MessagePack.MessagePackCode.UInt32 = 206 -> byte +const MessagePack.MessagePackCode.UInt64 = 207 -> byte +const MessagePack.MessagePackCode.UInt8 = 204 -> byte +const MessagePack.MessagePackRange.MaxFixArrayCount = 15 -> int +const MessagePack.MessagePackRange.MaxFixMapCount = 15 -> int +const MessagePack.MessagePackRange.MaxFixNegativeInt = -1 -> int +const MessagePack.MessagePackRange.MaxFixPositiveInt = 127 -> int +const MessagePack.MessagePackRange.MaxFixStringLength = 31 -> int +const MessagePack.MessagePackRange.MinFixNegativeInt = -32 -> int +const MessagePack.MessagePackRange.MinFixStringLength = 0 -> int +const MessagePack.ReservedMessagePackExtensionTypeCode.DateTime = -1 -> sbyte +override MessagePack.Formatters.CollectionFormatterBase.GetSourceEnumerator(TCollection source) -> System.Collections.Generic.IEnumerator +override MessagePack.Formatters.DictionaryFormatterBase.Complete(TDictionary intermediateCollection) -> TDictionary +override MessagePack.Formatters.DictionaryFormatterBase.GetSourceEnumerator(TDictionary source) -> System.Collections.Generic.IEnumerator> +override MessagePack.Internal.AutomataDictionary.ToString() -> string +override MessagePack.Nil.Equals(object obj) -> bool +override MessagePack.Nil.GetHashCode() -> int +override MessagePack.Nil.ToString() -> string +override sealed MessagePack.Formatters.CollectionFormatterBase.Complete(TCollection intermediateCollection) -> TCollection +static MessagePack.FormatterResolverExtensions.GetFormatterDynamic(this MessagePack.IFormatterResolver resolver, System.Type type) -> object +static MessagePack.FormatterResolverExtensions.GetFormatterWithVerify(this MessagePack.IFormatterResolver resolver) -> MessagePack.Formatters.IMessagePackFormatter +static MessagePack.Formatters.PrimitiveObjectFormatter.IsSupportedType(System.Type type, System.Reflection.TypeInfo typeInfo, object value) -> bool +static MessagePack.Internal.AutomataKeyGen.GetKey(ref System.ReadOnlySpan span) -> ulong +static MessagePack.Internal.CodeGenHelpers.GetArrayFromNullableSequence(in System.Buffers.ReadOnlySequence? sequence) -> byte[] +static MessagePack.Internal.CodeGenHelpers.GetEncodedStringBytes(string value) -> byte[] +static MessagePack.Internal.CodeGenHelpers.GetSpanFromSequence(in System.Buffers.ReadOnlySequence sequence) -> System.ReadOnlySpan +static MessagePack.Internal.CodeGenHelpers.ReadStringSpan(ref MessagePack.MessagePackReader reader) -> System.ReadOnlySpan +static MessagePack.Internal.UnsafeMemory32.WriteRaw1(ref MessagePack.MessagePackWriter writer, System.ReadOnlySpan src) -> void +static MessagePack.Internal.UnsafeMemory32.WriteRaw10(ref MessagePack.MessagePackWriter writer, System.ReadOnlySpan src) -> void +static MessagePack.Internal.UnsafeMemory32.WriteRaw11(ref MessagePack.MessagePackWriter writer, System.ReadOnlySpan src) -> void +static MessagePack.Internal.UnsafeMemory32.WriteRaw12(ref MessagePack.MessagePackWriter writer, System.ReadOnlySpan src) -> void +static MessagePack.Internal.UnsafeMemory32.WriteRaw13(ref MessagePack.MessagePackWriter writer, System.ReadOnlySpan src) -> void +static MessagePack.Internal.UnsafeMemory32.WriteRaw14(ref MessagePack.MessagePackWriter writer, System.ReadOnlySpan src) -> void +static MessagePack.Internal.UnsafeMemory32.WriteRaw15(ref MessagePack.MessagePackWriter writer, System.ReadOnlySpan src) -> void +static MessagePack.Internal.UnsafeMemory32.WriteRaw16(ref MessagePack.MessagePackWriter writer, System.ReadOnlySpan src) -> void +static MessagePack.Internal.UnsafeMemory32.WriteRaw17(ref MessagePack.MessagePackWriter writer, System.ReadOnlySpan src) -> void +static MessagePack.Internal.UnsafeMemory32.WriteRaw18(ref MessagePack.MessagePackWriter writer, System.ReadOnlySpan src) -> void +static MessagePack.Internal.UnsafeMemory32.WriteRaw19(ref MessagePack.MessagePackWriter writer, System.ReadOnlySpan src) -> void +static MessagePack.Internal.UnsafeMemory32.WriteRaw2(ref MessagePack.MessagePackWriter writer, System.ReadOnlySpan src) -> void +static MessagePack.Internal.UnsafeMemory32.WriteRaw20(ref MessagePack.MessagePackWriter writer, System.ReadOnlySpan src) -> void +static MessagePack.Internal.UnsafeMemory32.WriteRaw21(ref MessagePack.MessagePackWriter writer, System.ReadOnlySpan src) -> void +static MessagePack.Internal.UnsafeMemory32.WriteRaw22(ref MessagePack.MessagePackWriter writer, System.ReadOnlySpan src) -> void +static MessagePack.Internal.UnsafeMemory32.WriteRaw23(ref MessagePack.MessagePackWriter writer, System.ReadOnlySpan src) -> void +static MessagePack.Internal.UnsafeMemory32.WriteRaw24(ref MessagePack.MessagePackWriter writer, System.ReadOnlySpan src) -> void +static MessagePack.Internal.UnsafeMemory32.WriteRaw25(ref MessagePack.MessagePackWriter writer, System.ReadOnlySpan src) -> void +static MessagePack.Internal.UnsafeMemory32.WriteRaw26(ref MessagePack.MessagePackWriter writer, System.ReadOnlySpan src) -> void +static MessagePack.Internal.UnsafeMemory32.WriteRaw27(ref MessagePack.MessagePackWriter writer, System.ReadOnlySpan src) -> void +static MessagePack.Internal.UnsafeMemory32.WriteRaw28(ref MessagePack.MessagePackWriter writer, System.ReadOnlySpan src) -> void +static MessagePack.Internal.UnsafeMemory32.WriteRaw29(ref MessagePack.MessagePackWriter writer, System.ReadOnlySpan src) -> void +static MessagePack.Internal.UnsafeMemory32.WriteRaw3(ref MessagePack.MessagePackWriter writer, System.ReadOnlySpan src) -> void +static MessagePack.Internal.UnsafeMemory32.WriteRaw30(ref MessagePack.MessagePackWriter writer, System.ReadOnlySpan src) -> void +static MessagePack.Internal.UnsafeMemory32.WriteRaw31(ref MessagePack.MessagePackWriter writer, System.ReadOnlySpan src) -> void +static MessagePack.Internal.UnsafeMemory32.WriteRaw4(ref MessagePack.MessagePackWriter writer, System.ReadOnlySpan src) -> void +static MessagePack.Internal.UnsafeMemory32.WriteRaw5(ref MessagePack.MessagePackWriter writer, System.ReadOnlySpan src) -> void +static MessagePack.Internal.UnsafeMemory32.WriteRaw6(ref MessagePack.MessagePackWriter writer, System.ReadOnlySpan src) -> void +static MessagePack.Internal.UnsafeMemory32.WriteRaw7(ref MessagePack.MessagePackWriter writer, System.ReadOnlySpan src) -> void +static MessagePack.Internal.UnsafeMemory32.WriteRaw8(ref MessagePack.MessagePackWriter writer, System.ReadOnlySpan src) -> void +static MessagePack.Internal.UnsafeMemory32.WriteRaw9(ref MessagePack.MessagePackWriter writer, System.ReadOnlySpan src) -> void +static MessagePack.Internal.UnsafeMemory64.WriteRaw1(ref MessagePack.MessagePackWriter writer, System.ReadOnlySpan src) -> void +static MessagePack.Internal.UnsafeMemory64.WriteRaw10(ref MessagePack.MessagePackWriter writer, System.ReadOnlySpan src) -> void +static MessagePack.Internal.UnsafeMemory64.WriteRaw11(ref MessagePack.MessagePackWriter writer, System.ReadOnlySpan src) -> void +static MessagePack.Internal.UnsafeMemory64.WriteRaw12(ref MessagePack.MessagePackWriter writer, System.ReadOnlySpan src) -> void +static MessagePack.Internal.UnsafeMemory64.WriteRaw13(ref MessagePack.MessagePackWriter writer, System.ReadOnlySpan src) -> void +static MessagePack.Internal.UnsafeMemory64.WriteRaw14(ref MessagePack.MessagePackWriter writer, System.ReadOnlySpan src) -> void +static MessagePack.Internal.UnsafeMemory64.WriteRaw15(ref MessagePack.MessagePackWriter writer, System.ReadOnlySpan src) -> void +static MessagePack.Internal.UnsafeMemory64.WriteRaw16(ref MessagePack.MessagePackWriter writer, System.ReadOnlySpan src) -> void +static MessagePack.Internal.UnsafeMemory64.WriteRaw17(ref MessagePack.MessagePackWriter writer, System.ReadOnlySpan src) -> void +static MessagePack.Internal.UnsafeMemory64.WriteRaw18(ref MessagePack.MessagePackWriter writer, System.ReadOnlySpan src) -> void +static MessagePack.Internal.UnsafeMemory64.WriteRaw19(ref MessagePack.MessagePackWriter writer, System.ReadOnlySpan src) -> void +static MessagePack.Internal.UnsafeMemory64.WriteRaw2(ref MessagePack.MessagePackWriter writer, System.ReadOnlySpan src) -> void +static MessagePack.Internal.UnsafeMemory64.WriteRaw20(ref MessagePack.MessagePackWriter writer, System.ReadOnlySpan src) -> void +static MessagePack.Internal.UnsafeMemory64.WriteRaw21(ref MessagePack.MessagePackWriter writer, System.ReadOnlySpan src) -> void +static MessagePack.Internal.UnsafeMemory64.WriteRaw22(ref MessagePack.MessagePackWriter writer, System.ReadOnlySpan src) -> void +static MessagePack.Internal.UnsafeMemory64.WriteRaw23(ref MessagePack.MessagePackWriter writer, System.ReadOnlySpan src) -> void +static MessagePack.Internal.UnsafeMemory64.WriteRaw24(ref MessagePack.MessagePackWriter writer, System.ReadOnlySpan src) -> void +static MessagePack.Internal.UnsafeMemory64.WriteRaw25(ref MessagePack.MessagePackWriter writer, System.ReadOnlySpan src) -> void +static MessagePack.Internal.UnsafeMemory64.WriteRaw26(ref MessagePack.MessagePackWriter writer, System.ReadOnlySpan src) -> void +static MessagePack.Internal.UnsafeMemory64.WriteRaw27(ref MessagePack.MessagePackWriter writer, System.ReadOnlySpan src) -> void +static MessagePack.Internal.UnsafeMemory64.WriteRaw28(ref MessagePack.MessagePackWriter writer, System.ReadOnlySpan src) -> void +static MessagePack.Internal.UnsafeMemory64.WriteRaw29(ref MessagePack.MessagePackWriter writer, System.ReadOnlySpan src) -> void +static MessagePack.Internal.UnsafeMemory64.WriteRaw3(ref MessagePack.MessagePackWriter writer, System.ReadOnlySpan src) -> void +static MessagePack.Internal.UnsafeMemory64.WriteRaw30(ref MessagePack.MessagePackWriter writer, System.ReadOnlySpan src) -> void +static MessagePack.Internal.UnsafeMemory64.WriteRaw31(ref MessagePack.MessagePackWriter writer, System.ReadOnlySpan src) -> void +static MessagePack.Internal.UnsafeMemory64.WriteRaw4(ref MessagePack.MessagePackWriter writer, System.ReadOnlySpan src) -> void +static MessagePack.Internal.UnsafeMemory64.WriteRaw5(ref MessagePack.MessagePackWriter writer, System.ReadOnlySpan src) -> void +static MessagePack.Internal.UnsafeMemory64.WriteRaw6(ref MessagePack.MessagePackWriter writer, System.ReadOnlySpan src) -> void +static MessagePack.Internal.UnsafeMemory64.WriteRaw7(ref MessagePack.MessagePackWriter writer, System.ReadOnlySpan src) -> void +static MessagePack.Internal.UnsafeMemory64.WriteRaw8(ref MessagePack.MessagePackWriter writer, System.ReadOnlySpan src) -> void +static MessagePack.Internal.UnsafeMemory64.WriteRaw9(ref MessagePack.MessagePackWriter writer, System.ReadOnlySpan src) -> void +static MessagePack.MessagePackCode.ToFormatName(byte code) -> string +static MessagePack.MessagePackCode.ToMessagePackType(byte code) -> MessagePack.MessagePackType +static MessagePack.MessagePackSerializer.ConvertFromJson(System.IO.TextReader reader, ref MessagePack.MessagePackWriter writer, MessagePack.MessagePackSerializerOptions options = null) -> void +static MessagePack.MessagePackSerializer.ConvertFromJson(string str, MessagePack.MessagePackSerializerOptions options = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) -> byte[] +static MessagePack.MessagePackSerializer.ConvertFromJson(string str, ref MessagePack.MessagePackWriter writer, MessagePack.MessagePackSerializerOptions options = null) -> void +static MessagePack.MessagePackSerializer.ConvertToJson(System.ReadOnlyMemory bytes, MessagePack.MessagePackSerializerOptions options = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) -> string +static MessagePack.MessagePackSerializer.ConvertToJson(in System.Buffers.ReadOnlySequence bytes, MessagePack.MessagePackSerializerOptions options = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) -> string +static MessagePack.MessagePackSerializer.ConvertToJson(ref MessagePack.MessagePackReader reader, System.IO.TextWriter jsonWriter, MessagePack.MessagePackSerializerOptions options = null) -> void +static MessagePack.MessagePackSerializer.DefaultOptions.get -> MessagePack.MessagePackSerializerOptions +static MessagePack.MessagePackSerializer.DefaultOptions.set -> void +static MessagePack.MessagePackSerializer.Deserialize(System.Type type, System.Buffers.ReadOnlySequence bytes, MessagePack.MessagePackSerializerOptions options = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) -> object +static MessagePack.MessagePackSerializer.Deserialize(System.Type type, System.IO.Stream stream, MessagePack.MessagePackSerializerOptions options = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) -> object +static MessagePack.MessagePackSerializer.Deserialize(System.Type type, System.ReadOnlyMemory bytes, MessagePack.MessagePackSerializerOptions options = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) -> object +static MessagePack.MessagePackSerializer.Deserialize(System.Type type, ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options = null) -> object +static MessagePack.MessagePackSerializer.Deserialize(System.IO.Stream stream, MessagePack.MessagePackSerializerOptions options = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) -> T +static MessagePack.MessagePackSerializer.Deserialize(System.ReadOnlyMemory buffer, MessagePack.MessagePackSerializerOptions options = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) -> T +static MessagePack.MessagePackSerializer.Deserialize(System.ReadOnlyMemory buffer, MessagePack.MessagePackSerializerOptions options, out int bytesRead, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) -> T +static MessagePack.MessagePackSerializer.Deserialize(System.ReadOnlyMemory buffer, out int bytesRead, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) -> T +static MessagePack.MessagePackSerializer.Deserialize(in System.Buffers.ReadOnlySequence byteSequence, MessagePack.MessagePackSerializerOptions options = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) -> T +static MessagePack.MessagePackSerializer.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options = null) -> T +static MessagePack.MessagePackSerializer.DeserializeAsync(System.Type type, System.IO.Stream stream, MessagePack.MessagePackSerializerOptions options = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) -> System.Threading.Tasks.ValueTask +static MessagePack.MessagePackSerializer.DeserializeAsync(System.IO.Stream stream, MessagePack.MessagePackSerializerOptions options = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) -> System.Threading.Tasks.ValueTask +static MessagePack.MessagePackSerializer.Serialize(System.Type type, System.Buffers.IBufferWriter writer, object obj, MessagePack.MessagePackSerializerOptions options = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) -> void +static MessagePack.MessagePackSerializer.Serialize(System.Type type, System.IO.Stream stream, object obj, MessagePack.MessagePackSerializerOptions options = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) -> void +static MessagePack.MessagePackSerializer.Serialize(System.Type type, object obj, MessagePack.MessagePackSerializerOptions options = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) -> byte[] +static MessagePack.MessagePackSerializer.Serialize(System.Type type, ref MessagePack.MessagePackWriter writer, object obj, MessagePack.MessagePackSerializerOptions options = null) -> void +static MessagePack.MessagePackSerializer.Serialize(System.Buffers.IBufferWriter writer, T value, MessagePack.MessagePackSerializerOptions options = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) -> void +static MessagePack.MessagePackSerializer.Serialize(System.IO.Stream stream, T value, MessagePack.MessagePackSerializerOptions options = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) -> void +static MessagePack.MessagePackSerializer.Serialize(T value, MessagePack.MessagePackSerializerOptions options = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) -> byte[] +static MessagePack.MessagePackSerializer.Serialize(ref MessagePack.MessagePackWriter writer, T value, MessagePack.MessagePackSerializerOptions options = null) -> void +static MessagePack.MessagePackSerializer.SerializeAsync(System.Type type, System.IO.Stream stream, object obj, MessagePack.MessagePackSerializerOptions options = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) -> System.Threading.Tasks.Task +static MessagePack.MessagePackSerializer.SerializeAsync(System.IO.Stream stream, T value, MessagePack.MessagePackSerializerOptions options = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) -> System.Threading.Tasks.Task +static MessagePack.MessagePackSerializer.SerializeToJson(System.IO.TextWriter textWriter, T obj, MessagePack.MessagePackSerializerOptions options = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) -> void +static MessagePack.MessagePackSerializer.SerializeToJson(T obj, MessagePack.MessagePackSerializerOptions options = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) -> string +static MessagePack.MessagePackSerializer.Typeless.DefaultOptions.get -> MessagePack.MessagePackSerializerOptions +static MessagePack.MessagePackSerializer.Typeless.DefaultOptions.set -> void +static MessagePack.MessagePackSerializer.Typeless.Deserialize(System.IO.Stream stream, MessagePack.MessagePackSerializerOptions options = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) -> object +static MessagePack.MessagePackSerializer.Typeless.Deserialize(System.Memory bytes, MessagePack.MessagePackSerializerOptions options = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) -> object +static MessagePack.MessagePackSerializer.Typeless.Deserialize(in System.Buffers.ReadOnlySequence byteSequence, MessagePack.MessagePackSerializerOptions options = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) -> object +static MessagePack.MessagePackSerializer.Typeless.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options = null) -> object +static MessagePack.MessagePackSerializer.Typeless.DeserializeAsync(System.IO.Stream stream, MessagePack.MessagePackSerializerOptions options = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) -> System.Threading.Tasks.ValueTask +static MessagePack.MessagePackSerializer.Typeless.Serialize(System.Buffers.IBufferWriter writer, object obj, MessagePack.MessagePackSerializerOptions options = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) -> void +static MessagePack.MessagePackSerializer.Typeless.Serialize(System.IO.Stream stream, object obj, MessagePack.MessagePackSerializerOptions options = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) -> void +static MessagePack.MessagePackSerializer.Typeless.Serialize(object obj, MessagePack.MessagePackSerializerOptions options = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) -> byte[] +static MessagePack.MessagePackSerializer.Typeless.Serialize(ref MessagePack.MessagePackWriter writer, object obj, MessagePack.MessagePackSerializerOptions options = null) -> void +static MessagePack.MessagePackSerializer.Typeless.SerializeAsync(System.IO.Stream stream, object obj, MessagePack.MessagePackSerializerOptions options = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) -> System.Threading.Tasks.Task +static MessagePack.MessagePackSerializerOptions.Standard.get -> MessagePack.MessagePackSerializerOptions +static MessagePack.Resolvers.CompositeResolver.Create(System.Collections.Generic.IReadOnlyList formatters, System.Collections.Generic.IReadOnlyList resolvers) -> MessagePack.IFormatterResolver +static MessagePack.Resolvers.CompositeResolver.Create(params MessagePack.Formatters.IMessagePackFormatter[] formatters) -> MessagePack.IFormatterResolver +static MessagePack.Resolvers.CompositeResolver.Create(params MessagePack.IFormatterResolver[] resolvers) -> MessagePack.IFormatterResolver +static readonly MessagePack.Formatters.BigIntegerFormatter.Instance -> MessagePack.Formatters.IMessagePackFormatter +static readonly MessagePack.Formatters.BitArrayFormatter.Instance -> MessagePack.Formatters.IMessagePackFormatter +static readonly MessagePack.Formatters.BooleanArrayFormatter.Instance -> MessagePack.Formatters.BooleanArrayFormatter +static readonly MessagePack.Formatters.BooleanFormatter.Instance -> MessagePack.Formatters.BooleanFormatter +static readonly MessagePack.Formatters.ByteArrayFormatter.Instance -> MessagePack.Formatters.ByteArrayFormatter +static readonly MessagePack.Formatters.ByteArraySegmentFormatter.Instance -> MessagePack.Formatters.ByteArraySegmentFormatter +static readonly MessagePack.Formatters.ByteFormatter.Instance -> MessagePack.Formatters.ByteFormatter +static readonly MessagePack.Formatters.CharArrayFormatter.Instance -> MessagePack.Formatters.CharArrayFormatter +static readonly MessagePack.Formatters.CharFormatter.Instance -> MessagePack.Formatters.CharFormatter +static readonly MessagePack.Formatters.ComplexFormatter.Instance -> MessagePack.Formatters.IMessagePackFormatter +static readonly MessagePack.Formatters.DateTimeArrayFormatter.Instance -> MessagePack.Formatters.DateTimeArrayFormatter +static readonly MessagePack.Formatters.DateTimeFormatter.Instance -> MessagePack.Formatters.DateTimeFormatter +static readonly MessagePack.Formatters.DateTimeOffsetFormatter.Instance -> MessagePack.Formatters.IMessagePackFormatter +static readonly MessagePack.Formatters.DecimalFormatter.Instance -> MessagePack.Formatters.DecimalFormatter +static readonly MessagePack.Formatters.DoubleArrayFormatter.Instance -> MessagePack.Formatters.DoubleArrayFormatter +static readonly MessagePack.Formatters.DoubleFormatter.Instance -> MessagePack.Formatters.DoubleFormatter +static readonly MessagePack.Formatters.DynamicObjectTypeFallbackFormatter.Instance -> MessagePack.Formatters.IMessagePackFormatter +static readonly MessagePack.Formatters.ForceByteBlockFormatter.Instance -> MessagePack.Formatters.ForceByteBlockFormatter +static readonly MessagePack.Formatters.ForceInt16BlockArrayFormatter.Instance -> MessagePack.Formatters.ForceInt16BlockArrayFormatter +static readonly MessagePack.Formatters.ForceInt16BlockFormatter.Instance -> MessagePack.Formatters.ForceInt16BlockFormatter +static readonly MessagePack.Formatters.ForceInt32BlockArrayFormatter.Instance -> MessagePack.Formatters.ForceInt32BlockArrayFormatter +static readonly MessagePack.Formatters.ForceInt32BlockFormatter.Instance -> MessagePack.Formatters.ForceInt32BlockFormatter +static readonly MessagePack.Formatters.ForceInt64BlockArrayFormatter.Instance -> MessagePack.Formatters.ForceInt64BlockArrayFormatter +static readonly MessagePack.Formatters.ForceInt64BlockFormatter.Instance -> MessagePack.Formatters.ForceInt64BlockFormatter +static readonly MessagePack.Formatters.ForceSByteBlockArrayFormatter.Instance -> MessagePack.Formatters.ForceSByteBlockArrayFormatter +static readonly MessagePack.Formatters.ForceSByteBlockFormatter.Instance -> MessagePack.Formatters.ForceSByteBlockFormatter +static readonly MessagePack.Formatters.ForceUInt16BlockArrayFormatter.Instance -> MessagePack.Formatters.ForceUInt16BlockArrayFormatter +static readonly MessagePack.Formatters.ForceUInt16BlockFormatter.Instance -> MessagePack.Formatters.ForceUInt16BlockFormatter +static readonly MessagePack.Formatters.ForceUInt32BlockArrayFormatter.Instance -> MessagePack.Formatters.ForceUInt32BlockArrayFormatter +static readonly MessagePack.Formatters.ForceUInt32BlockFormatter.Instance -> MessagePack.Formatters.ForceUInt32BlockFormatter +static readonly MessagePack.Formatters.ForceUInt64BlockArrayFormatter.Instance -> MessagePack.Formatters.ForceUInt64BlockArrayFormatter +static readonly MessagePack.Formatters.ForceUInt64BlockFormatter.Instance -> MessagePack.Formatters.ForceUInt64BlockFormatter +static readonly MessagePack.Formatters.GuidFormatter.Instance -> MessagePack.Formatters.IMessagePackFormatter +static readonly MessagePack.Formatters.Int16ArrayFormatter.Instance -> MessagePack.Formatters.Int16ArrayFormatter +static readonly MessagePack.Formatters.Int16Formatter.Instance -> MessagePack.Formatters.Int16Formatter +static readonly MessagePack.Formatters.Int32ArrayFormatter.Instance -> MessagePack.Formatters.Int32ArrayFormatter +static readonly MessagePack.Formatters.Int32Formatter.Instance -> MessagePack.Formatters.Int32Formatter +static readonly MessagePack.Formatters.Int64ArrayFormatter.Instance -> MessagePack.Formatters.Int64ArrayFormatter +static readonly MessagePack.Formatters.Int64Formatter.Instance -> MessagePack.Formatters.Int64Formatter +static readonly MessagePack.Formatters.NativeDateTimeArrayFormatter.Instance -> MessagePack.Formatters.NativeDateTimeArrayFormatter +static readonly MessagePack.Formatters.NativeDateTimeFormatter.Instance -> MessagePack.Formatters.NativeDateTimeFormatter +static readonly MessagePack.Formatters.NativeDecimalFormatter.Instance -> MessagePack.Formatters.IMessagePackFormatter +static readonly MessagePack.Formatters.NativeGuidFormatter.Instance -> MessagePack.Formatters.IMessagePackFormatter +static readonly MessagePack.Formatters.NilFormatter.Instance -> MessagePack.Formatters.IMessagePackFormatter +static readonly MessagePack.Formatters.NonGenericInterfaceDictionaryFormatter.Instance -> MessagePack.Formatters.IMessagePackFormatter +static readonly MessagePack.Formatters.NonGenericInterfaceListFormatter.Instance -> MessagePack.Formatters.IMessagePackFormatter +static readonly MessagePack.Formatters.NullableBooleanFormatter.Instance -> MessagePack.Formatters.NullableBooleanFormatter +static readonly MessagePack.Formatters.NullableByteFormatter.Instance -> MessagePack.Formatters.NullableByteFormatter +static readonly MessagePack.Formatters.NullableCharFormatter.Instance -> MessagePack.Formatters.NullableCharFormatter +static readonly MessagePack.Formatters.NullableDateTimeFormatter.Instance -> MessagePack.Formatters.NullableDateTimeFormatter +static readonly MessagePack.Formatters.NullableDoubleFormatter.Instance -> MessagePack.Formatters.NullableDoubleFormatter +static readonly MessagePack.Formatters.NullableForceByteBlockFormatter.Instance -> MessagePack.Formatters.NullableForceByteBlockFormatter +static readonly MessagePack.Formatters.NullableForceInt16BlockFormatter.Instance -> MessagePack.Formatters.NullableForceInt16BlockFormatter +static readonly MessagePack.Formatters.NullableForceInt32BlockFormatter.Instance -> MessagePack.Formatters.NullableForceInt32BlockFormatter +static readonly MessagePack.Formatters.NullableForceInt64BlockFormatter.Instance -> MessagePack.Formatters.NullableForceInt64BlockFormatter +static readonly MessagePack.Formatters.NullableForceSByteBlockFormatter.Instance -> MessagePack.Formatters.NullableForceSByteBlockFormatter +static readonly MessagePack.Formatters.NullableForceUInt16BlockFormatter.Instance -> MessagePack.Formatters.NullableForceUInt16BlockFormatter +static readonly MessagePack.Formatters.NullableForceUInt32BlockFormatter.Instance -> MessagePack.Formatters.NullableForceUInt32BlockFormatter +static readonly MessagePack.Formatters.NullableForceUInt64BlockFormatter.Instance -> MessagePack.Formatters.NullableForceUInt64BlockFormatter +static readonly MessagePack.Formatters.NullableInt16Formatter.Instance -> MessagePack.Formatters.NullableInt16Formatter +static readonly MessagePack.Formatters.NullableInt32Formatter.Instance -> MessagePack.Formatters.NullableInt32Formatter +static readonly MessagePack.Formatters.NullableInt64Formatter.Instance -> MessagePack.Formatters.NullableInt64Formatter +static readonly MessagePack.Formatters.NullableNilFormatter.Instance -> MessagePack.Formatters.IMessagePackFormatter +static readonly MessagePack.Formatters.NullableSByteFormatter.Instance -> MessagePack.Formatters.NullableSByteFormatter +static readonly MessagePack.Formatters.NullableSingleFormatter.Instance -> MessagePack.Formatters.NullableSingleFormatter +static readonly MessagePack.Formatters.NullableStringArrayFormatter.Instance -> MessagePack.Formatters.NullableStringArrayFormatter +static readonly MessagePack.Formatters.NullableStringFormatter.Instance -> MessagePack.Formatters.NullableStringFormatter +static readonly MessagePack.Formatters.NullableUInt16Formatter.Instance -> MessagePack.Formatters.NullableUInt16Formatter +static readonly MessagePack.Formatters.NullableUInt32Formatter.Instance -> MessagePack.Formatters.NullableUInt32Formatter +static readonly MessagePack.Formatters.NullableUInt64Formatter.Instance -> MessagePack.Formatters.NullableUInt64Formatter +static readonly MessagePack.Formatters.PrimitiveObjectFormatter.Instance -> MessagePack.Formatters.IMessagePackFormatter +static readonly MessagePack.Formatters.SByteArrayFormatter.Instance -> MessagePack.Formatters.SByteArrayFormatter +static readonly MessagePack.Formatters.SByteFormatter.Instance -> MessagePack.Formatters.SByteFormatter +static readonly MessagePack.Formatters.SingleArrayFormatter.Instance -> MessagePack.Formatters.SingleArrayFormatter +static readonly MessagePack.Formatters.SingleFormatter.Instance -> MessagePack.Formatters.SingleFormatter +static readonly MessagePack.Formatters.StringBuilderFormatter.Instance -> MessagePack.Formatters.IMessagePackFormatter +static readonly MessagePack.Formatters.TimeSpanFormatter.Instance -> MessagePack.Formatters.IMessagePackFormatter +static readonly MessagePack.Formatters.TypelessFormatter.Instance -> MessagePack.Formatters.IMessagePackFormatter +static readonly MessagePack.Formatters.UInt16ArrayFormatter.Instance -> MessagePack.Formatters.UInt16ArrayFormatter +static readonly MessagePack.Formatters.UInt16Formatter.Instance -> MessagePack.Formatters.UInt16Formatter +static readonly MessagePack.Formatters.UInt32ArrayFormatter.Instance -> MessagePack.Formatters.UInt32ArrayFormatter +static readonly MessagePack.Formatters.UInt32Formatter.Instance -> MessagePack.Formatters.UInt32Formatter +static readonly MessagePack.Formatters.UInt64ArrayFormatter.Instance -> MessagePack.Formatters.UInt64ArrayFormatter +static readonly MessagePack.Formatters.UInt64Formatter.Instance -> MessagePack.Formatters.UInt64Formatter +static readonly MessagePack.Formatters.UriFormatter.Instance -> MessagePack.Formatters.IMessagePackFormatter +static readonly MessagePack.Formatters.VersionFormatter.Instance -> MessagePack.Formatters.IMessagePackFormatter +static readonly MessagePack.Internal.AutomataKeyGen.GetKeyMethod -> System.Reflection.MethodInfo +static readonly MessagePack.Internal.RuntimeTypeHandleEqualityComparer.Default -> System.Collections.Generic.IEqualityComparer +static readonly MessagePack.Internal.UnsafeMemory.Is32Bit -> bool +static readonly MessagePack.Nil.Default -> MessagePack.Nil +static readonly MessagePack.Resolvers.AttributeFormatterResolver.Instance -> MessagePack.Resolvers.AttributeFormatterResolver +static readonly MessagePack.Resolvers.BuiltinResolver.Instance -> MessagePack.Resolvers.BuiltinResolver +static readonly MessagePack.Resolvers.ContractlessStandardResolver.Instance -> MessagePack.Resolvers.ContractlessStandardResolver +static readonly MessagePack.Resolvers.ContractlessStandardResolver.Options -> MessagePack.MessagePackSerializerOptions +static readonly MessagePack.Resolvers.ContractlessStandardResolverAllowPrivate.Instance -> MessagePack.Resolvers.ContractlessStandardResolverAllowPrivate +static readonly MessagePack.Resolvers.ContractlessStandardResolverAllowPrivate.Options -> MessagePack.MessagePackSerializerOptions +static readonly MessagePack.Resolvers.DynamicContractlessObjectResolver.Instance -> MessagePack.Resolvers.DynamicContractlessObjectResolver +static readonly MessagePack.Resolvers.DynamicContractlessObjectResolverAllowPrivate.Instance -> MessagePack.Resolvers.DynamicContractlessObjectResolverAllowPrivate +static readonly MessagePack.Resolvers.DynamicEnumAsStringResolver.Instance -> MessagePack.Resolvers.DynamicEnumAsStringResolver +static readonly MessagePack.Resolvers.DynamicEnumAsStringResolver.Options -> MessagePack.MessagePackSerializerOptions +static readonly MessagePack.Resolvers.DynamicEnumResolver.Instance -> MessagePack.Resolvers.DynamicEnumResolver +static readonly MessagePack.Resolvers.DynamicGenericResolver.Instance -> MessagePack.Resolvers.DynamicGenericResolver +static readonly MessagePack.Resolvers.DynamicObjectResolver.Instance -> MessagePack.Resolvers.DynamicObjectResolver +static readonly MessagePack.Resolvers.DynamicObjectResolver.Options -> MessagePack.MessagePackSerializerOptions +static readonly MessagePack.Resolvers.DynamicObjectResolverAllowPrivate.Instance -> MessagePack.Resolvers.DynamicObjectResolverAllowPrivate +static readonly MessagePack.Resolvers.DynamicUnionResolver.Instance -> MessagePack.Resolvers.DynamicUnionResolver +static readonly MessagePack.Resolvers.DynamicUnionResolver.Options -> MessagePack.MessagePackSerializerOptions +static readonly MessagePack.Resolvers.NativeDateTimeResolver.Instance -> MessagePack.Resolvers.NativeDateTimeResolver +static readonly MessagePack.Resolvers.NativeDateTimeResolver.Options -> MessagePack.MessagePackSerializerOptions +static readonly MessagePack.Resolvers.NativeDecimalResolver.Instance -> MessagePack.Resolvers.NativeDecimalResolver +static readonly MessagePack.Resolvers.NativeGuidResolver.Instance -> MessagePack.Resolvers.NativeGuidResolver +static readonly MessagePack.Resolvers.PrimitiveObjectResolver.Instance -> MessagePack.Resolvers.PrimitiveObjectResolver +static readonly MessagePack.Resolvers.PrimitiveObjectResolver.Options -> MessagePack.MessagePackSerializerOptions +static readonly MessagePack.Resolvers.StandardResolver.Instance -> MessagePack.Resolvers.StandardResolver +static readonly MessagePack.Resolvers.StandardResolver.Options -> MessagePack.MessagePackSerializerOptions +static readonly MessagePack.Resolvers.StandardResolverAllowPrivate.Instance -> MessagePack.Resolvers.StandardResolverAllowPrivate +static readonly MessagePack.Resolvers.StandardResolverAllowPrivate.Options -> MessagePack.MessagePackSerializerOptions +static readonly MessagePack.Resolvers.StaticCompositeResolver.Instance -> MessagePack.Resolvers.StaticCompositeResolver +static readonly MessagePack.Resolvers.TypelessContractlessStandardResolver.Instance -> MessagePack.Resolvers.TypelessContractlessStandardResolver +static readonly MessagePack.Resolvers.TypelessContractlessStandardResolver.Options -> MessagePack.MessagePackSerializerOptions +static readonly MessagePack.Resolvers.TypelessObjectResolver.Instance -> MessagePack.IFormatterResolver +virtual MessagePack.Formatters.CollectionFormatterBase.GetCount(TCollection sequence) -> int? +virtual MessagePack.MessagePackSerializerOptions.Clone() -> MessagePack.MessagePackSerializerOptions +virtual MessagePack.MessagePackSerializerOptions.LoadType(string typeName) -> System.Type +virtual MessagePack.MessagePackSerializerOptions.ThrowIfDeserializingTypeIsDisallowed(System.Type type) -> void +MessagePack.ExtensionHeader.Equals(MessagePack.ExtensionHeader other) -> bool +MessagePack.Formatters.InterfaceCollectionFormatter2 +MessagePack.Formatters.InterfaceCollectionFormatter2.InterfaceCollectionFormatter2() -> void +MessagePack.Formatters.InterfaceListFormatter2 +MessagePack.Formatters.InterfaceListFormatter2.InterfaceListFormatter2() -> void +MessagePack.MessagePackReader.Depth.get -> int +MessagePack.MessagePackReader.Depth.set -> void +MessagePack.MessagePackReader.ReadDateTime(MessagePack.ExtensionHeader header) -> System.DateTime +MessagePack.MessagePackReader.TryReadArrayHeader(out int count) -> bool +MessagePack.MessagePackReader.TryReadExtensionFormatHeader(out MessagePack.ExtensionHeader extensionHeader) -> bool +MessagePack.MessagePackReader.TryReadMapHeader(out int count) -> bool +MessagePack.MessagePackSecurity +MessagePack.MessagePackSecurity.DepthStep(ref MessagePack.MessagePackReader reader) -> void +MessagePack.MessagePackSecurity.GetEqualityComparer() -> System.Collections.IEqualityComparer +MessagePack.MessagePackSecurity.GetEqualityComparer() -> System.Collections.Generic.IEqualityComparer +MessagePack.MessagePackSecurity.HashCollisionResistant.get -> bool +MessagePack.MessagePackSecurity.MaximumObjectGraphDepth.get -> int +MessagePack.MessagePackSecurity.MessagePackSecurity(MessagePack.MessagePackSecurity copyFrom) -> void +MessagePack.MessagePackSecurity.WithHashCollisionResistant(bool hashCollisionResistant) -> MessagePack.MessagePackSecurity +MessagePack.MessagePackSecurity.WithMaximumObjectGraphDepth(int maximumObjectGraphDepth) -> MessagePack.MessagePackSecurity +MessagePack.MessagePackSerializerOptions.Security.get -> MessagePack.MessagePackSecurity +MessagePack.MessagePackSerializerOptions.WithSecurity(MessagePack.MessagePackSecurity security) -> MessagePack.MessagePackSerializerOptions +MessagePack.MessagePackStreamReader.DiscardBufferedData() -> void +MessagePack.MessagePackStreamReader.MessagePackStreamReader(System.IO.Stream stream, bool leaveOpen) -> void +MessagePack.MessagePackStreamReader.ReadArrayAsync(System.Threading.CancellationToken cancellationToken) -> System.Collections.Generic.IAsyncEnumerable> +MessagePack.MessagePackWriter.WriteBinHeader(int length) -> void +MessagePack.MessagePackWriter.WriteStringHeader(int byteCount) -> void +static readonly MessagePack.MessagePackSecurity.TrustedData -> MessagePack.MessagePackSecurity +static readonly MessagePack.MessagePackSecurity.UntrustedData -> MessagePack.MessagePackSecurity +virtual MessagePack.MessagePackSecurity.Clone() -> MessagePack.MessagePackSecurity +virtual MessagePack.MessagePackSecurity.GetHashCollisionResistantEqualityComparer() -> System.Collections.IEqualityComparer +virtual MessagePack.MessagePackSecurity.GetHashCollisionResistantEqualityComparer() -> System.Collections.Generic.IEqualityComparer +MessagePack.Formatters.ByteMemoryFormatter +MessagePack.Formatters.ByteMemoryFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> System.Memory +MessagePack.Formatters.ByteMemoryFormatter.Serialize(ref MessagePack.MessagePackWriter writer, System.Memory value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.ByteReadOnlyMemoryFormatter +MessagePack.Formatters.ByteReadOnlyMemoryFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> System.ReadOnlyMemory +MessagePack.Formatters.ByteReadOnlyMemoryFormatter.Serialize(ref MessagePack.MessagePackWriter writer, System.ReadOnlyMemory value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.ByteReadOnlySequenceFormatter +MessagePack.Formatters.ByteReadOnlySequenceFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> System.Buffers.ReadOnlySequence +MessagePack.Formatters.ByteReadOnlySequenceFormatter.Serialize(ref MessagePack.MessagePackWriter writer, System.Buffers.ReadOnlySequence value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.ExpandoObjectFormatter +MessagePack.Formatters.ExpandoObjectFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> System.Dynamic.ExpandoObject +MessagePack.Formatters.ExpandoObjectFormatter.Serialize(ref MessagePack.MessagePackWriter writer, System.Dynamic.ExpandoObject value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.ForceTypelessFormatter +MessagePack.Formatters.ForceTypelessFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> T +MessagePack.Formatters.ForceTypelessFormatter.ForceTypelessFormatter() -> void +MessagePack.Formatters.ForceTypelessFormatter.Serialize(ref MessagePack.MessagePackWriter writer, T value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.MemoryFormatter +MessagePack.Formatters.MemoryFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> System.Memory +MessagePack.Formatters.MemoryFormatter.MemoryFormatter() -> void +MessagePack.Formatters.MemoryFormatter.Serialize(ref MessagePack.MessagePackWriter writer, System.Memory value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.NonGenericInterfaceCollectionFormatter +MessagePack.Formatters.NonGenericInterfaceCollectionFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> System.Collections.ICollection +MessagePack.Formatters.NonGenericInterfaceCollectionFormatter.Serialize(ref MessagePack.MessagePackWriter writer, System.Collections.ICollection value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.NonGenericInterfaceEnumerableFormatter +MessagePack.Formatters.NonGenericInterfaceEnumerableFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> System.Collections.IEnumerable +MessagePack.Formatters.NonGenericInterfaceEnumerableFormatter.Serialize(ref MessagePack.MessagePackWriter writer, System.Collections.IEnumerable value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.PrimitiveObjectFormatter.PrimitiveObjectFormatter() -> void +MessagePack.Formatters.ReadOnlyMemoryFormatter +MessagePack.Formatters.ReadOnlyMemoryFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> System.ReadOnlyMemory +MessagePack.Formatters.ReadOnlyMemoryFormatter.ReadOnlyMemoryFormatter() -> void +MessagePack.Formatters.ReadOnlyMemoryFormatter.Serialize(ref MessagePack.MessagePackWriter writer, System.ReadOnlyMemory value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.ReadOnlySequenceFormatter +MessagePack.Formatters.ReadOnlySequenceFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> System.Buffers.ReadOnlySequence +MessagePack.Formatters.ReadOnlySequenceFormatter.ReadOnlySequenceFormatter() -> void +MessagePack.Formatters.ReadOnlySequenceFormatter.Serialize(ref MessagePack.MessagePackWriter writer, System.Buffers.ReadOnlySequence value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.TypeFormatter +MessagePack.Formatters.TypeFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> T +MessagePack.Formatters.TypeFormatter.Serialize(ref MessagePack.MessagePackWriter writer, T value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.TypelessFormatter.TypelessFormatter() -> void +MessagePack.ImmutableCollection.ImmutableArrayFormatter +MessagePack.ImmutableCollection.ImmutableArrayFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> System.Collections.Immutable.ImmutableArray +MessagePack.ImmutableCollection.ImmutableArrayFormatter.ImmutableArrayFormatter() -> void +MessagePack.ImmutableCollection.ImmutableArrayFormatter.Serialize(ref MessagePack.MessagePackWriter writer, System.Collections.Immutable.ImmutableArray value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.ImmutableCollection.ImmutableCollectionResolver +MessagePack.ImmutableCollection.ImmutableCollectionResolver.GetFormatter() -> MessagePack.Formatters.IMessagePackFormatter +MessagePack.ImmutableCollection.ImmutableDictionaryFormatter +MessagePack.ImmutableCollection.ImmutableDictionaryFormatter.ImmutableDictionaryFormatter() -> void +MessagePack.ImmutableCollection.ImmutableHashSetFormatter +MessagePack.ImmutableCollection.ImmutableHashSetFormatter.ImmutableHashSetFormatter() -> void +MessagePack.ImmutableCollection.ImmutableListFormatter +MessagePack.ImmutableCollection.ImmutableListFormatter.ImmutableListFormatter() -> void +MessagePack.ImmutableCollection.ImmutableQueueBuilder +MessagePack.ImmutableCollection.ImmutableQueueBuilder.Add(T value) -> void +MessagePack.ImmutableCollection.ImmutableQueueBuilder.ImmutableQueueBuilder() -> void +MessagePack.ImmutableCollection.ImmutableQueueBuilder.Q.get -> System.Collections.Immutable.ImmutableQueue +MessagePack.ImmutableCollection.ImmutableQueueBuilder.Q.set -> void +MessagePack.ImmutableCollection.ImmutableQueueFormatter +MessagePack.ImmutableCollection.ImmutableQueueFormatter.ImmutableQueueFormatter() -> void +MessagePack.ImmutableCollection.ImmutableSortedDictionaryFormatter +MessagePack.ImmutableCollection.ImmutableSortedDictionaryFormatter.ImmutableSortedDictionaryFormatter() -> void +MessagePack.ImmutableCollection.ImmutableSortedSetFormatter +MessagePack.ImmutableCollection.ImmutableSortedSetFormatter.ImmutableSortedSetFormatter() -> void +MessagePack.ImmutableCollection.ImmutableStackFormatter +MessagePack.ImmutableCollection.ImmutableStackFormatter.ImmutableStackFormatter() -> void +MessagePack.ImmutableCollection.InterfaceImmutableDictionaryFormatter +MessagePack.ImmutableCollection.InterfaceImmutableDictionaryFormatter.InterfaceImmutableDictionaryFormatter() -> void +MessagePack.ImmutableCollection.InterfaceImmutableListFormatter +MessagePack.ImmutableCollection.InterfaceImmutableListFormatter.InterfaceImmutableListFormatter() -> void +MessagePack.ImmutableCollection.InterfaceImmutableQueueFormatter +MessagePack.ImmutableCollection.InterfaceImmutableQueueFormatter.InterfaceImmutableQueueFormatter() -> void +MessagePack.ImmutableCollection.InterfaceImmutableSetFormatter +MessagePack.ImmutableCollection.InterfaceImmutableSetFormatter.InterfaceImmutableSetFormatter() -> void +MessagePack.ImmutableCollection.InterfaceImmutableStackFormatter +MessagePack.ImmutableCollection.InterfaceImmutableStackFormatter.InterfaceImmutableStackFormatter() -> void +MessagePack.Resolvers.ExpandoObjectResolver +override MessagePack.ImmutableCollection.ImmutableDictionaryFormatter.Add(System.Collections.Immutable.ImmutableDictionary.Builder collection, int index, TKey key, TValue value, MessagePack.MessagePackSerializerOptions options) -> void +override MessagePack.ImmutableCollection.ImmutableDictionaryFormatter.Complete(System.Collections.Immutable.ImmutableDictionary.Builder intermediateCollection) -> System.Collections.Immutable.ImmutableDictionary +override MessagePack.ImmutableCollection.ImmutableDictionaryFormatter.Create(int count, MessagePack.MessagePackSerializerOptions options) -> System.Collections.Immutable.ImmutableDictionary.Builder +override MessagePack.ImmutableCollection.ImmutableDictionaryFormatter.GetSourceEnumerator(System.Collections.Immutable.ImmutableDictionary source) -> System.Collections.Immutable.ImmutableDictionary.Enumerator +override MessagePack.ImmutableCollection.ImmutableHashSetFormatter.Add(System.Collections.Immutable.ImmutableHashSet.Builder collection, int index, T value, MessagePack.MessagePackSerializerOptions options) -> void +override MessagePack.ImmutableCollection.ImmutableHashSetFormatter.Complete(System.Collections.Immutable.ImmutableHashSet.Builder intermediateCollection) -> System.Collections.Immutable.ImmutableHashSet +override MessagePack.ImmutableCollection.ImmutableHashSetFormatter.Create(int count, MessagePack.MessagePackSerializerOptions options) -> System.Collections.Immutable.ImmutableHashSet.Builder +override MessagePack.ImmutableCollection.ImmutableHashSetFormatter.GetSourceEnumerator(System.Collections.Immutable.ImmutableHashSet source) -> System.Collections.Immutable.ImmutableHashSet.Enumerator +override MessagePack.ImmutableCollection.ImmutableListFormatter.Add(System.Collections.Immutable.ImmutableList.Builder collection, int index, T value, MessagePack.MessagePackSerializerOptions options) -> void +override MessagePack.ImmutableCollection.ImmutableListFormatter.Complete(System.Collections.Immutable.ImmutableList.Builder intermediateCollection) -> System.Collections.Immutable.ImmutableList +override MessagePack.ImmutableCollection.ImmutableListFormatter.Create(int count, MessagePack.MessagePackSerializerOptions options) -> System.Collections.Immutable.ImmutableList.Builder +override MessagePack.ImmutableCollection.ImmutableListFormatter.GetSourceEnumerator(System.Collections.Immutable.ImmutableList source) -> System.Collections.Immutable.ImmutableList.Enumerator +override MessagePack.ImmutableCollection.ImmutableQueueFormatter.Add(MessagePack.ImmutableCollection.ImmutableQueueBuilder collection, int index, T value, MessagePack.MessagePackSerializerOptions options) -> void +override MessagePack.ImmutableCollection.ImmutableQueueFormatter.Complete(MessagePack.ImmutableCollection.ImmutableQueueBuilder intermediateCollection) -> System.Collections.Immutable.ImmutableQueue +override MessagePack.ImmutableCollection.ImmutableQueueFormatter.Create(int count, MessagePack.MessagePackSerializerOptions options) -> MessagePack.ImmutableCollection.ImmutableQueueBuilder +override MessagePack.ImmutableCollection.ImmutableSortedDictionaryFormatter.Add(System.Collections.Immutable.ImmutableSortedDictionary.Builder collection, int index, TKey key, TValue value, MessagePack.MessagePackSerializerOptions options) -> void +override MessagePack.ImmutableCollection.ImmutableSortedDictionaryFormatter.Complete(System.Collections.Immutable.ImmutableSortedDictionary.Builder intermediateCollection) -> System.Collections.Immutable.ImmutableSortedDictionary +override MessagePack.ImmutableCollection.ImmutableSortedDictionaryFormatter.Create(int count, MessagePack.MessagePackSerializerOptions options) -> System.Collections.Immutable.ImmutableSortedDictionary.Builder +override MessagePack.ImmutableCollection.ImmutableSortedDictionaryFormatter.GetSourceEnumerator(System.Collections.Immutable.ImmutableSortedDictionary source) -> System.Collections.Immutable.ImmutableSortedDictionary.Enumerator +override MessagePack.ImmutableCollection.ImmutableSortedSetFormatter.Add(System.Collections.Immutable.ImmutableSortedSet.Builder collection, int index, T value, MessagePack.MessagePackSerializerOptions options) -> void +override MessagePack.ImmutableCollection.ImmutableSortedSetFormatter.Complete(System.Collections.Immutable.ImmutableSortedSet.Builder intermediateCollection) -> System.Collections.Immutable.ImmutableSortedSet +override MessagePack.ImmutableCollection.ImmutableSortedSetFormatter.Create(int count, MessagePack.MessagePackSerializerOptions options) -> System.Collections.Immutable.ImmutableSortedSet.Builder +override MessagePack.ImmutableCollection.ImmutableSortedSetFormatter.GetSourceEnumerator(System.Collections.Immutable.ImmutableSortedSet source) -> System.Collections.Immutable.ImmutableSortedSet.Enumerator +override MessagePack.ImmutableCollection.ImmutableStackFormatter.Add(T[] collection, int index, T value, MessagePack.MessagePackSerializerOptions options) -> void +override MessagePack.ImmutableCollection.ImmutableStackFormatter.Complete(T[] intermediateCollection) -> System.Collections.Immutable.ImmutableStack +override MessagePack.ImmutableCollection.ImmutableStackFormatter.Create(int count, MessagePack.MessagePackSerializerOptions options) -> T[] +override MessagePack.ImmutableCollection.InterfaceImmutableDictionaryFormatter.Add(System.Collections.Immutable.ImmutableDictionary.Builder collection, int index, TKey key, TValue value, MessagePack.MessagePackSerializerOptions options) -> void +override MessagePack.ImmutableCollection.InterfaceImmutableDictionaryFormatter.Complete(System.Collections.Immutable.ImmutableDictionary.Builder intermediateCollection) -> System.Collections.Immutable.IImmutableDictionary +override MessagePack.ImmutableCollection.InterfaceImmutableDictionaryFormatter.Create(int count, MessagePack.MessagePackSerializerOptions options) -> System.Collections.Immutable.ImmutableDictionary.Builder +override MessagePack.ImmutableCollection.InterfaceImmutableListFormatter.Add(System.Collections.Immutable.ImmutableList.Builder collection, int index, T value, MessagePack.MessagePackSerializerOptions options) -> void +override MessagePack.ImmutableCollection.InterfaceImmutableListFormatter.Complete(System.Collections.Immutable.ImmutableList.Builder intermediateCollection) -> System.Collections.Immutable.IImmutableList +override MessagePack.ImmutableCollection.InterfaceImmutableListFormatter.Create(int count, MessagePack.MessagePackSerializerOptions options) -> System.Collections.Immutable.ImmutableList.Builder +override MessagePack.ImmutableCollection.InterfaceImmutableQueueFormatter.Add(MessagePack.ImmutableCollection.ImmutableQueueBuilder collection, int index, T value, MessagePack.MessagePackSerializerOptions options) -> void +override MessagePack.ImmutableCollection.InterfaceImmutableQueueFormatter.Complete(MessagePack.ImmutableCollection.ImmutableQueueBuilder intermediateCollection) -> System.Collections.Immutable.IImmutableQueue +override MessagePack.ImmutableCollection.InterfaceImmutableQueueFormatter.Create(int count, MessagePack.MessagePackSerializerOptions options) -> MessagePack.ImmutableCollection.ImmutableQueueBuilder +override MessagePack.ImmutableCollection.InterfaceImmutableSetFormatter.Add(System.Collections.Immutable.ImmutableHashSet.Builder collection, int index, T value, MessagePack.MessagePackSerializerOptions options) -> void +override MessagePack.ImmutableCollection.InterfaceImmutableSetFormatter.Complete(System.Collections.Immutable.ImmutableHashSet.Builder intermediateCollection) -> System.Collections.Immutable.IImmutableSet +override MessagePack.ImmutableCollection.InterfaceImmutableSetFormatter.Create(int count, MessagePack.MessagePackSerializerOptions options) -> System.Collections.Immutable.ImmutableHashSet.Builder +override MessagePack.ImmutableCollection.InterfaceImmutableStackFormatter.Add(T[] collection, int index, T value, MessagePack.MessagePackSerializerOptions options) -> void +override MessagePack.ImmutableCollection.InterfaceImmutableStackFormatter.Complete(T[] intermediateCollection) -> System.Collections.Immutable.IImmutableStack +override MessagePack.ImmutableCollection.InterfaceImmutableStackFormatter.Create(int count, MessagePack.MessagePackSerializerOptions options) -> T[] +static readonly MessagePack.Formatters.ByteMemoryFormatter.Instance -> MessagePack.Formatters.ByteMemoryFormatter +static readonly MessagePack.Formatters.ByteReadOnlyMemoryFormatter.Instance -> MessagePack.Formatters.ByteReadOnlyMemoryFormatter +static readonly MessagePack.Formatters.ByteReadOnlySequenceFormatter.Instance -> MessagePack.Formatters.ByteReadOnlySequenceFormatter +static readonly MessagePack.Formatters.ExpandoObjectFormatter.Instance -> MessagePack.Formatters.IMessagePackFormatter +static readonly MessagePack.Formatters.NonGenericInterfaceCollectionFormatter.Instance -> MessagePack.Formatters.IMessagePackFormatter +static readonly MessagePack.Formatters.NonGenericInterfaceEnumerableFormatter.Instance -> MessagePack.Formatters.IMessagePackFormatter +static readonly MessagePack.Formatters.TypeFormatter.Instance -> MessagePack.Formatters.IMessagePackFormatter +static readonly MessagePack.ImmutableCollection.ImmutableCollectionResolver.Instance -> MessagePack.ImmutableCollection.ImmutableCollectionResolver +static readonly MessagePack.Resolvers.ExpandoObjectResolver.Instance -> MessagePack.IFormatterResolver +static readonly MessagePack.Resolvers.ExpandoObjectResolver.Options -> MessagePack.MessagePackSerializerOptions +virtual MessagePack.Formatters.PrimitiveObjectFormatter.DeserializeMap(ref MessagePack.MessagePackReader reader, int length, MessagePack.MessagePackSerializerOptions options) -> object +MessagePack.ExtensionHeader.ExtensionHeader() -> void +MessagePack.ExtensionResult.ExtensionResult() -> void +MessagePack.FormatterNotRegisteredException.FormatterNotRegisteredException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) -> void +MessagePack.Formatters.HalfFormatter +MessagePack.Formatters.HalfFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> System.Half +MessagePack.Formatters.HalfFormatter.Serialize(ref MessagePack.MessagePackWriter writer, System.Half value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.InterfaceReadOnlySetFormatter +MessagePack.Formatters.InterfaceReadOnlySetFormatter.InterfaceReadOnlySetFormatter() -> void +MessagePack.MessagePackReader.MessagePackReader() -> void +MessagePack.MessagePackSerializerOptions.SequencePool.get -> MessagePack.SequencePool +MessagePack.MessagePackSerializerOptions.WithPool(MessagePack.SequencePool pool) -> MessagePack.MessagePackSerializerOptions +MessagePack.MessagePackStreamReader.MessagePackStreamReader(System.IO.Stream stream, bool leaveOpen, MessagePack.SequencePool sequencePool) -> void +MessagePack.MessagePackStreamReader.ReadArrayHeaderAsync(System.Threading.CancellationToken cancellationToken) -> System.Threading.Tasks.ValueTask +MessagePack.MessagePackStreamReader.ReadMapHeaderAsync(System.Threading.CancellationToken cancellationToken) -> System.Threading.Tasks.ValueTask +MessagePack.MessagePackWriter.MessagePackWriter() -> void +MessagePack.SequencePool +MessagePack.SequencePool.SequencePool() -> void +MessagePack.SequencePool.SequencePool(int maxSize) -> void +MessagePack.SequencePool.SequencePool(int maxSize, System.Buffers.ArrayPool arrayPool) -> void +MessagePack.TinyJsonException.TinyJsonException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) -> void +static MessagePack.Nil.operator !=(MessagePack.Nil left, MessagePack.Nil right) -> bool +static MessagePack.Nil.operator ==(MessagePack.Nil left, MessagePack.Nil right) -> bool +static readonly MessagePack.Formatters.HalfFormatter.Instance -> MessagePack.Formatters.IMessagePackFormatter +virtual MessagePack.MessagePackStreamReader.Dispose(bool disposing) -> void +MessagePack.Formatters.GenericEnumerableFormatter +MessagePack.Formatters.GenericEnumerableFormatter.GenericEnumerableFormatter() -> void +MessagePack.Formatters.GenericReadOnlyDictionaryFormatter +MessagePack.Formatters.GenericReadOnlyDictionaryFormatter.GenericReadOnlyDictionaryFormatter() -> void diff --git a/src/MessagePack/net6.0/PublicAPI.Unshipped.txt b/src/MessagePack/net6.0/PublicAPI.Unshipped.txt new file mode 100644 index 000000000..89697310e --- /dev/null +++ b/src/MessagePack/net6.0/PublicAPI.Unshipped.txt @@ -0,0 +1,16 @@ +MessagePack.Formatters.DateOnlyFormatter +MessagePack.Formatters.DateOnlyFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> System.DateOnly +MessagePack.Formatters.DateOnlyFormatter.Serialize(ref MessagePack.MessagePackWriter writer, System.DateOnly value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.StringInterningFormatter +MessagePack.Formatters.StringInterningFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> string +MessagePack.Formatters.StringInterningFormatter.Serialize(ref MessagePack.MessagePackWriter writer, string value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.StringInterningFormatter.StringInterningFormatter() -> void +MessagePack.Formatters.TimeOnlyFormatter +MessagePack.Formatters.TimeOnlyFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> System.TimeOnly +MessagePack.Formatters.TimeOnlyFormatter.Serialize(ref MessagePack.MessagePackWriter writer, System.TimeOnly value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.MessagePackSerializerOptions.CompressionMinLength.get -> int +MessagePack.MessagePackSerializerOptions.SuggestedContiguousMemorySize.get -> int +MessagePack.MessagePackSerializerOptions.WithCompressionMinLength(int compressionMinLength) -> MessagePack.MessagePackSerializerOptions +MessagePack.MessagePackSerializerOptions.WithSuggestedContiguousMemorySize(int suggestedContiguousMemorySize) -> MessagePack.MessagePackSerializerOptions +static readonly MessagePack.Formatters.DateOnlyFormatter.Instance -> MessagePack.Formatters.DateOnlyFormatter +static readonly MessagePack.Formatters.TimeOnlyFormatter.Instance -> MessagePack.Formatters.TimeOnlyFormatter diff --git a/src/MessagePack/PublicAPI.Shipped.txt b/src/MessagePack/netcoreapp3.1/PublicAPI.Shipped.txt similarity index 84% rename from src/MessagePack/PublicAPI.Shipped.txt rename to src/MessagePack/netcoreapp3.1/PublicAPI.Shipped.txt index 055787782..51002a49f 100644 --- a/src/MessagePack/PublicAPI.Shipped.txt +++ b/src/MessagePack/netcoreapp3.1/PublicAPI.Shipped.txt @@ -1,4 +1,4 @@ -MessagePack.ExtensionHeader +MessagePack.ExtensionHeader MessagePack.ExtensionHeader.ExtensionHeader(sbyte typeCode, int length) -> void MessagePack.ExtensionHeader.ExtensionHeader(sbyte typeCode, uint length) -> void MessagePack.ExtensionHeader.Length.get -> uint @@ -1023,3 +1023,152 @@ static readonly MessagePack.MessagePackSecurity.UntrustedData -> MessagePack.Mes virtual MessagePack.MessagePackSecurity.Clone() -> MessagePack.MessagePackSecurity virtual MessagePack.MessagePackSecurity.GetHashCollisionResistantEqualityComparer() -> System.Collections.IEqualityComparer virtual MessagePack.MessagePackSecurity.GetHashCollisionResistantEqualityComparer() -> System.Collections.Generic.IEqualityComparer +MessagePack.Formatters.ByteMemoryFormatter +MessagePack.Formatters.ByteMemoryFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> System.Memory +MessagePack.Formatters.ByteMemoryFormatter.Serialize(ref MessagePack.MessagePackWriter writer, System.Memory value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.ByteReadOnlyMemoryFormatter +MessagePack.Formatters.ByteReadOnlyMemoryFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> System.ReadOnlyMemory +MessagePack.Formatters.ByteReadOnlyMemoryFormatter.Serialize(ref MessagePack.MessagePackWriter writer, System.ReadOnlyMemory value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.ByteReadOnlySequenceFormatter +MessagePack.Formatters.ByteReadOnlySequenceFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> System.Buffers.ReadOnlySequence +MessagePack.Formatters.ByteReadOnlySequenceFormatter.Serialize(ref MessagePack.MessagePackWriter writer, System.Buffers.ReadOnlySequence value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.ExpandoObjectFormatter +MessagePack.Formatters.ExpandoObjectFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> System.Dynamic.ExpandoObject +MessagePack.Formatters.ExpandoObjectFormatter.Serialize(ref MessagePack.MessagePackWriter writer, System.Dynamic.ExpandoObject value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.ForceTypelessFormatter +MessagePack.Formatters.ForceTypelessFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> T +MessagePack.Formatters.ForceTypelessFormatter.ForceTypelessFormatter() -> void +MessagePack.Formatters.ForceTypelessFormatter.Serialize(ref MessagePack.MessagePackWriter writer, T value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.MemoryFormatter +MessagePack.Formatters.MemoryFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> System.Memory +MessagePack.Formatters.MemoryFormatter.MemoryFormatter() -> void +MessagePack.Formatters.MemoryFormatter.Serialize(ref MessagePack.MessagePackWriter writer, System.Memory value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.NonGenericInterfaceCollectionFormatter +MessagePack.Formatters.NonGenericInterfaceCollectionFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> System.Collections.ICollection +MessagePack.Formatters.NonGenericInterfaceCollectionFormatter.Serialize(ref MessagePack.MessagePackWriter writer, System.Collections.ICollection value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.NonGenericInterfaceEnumerableFormatter +MessagePack.Formatters.NonGenericInterfaceEnumerableFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> System.Collections.IEnumerable +MessagePack.Formatters.NonGenericInterfaceEnumerableFormatter.Serialize(ref MessagePack.MessagePackWriter writer, System.Collections.IEnumerable value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.PrimitiveObjectFormatter.PrimitiveObjectFormatter() -> void +MessagePack.Formatters.ReadOnlyMemoryFormatter +MessagePack.Formatters.ReadOnlyMemoryFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> System.ReadOnlyMemory +MessagePack.Formatters.ReadOnlyMemoryFormatter.ReadOnlyMemoryFormatter() -> void +MessagePack.Formatters.ReadOnlyMemoryFormatter.Serialize(ref MessagePack.MessagePackWriter writer, System.ReadOnlyMemory value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.ReadOnlySequenceFormatter +MessagePack.Formatters.ReadOnlySequenceFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> System.Buffers.ReadOnlySequence +MessagePack.Formatters.ReadOnlySequenceFormatter.ReadOnlySequenceFormatter() -> void +MessagePack.Formatters.ReadOnlySequenceFormatter.Serialize(ref MessagePack.MessagePackWriter writer, System.Buffers.ReadOnlySequence value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.TypeFormatter +MessagePack.Formatters.TypeFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> T +MessagePack.Formatters.TypeFormatter.Serialize(ref MessagePack.MessagePackWriter writer, T value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.TypelessFormatter.TypelessFormatter() -> void +MessagePack.ImmutableCollection.ImmutableArrayFormatter +MessagePack.ImmutableCollection.ImmutableArrayFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> System.Collections.Immutable.ImmutableArray +MessagePack.ImmutableCollection.ImmutableArrayFormatter.ImmutableArrayFormatter() -> void +MessagePack.ImmutableCollection.ImmutableArrayFormatter.Serialize(ref MessagePack.MessagePackWriter writer, System.Collections.Immutable.ImmutableArray value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.ImmutableCollection.ImmutableCollectionResolver +MessagePack.ImmutableCollection.ImmutableCollectionResolver.GetFormatter() -> MessagePack.Formatters.IMessagePackFormatter +MessagePack.ImmutableCollection.ImmutableDictionaryFormatter +MessagePack.ImmutableCollection.ImmutableDictionaryFormatter.ImmutableDictionaryFormatter() -> void +MessagePack.ImmutableCollection.ImmutableHashSetFormatter +MessagePack.ImmutableCollection.ImmutableHashSetFormatter.ImmutableHashSetFormatter() -> void +MessagePack.ImmutableCollection.ImmutableListFormatter +MessagePack.ImmutableCollection.ImmutableListFormatter.ImmutableListFormatter() -> void +MessagePack.ImmutableCollection.ImmutableQueueBuilder +MessagePack.ImmutableCollection.ImmutableQueueBuilder.Add(T value) -> void +MessagePack.ImmutableCollection.ImmutableQueueBuilder.ImmutableQueueBuilder() -> void +MessagePack.ImmutableCollection.ImmutableQueueBuilder.Q.get -> System.Collections.Immutable.ImmutableQueue +MessagePack.ImmutableCollection.ImmutableQueueBuilder.Q.set -> void +MessagePack.ImmutableCollection.ImmutableQueueFormatter +MessagePack.ImmutableCollection.ImmutableQueueFormatter.ImmutableQueueFormatter() -> void +MessagePack.ImmutableCollection.ImmutableSortedDictionaryFormatter +MessagePack.ImmutableCollection.ImmutableSortedDictionaryFormatter.ImmutableSortedDictionaryFormatter() -> void +MessagePack.ImmutableCollection.ImmutableSortedSetFormatter +MessagePack.ImmutableCollection.ImmutableSortedSetFormatter.ImmutableSortedSetFormatter() -> void +MessagePack.ImmutableCollection.ImmutableStackFormatter +MessagePack.ImmutableCollection.ImmutableStackFormatter.ImmutableStackFormatter() -> void +MessagePack.ImmutableCollection.InterfaceImmutableDictionaryFormatter +MessagePack.ImmutableCollection.InterfaceImmutableDictionaryFormatter.InterfaceImmutableDictionaryFormatter() -> void +MessagePack.ImmutableCollection.InterfaceImmutableListFormatter +MessagePack.ImmutableCollection.InterfaceImmutableListFormatter.InterfaceImmutableListFormatter() -> void +MessagePack.ImmutableCollection.InterfaceImmutableQueueFormatter +MessagePack.ImmutableCollection.InterfaceImmutableQueueFormatter.InterfaceImmutableQueueFormatter() -> void +MessagePack.ImmutableCollection.InterfaceImmutableSetFormatter +MessagePack.ImmutableCollection.InterfaceImmutableSetFormatter.InterfaceImmutableSetFormatter() -> void +MessagePack.ImmutableCollection.InterfaceImmutableStackFormatter +MessagePack.ImmutableCollection.InterfaceImmutableStackFormatter.InterfaceImmutableStackFormatter() -> void +MessagePack.Resolvers.ExpandoObjectResolver +override MessagePack.ImmutableCollection.ImmutableDictionaryFormatter.Add(System.Collections.Immutable.ImmutableDictionary.Builder collection, int index, TKey key, TValue value, MessagePack.MessagePackSerializerOptions options) -> void +override MessagePack.ImmutableCollection.ImmutableDictionaryFormatter.Complete(System.Collections.Immutable.ImmutableDictionary.Builder intermediateCollection) -> System.Collections.Immutable.ImmutableDictionary +override MessagePack.ImmutableCollection.ImmutableDictionaryFormatter.Create(int count, MessagePack.MessagePackSerializerOptions options) -> System.Collections.Immutable.ImmutableDictionary.Builder +override MessagePack.ImmutableCollection.ImmutableDictionaryFormatter.GetSourceEnumerator(System.Collections.Immutable.ImmutableDictionary source) -> System.Collections.Immutable.ImmutableDictionary.Enumerator +override MessagePack.ImmutableCollection.ImmutableHashSetFormatter.Add(System.Collections.Immutable.ImmutableHashSet.Builder collection, int index, T value, MessagePack.MessagePackSerializerOptions options) -> void +override MessagePack.ImmutableCollection.ImmutableHashSetFormatter.Complete(System.Collections.Immutable.ImmutableHashSet.Builder intermediateCollection) -> System.Collections.Immutable.ImmutableHashSet +override MessagePack.ImmutableCollection.ImmutableHashSetFormatter.Create(int count, MessagePack.MessagePackSerializerOptions options) -> System.Collections.Immutable.ImmutableHashSet.Builder +override MessagePack.ImmutableCollection.ImmutableHashSetFormatter.GetSourceEnumerator(System.Collections.Immutable.ImmutableHashSet source) -> System.Collections.Immutable.ImmutableHashSet.Enumerator +override MessagePack.ImmutableCollection.ImmutableListFormatter.Add(System.Collections.Immutable.ImmutableList.Builder collection, int index, T value, MessagePack.MessagePackSerializerOptions options) -> void +override MessagePack.ImmutableCollection.ImmutableListFormatter.Complete(System.Collections.Immutable.ImmutableList.Builder intermediateCollection) -> System.Collections.Immutable.ImmutableList +override MessagePack.ImmutableCollection.ImmutableListFormatter.Create(int count, MessagePack.MessagePackSerializerOptions options) -> System.Collections.Immutable.ImmutableList.Builder +override MessagePack.ImmutableCollection.ImmutableListFormatter.GetSourceEnumerator(System.Collections.Immutable.ImmutableList source) -> System.Collections.Immutable.ImmutableList.Enumerator +override MessagePack.ImmutableCollection.ImmutableQueueFormatter.Add(MessagePack.ImmutableCollection.ImmutableQueueBuilder collection, int index, T value, MessagePack.MessagePackSerializerOptions options) -> void +override MessagePack.ImmutableCollection.ImmutableQueueFormatter.Complete(MessagePack.ImmutableCollection.ImmutableQueueBuilder intermediateCollection) -> System.Collections.Immutable.ImmutableQueue +override MessagePack.ImmutableCollection.ImmutableQueueFormatter.Create(int count, MessagePack.MessagePackSerializerOptions options) -> MessagePack.ImmutableCollection.ImmutableQueueBuilder +override MessagePack.ImmutableCollection.ImmutableSortedDictionaryFormatter.Add(System.Collections.Immutable.ImmutableSortedDictionary.Builder collection, int index, TKey key, TValue value, MessagePack.MessagePackSerializerOptions options) -> void +override MessagePack.ImmutableCollection.ImmutableSortedDictionaryFormatter.Complete(System.Collections.Immutable.ImmutableSortedDictionary.Builder intermediateCollection) -> System.Collections.Immutable.ImmutableSortedDictionary +override MessagePack.ImmutableCollection.ImmutableSortedDictionaryFormatter.Create(int count, MessagePack.MessagePackSerializerOptions options) -> System.Collections.Immutable.ImmutableSortedDictionary.Builder +override MessagePack.ImmutableCollection.ImmutableSortedDictionaryFormatter.GetSourceEnumerator(System.Collections.Immutable.ImmutableSortedDictionary source) -> System.Collections.Immutable.ImmutableSortedDictionary.Enumerator +override MessagePack.ImmutableCollection.ImmutableSortedSetFormatter.Add(System.Collections.Immutable.ImmutableSortedSet.Builder collection, int index, T value, MessagePack.MessagePackSerializerOptions options) -> void +override MessagePack.ImmutableCollection.ImmutableSortedSetFormatter.Complete(System.Collections.Immutable.ImmutableSortedSet.Builder intermediateCollection) -> System.Collections.Immutable.ImmutableSortedSet +override MessagePack.ImmutableCollection.ImmutableSortedSetFormatter.Create(int count, MessagePack.MessagePackSerializerOptions options) -> System.Collections.Immutable.ImmutableSortedSet.Builder +override MessagePack.ImmutableCollection.ImmutableSortedSetFormatter.GetSourceEnumerator(System.Collections.Immutable.ImmutableSortedSet source) -> System.Collections.Immutable.ImmutableSortedSet.Enumerator +override MessagePack.ImmutableCollection.ImmutableStackFormatter.Add(T[] collection, int index, T value, MessagePack.MessagePackSerializerOptions options) -> void +override MessagePack.ImmutableCollection.ImmutableStackFormatter.Complete(T[] intermediateCollection) -> System.Collections.Immutable.ImmutableStack +override MessagePack.ImmutableCollection.ImmutableStackFormatter.Create(int count, MessagePack.MessagePackSerializerOptions options) -> T[] +override MessagePack.ImmutableCollection.InterfaceImmutableDictionaryFormatter.Add(System.Collections.Immutable.ImmutableDictionary.Builder collection, int index, TKey key, TValue value, MessagePack.MessagePackSerializerOptions options) -> void +override MessagePack.ImmutableCollection.InterfaceImmutableDictionaryFormatter.Complete(System.Collections.Immutable.ImmutableDictionary.Builder intermediateCollection) -> System.Collections.Immutable.IImmutableDictionary +override MessagePack.ImmutableCollection.InterfaceImmutableDictionaryFormatter.Create(int count, MessagePack.MessagePackSerializerOptions options) -> System.Collections.Immutable.ImmutableDictionary.Builder +override MessagePack.ImmutableCollection.InterfaceImmutableListFormatter.Add(System.Collections.Immutable.ImmutableList.Builder collection, int index, T value, MessagePack.MessagePackSerializerOptions options) -> void +override MessagePack.ImmutableCollection.InterfaceImmutableListFormatter.Complete(System.Collections.Immutable.ImmutableList.Builder intermediateCollection) -> System.Collections.Immutable.IImmutableList +override MessagePack.ImmutableCollection.InterfaceImmutableListFormatter.Create(int count, MessagePack.MessagePackSerializerOptions options) -> System.Collections.Immutable.ImmutableList.Builder +override MessagePack.ImmutableCollection.InterfaceImmutableQueueFormatter.Add(MessagePack.ImmutableCollection.ImmutableQueueBuilder collection, int index, T value, MessagePack.MessagePackSerializerOptions options) -> void +override MessagePack.ImmutableCollection.InterfaceImmutableQueueFormatter.Complete(MessagePack.ImmutableCollection.ImmutableQueueBuilder intermediateCollection) -> System.Collections.Immutable.IImmutableQueue +override MessagePack.ImmutableCollection.InterfaceImmutableQueueFormatter.Create(int count, MessagePack.MessagePackSerializerOptions options) -> MessagePack.ImmutableCollection.ImmutableQueueBuilder +override MessagePack.ImmutableCollection.InterfaceImmutableSetFormatter.Add(System.Collections.Immutable.ImmutableHashSet.Builder collection, int index, T value, MessagePack.MessagePackSerializerOptions options) -> void +override MessagePack.ImmutableCollection.InterfaceImmutableSetFormatter.Complete(System.Collections.Immutable.ImmutableHashSet.Builder intermediateCollection) -> System.Collections.Immutable.IImmutableSet +override MessagePack.ImmutableCollection.InterfaceImmutableSetFormatter.Create(int count, MessagePack.MessagePackSerializerOptions options) -> System.Collections.Immutable.ImmutableHashSet.Builder +override MessagePack.ImmutableCollection.InterfaceImmutableStackFormatter.Add(T[] collection, int index, T value, MessagePack.MessagePackSerializerOptions options) -> void +override MessagePack.ImmutableCollection.InterfaceImmutableStackFormatter.Complete(T[] intermediateCollection) -> System.Collections.Immutable.IImmutableStack +override MessagePack.ImmutableCollection.InterfaceImmutableStackFormatter.Create(int count, MessagePack.MessagePackSerializerOptions options) -> T[] +static readonly MessagePack.Formatters.ByteMemoryFormatter.Instance -> MessagePack.Formatters.ByteMemoryFormatter +static readonly MessagePack.Formatters.ByteReadOnlyMemoryFormatter.Instance -> MessagePack.Formatters.ByteReadOnlyMemoryFormatter +static readonly MessagePack.Formatters.ByteReadOnlySequenceFormatter.Instance -> MessagePack.Formatters.ByteReadOnlySequenceFormatter +static readonly MessagePack.Formatters.ExpandoObjectFormatter.Instance -> MessagePack.Formatters.IMessagePackFormatter +static readonly MessagePack.Formatters.NonGenericInterfaceCollectionFormatter.Instance -> MessagePack.Formatters.IMessagePackFormatter +static readonly MessagePack.Formatters.NonGenericInterfaceEnumerableFormatter.Instance -> MessagePack.Formatters.IMessagePackFormatter +static readonly MessagePack.Formatters.TypeFormatter.Instance -> MessagePack.Formatters.IMessagePackFormatter +static readonly MessagePack.ImmutableCollection.ImmutableCollectionResolver.Instance -> MessagePack.ImmutableCollection.ImmutableCollectionResolver +static readonly MessagePack.Resolvers.ExpandoObjectResolver.Instance -> MessagePack.IFormatterResolver +static readonly MessagePack.Resolvers.ExpandoObjectResolver.Options -> MessagePack.MessagePackSerializerOptions +virtual MessagePack.Formatters.PrimitiveObjectFormatter.DeserializeMap(ref MessagePack.MessagePackReader reader, int length, MessagePack.MessagePackSerializerOptions options) -> object +MessagePack.ExtensionHeader.ExtensionHeader() -> void +MessagePack.ExtensionResult.ExtensionResult() -> void +MessagePack.FormatterNotRegisteredException.FormatterNotRegisteredException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) -> void +MessagePack.MessagePackReader.MessagePackReader() -> void +MessagePack.MessagePackSerializerOptions.SequencePool.get -> MessagePack.SequencePool +MessagePack.MessagePackSerializerOptions.WithPool(MessagePack.SequencePool pool) -> MessagePack.MessagePackSerializerOptions +MessagePack.MessagePackStreamReader.MessagePackStreamReader(System.IO.Stream stream, bool leaveOpen, MessagePack.SequencePool sequencePool) -> void +MessagePack.MessagePackStreamReader.ReadArrayHeaderAsync(System.Threading.CancellationToken cancellationToken) -> System.Threading.Tasks.ValueTask +MessagePack.MessagePackStreamReader.ReadMapHeaderAsync(System.Threading.CancellationToken cancellationToken) -> System.Threading.Tasks.ValueTask +MessagePack.MessagePackWriter.MessagePackWriter() -> void +MessagePack.SequencePool +MessagePack.SequencePool.SequencePool() -> void +MessagePack.SequencePool.SequencePool(int maxSize) -> void +MessagePack.SequencePool.SequencePool(int maxSize, System.Buffers.ArrayPool arrayPool) -> void +MessagePack.TinyJsonException.TinyJsonException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) -> void +static MessagePack.Nil.operator !=(MessagePack.Nil left, MessagePack.Nil right) -> bool +static MessagePack.Nil.operator ==(MessagePack.Nil left, MessagePack.Nil right) -> bool +virtual MessagePack.MessagePackStreamReader.Dispose(bool disposing) -> void +MessagePack.Formatters.GenericEnumerableFormatter +MessagePack.Formatters.GenericEnumerableFormatter.GenericEnumerableFormatter() -> void +MessagePack.Formatters.GenericReadOnlyDictionaryFormatter +MessagePack.Formatters.GenericReadOnlyDictionaryFormatter.GenericReadOnlyDictionaryFormatter() -> void diff --git a/src/MessagePack/netcoreapp3.1/PublicAPI.Unshipped.txt b/src/MessagePack/netcoreapp3.1/PublicAPI.Unshipped.txt new file mode 100644 index 000000000..ba449cacb --- /dev/null +++ b/src/MessagePack/netcoreapp3.1/PublicAPI.Unshipped.txt @@ -0,0 +1,8 @@ +MessagePack.Formatters.StringInterningFormatter +MessagePack.Formatters.StringInterningFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> string +MessagePack.Formatters.StringInterningFormatter.Serialize(ref MessagePack.MessagePackWriter writer, string value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.StringInterningFormatter.StringInterningFormatter() -> void +MessagePack.MessagePackSerializerOptions.CompressionMinLength.get -> int +MessagePack.MessagePackSerializerOptions.SuggestedContiguousMemorySize.get -> int +MessagePack.MessagePackSerializerOptions.WithCompressionMinLength(int compressionMinLength) -> MessagePack.MessagePackSerializerOptions +MessagePack.MessagePackSerializerOptions.WithSuggestedContiguousMemorySize(int suggestedContiguousMemorySize) -> MessagePack.MessagePackSerializerOptions diff --git a/src/MessagePack/netstandard2.0/PublicAPI.Shipped.txt b/src/MessagePack/netstandard2.0/PublicAPI.Shipped.txt new file mode 100644 index 000000000..51002a49f --- /dev/null +++ b/src/MessagePack/netstandard2.0/PublicAPI.Shipped.txt @@ -0,0 +1,1174 @@ +MessagePack.ExtensionHeader +MessagePack.ExtensionHeader.ExtensionHeader(sbyte typeCode, int length) -> void +MessagePack.ExtensionHeader.ExtensionHeader(sbyte typeCode, uint length) -> void +MessagePack.ExtensionHeader.Length.get -> uint +MessagePack.ExtensionHeader.TypeCode.get -> sbyte +MessagePack.ExtensionResult +MessagePack.ExtensionResult.Data.get -> System.Buffers.ReadOnlySequence +MessagePack.ExtensionResult.ExtensionResult(sbyte typeCode, System.Buffers.ReadOnlySequence data) -> void +MessagePack.ExtensionResult.ExtensionResult(sbyte typeCode, System.Memory data) -> void +MessagePack.ExtensionResult.Header.get -> MessagePack.ExtensionHeader +MessagePack.ExtensionResult.TypeCode.get -> sbyte +MessagePack.FormatterNotRegisteredException +MessagePack.FormatterNotRegisteredException.FormatterNotRegisteredException(string message) -> void +MessagePack.FormatterResolverExtensions +MessagePack.Formatters.ArrayFormatter +MessagePack.Formatters.ArrayFormatter.ArrayFormatter() -> void +MessagePack.Formatters.ArrayFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> T[] +MessagePack.Formatters.ArrayFormatter.Serialize(ref MessagePack.MessagePackWriter writer, T[] value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.ArraySegmentFormatter +MessagePack.Formatters.ArraySegmentFormatter.ArraySegmentFormatter() -> void +MessagePack.Formatters.ArraySegmentFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> System.ArraySegment +MessagePack.Formatters.ArraySegmentFormatter.Serialize(ref MessagePack.MessagePackWriter writer, System.ArraySegment value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.BigIntegerFormatter +MessagePack.Formatters.BigIntegerFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> System.Numerics.BigInteger +MessagePack.Formatters.BigIntegerFormatter.Serialize(ref MessagePack.MessagePackWriter writer, System.Numerics.BigInteger value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.BitArrayFormatter +MessagePack.Formatters.BitArrayFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> System.Collections.BitArray +MessagePack.Formatters.BitArrayFormatter.Serialize(ref MessagePack.MessagePackWriter writer, System.Collections.BitArray value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.BooleanArrayFormatter +MessagePack.Formatters.BooleanArrayFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> bool[] +MessagePack.Formatters.BooleanArrayFormatter.Serialize(ref MessagePack.MessagePackWriter writer, bool[] value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.BooleanFormatter +MessagePack.Formatters.BooleanFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> bool +MessagePack.Formatters.BooleanFormatter.Serialize(ref MessagePack.MessagePackWriter writer, bool value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.ByteArrayFormatter +MessagePack.Formatters.ByteArrayFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> byte[] +MessagePack.Formatters.ByteArrayFormatter.Serialize(ref MessagePack.MessagePackWriter writer, byte[] value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.ByteArraySegmentFormatter +MessagePack.Formatters.ByteArraySegmentFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> System.ArraySegment +MessagePack.Formatters.ByteArraySegmentFormatter.Serialize(ref MessagePack.MessagePackWriter writer, System.ArraySegment value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.ByteFormatter +MessagePack.Formatters.ByteFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> byte +MessagePack.Formatters.ByteFormatter.Serialize(ref MessagePack.MessagePackWriter writer, byte value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.CharArrayFormatter +MessagePack.Formatters.CharArrayFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> char[] +MessagePack.Formatters.CharArrayFormatter.Serialize(ref MessagePack.MessagePackWriter writer, char[] value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.CharFormatter +MessagePack.Formatters.CharFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> char +MessagePack.Formatters.CharFormatter.Serialize(ref MessagePack.MessagePackWriter writer, char value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.CollectionFormatterBase +MessagePack.Formatters.CollectionFormatterBase.CollectionFormatterBase() -> void +MessagePack.Formatters.CollectionFormatterBase +MessagePack.Formatters.CollectionFormatterBase.CollectionFormatterBase() -> void +MessagePack.Formatters.CollectionFormatterBase +MessagePack.Formatters.CollectionFormatterBase.CollectionFormatterBase() -> void +MessagePack.Formatters.CollectionFormatterBase.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> TCollection +MessagePack.Formatters.CollectionFormatterBase.Serialize(ref MessagePack.MessagePackWriter writer, TCollection value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.ComplexFormatter +MessagePack.Formatters.ComplexFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> System.Numerics.Complex +MessagePack.Formatters.ComplexFormatter.Serialize(ref MessagePack.MessagePackWriter writer, System.Numerics.Complex value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.ConcurrentBagFormatter +MessagePack.Formatters.ConcurrentBagFormatter.ConcurrentBagFormatter() -> void +MessagePack.Formatters.ConcurrentDictionaryFormatter +MessagePack.Formatters.ConcurrentDictionaryFormatter.ConcurrentDictionaryFormatter() -> void +MessagePack.Formatters.ConcurrentQueueFormatter +MessagePack.Formatters.ConcurrentQueueFormatter.ConcurrentQueueFormatter() -> void +MessagePack.Formatters.ConcurrentStackFormatter +MessagePack.Formatters.ConcurrentStackFormatter.ConcurrentStackFormatter() -> void +MessagePack.Formatters.DateTimeArrayFormatter +MessagePack.Formatters.DateTimeArrayFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> System.DateTime[] +MessagePack.Formatters.DateTimeArrayFormatter.Serialize(ref MessagePack.MessagePackWriter writer, System.DateTime[] value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.DateTimeFormatter +MessagePack.Formatters.DateTimeFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> System.DateTime +MessagePack.Formatters.DateTimeFormatter.Serialize(ref MessagePack.MessagePackWriter writer, System.DateTime value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.DateTimeOffsetFormatter +MessagePack.Formatters.DateTimeOffsetFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> System.DateTimeOffset +MessagePack.Formatters.DateTimeOffsetFormatter.Serialize(ref MessagePack.MessagePackWriter writer, System.DateTimeOffset value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.DecimalFormatter +MessagePack.Formatters.DecimalFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> decimal +MessagePack.Formatters.DecimalFormatter.Serialize(ref MessagePack.MessagePackWriter writer, decimal value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.DictionaryFormatter +MessagePack.Formatters.DictionaryFormatter.DictionaryFormatter() -> void +MessagePack.Formatters.DictionaryFormatterBase +MessagePack.Formatters.DictionaryFormatterBase.DictionaryFormatterBase() -> void +MessagePack.Formatters.DictionaryFormatterBase +MessagePack.Formatters.DictionaryFormatterBase.DictionaryFormatterBase() -> void +MessagePack.Formatters.DictionaryFormatterBase +MessagePack.Formatters.DictionaryFormatterBase.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> TDictionary +MessagePack.Formatters.DictionaryFormatterBase.DictionaryFormatterBase() -> void +MessagePack.Formatters.DictionaryFormatterBase.Serialize(ref MessagePack.MessagePackWriter writer, TDictionary value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.DoubleArrayFormatter +MessagePack.Formatters.DoubleArrayFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> double[] +MessagePack.Formatters.DoubleArrayFormatter.Serialize(ref MessagePack.MessagePackWriter writer, double[] value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.DoubleFormatter +MessagePack.Formatters.DoubleFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> double +MessagePack.Formatters.DoubleFormatter.Serialize(ref MessagePack.MessagePackWriter writer, double value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.DynamicObjectTypeFallbackFormatter +MessagePack.Formatters.DynamicObjectTypeFallbackFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> object +MessagePack.Formatters.DynamicObjectTypeFallbackFormatter.Serialize(ref MessagePack.MessagePackWriter writer, object value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.EnumAsStringFormatter +MessagePack.Formatters.EnumAsStringFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> T +MessagePack.Formatters.EnumAsStringFormatter.EnumAsStringFormatter() -> void +MessagePack.Formatters.EnumAsStringFormatter.Serialize(ref MessagePack.MessagePackWriter writer, T value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.ForceByteBlockFormatter +MessagePack.Formatters.ForceByteBlockFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> byte +MessagePack.Formatters.ForceByteBlockFormatter.Serialize(ref MessagePack.MessagePackWriter writer, byte value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.ForceInt16BlockArrayFormatter +MessagePack.Formatters.ForceInt16BlockArrayFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> short[] +MessagePack.Formatters.ForceInt16BlockArrayFormatter.Serialize(ref MessagePack.MessagePackWriter writer, short[] value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.ForceInt16BlockFormatter +MessagePack.Formatters.ForceInt16BlockFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> short +MessagePack.Formatters.ForceInt16BlockFormatter.Serialize(ref MessagePack.MessagePackWriter writer, short value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.ForceInt32BlockArrayFormatter +MessagePack.Formatters.ForceInt32BlockArrayFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> int[] +MessagePack.Formatters.ForceInt32BlockArrayFormatter.Serialize(ref MessagePack.MessagePackWriter writer, int[] value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.ForceInt32BlockFormatter +MessagePack.Formatters.ForceInt32BlockFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> int +MessagePack.Formatters.ForceInt32BlockFormatter.Serialize(ref MessagePack.MessagePackWriter writer, int value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.ForceInt64BlockArrayFormatter +MessagePack.Formatters.ForceInt64BlockArrayFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> long[] +MessagePack.Formatters.ForceInt64BlockArrayFormatter.Serialize(ref MessagePack.MessagePackWriter writer, long[] value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.ForceInt64BlockFormatter +MessagePack.Formatters.ForceInt64BlockFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> long +MessagePack.Formatters.ForceInt64BlockFormatter.Serialize(ref MessagePack.MessagePackWriter writer, long value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.ForceSByteBlockArrayFormatter +MessagePack.Formatters.ForceSByteBlockArrayFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> sbyte[] +MessagePack.Formatters.ForceSByteBlockArrayFormatter.Serialize(ref MessagePack.MessagePackWriter writer, sbyte[] value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.ForceSByteBlockFormatter +MessagePack.Formatters.ForceSByteBlockFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> sbyte +MessagePack.Formatters.ForceSByteBlockFormatter.Serialize(ref MessagePack.MessagePackWriter writer, sbyte value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.ForceUInt16BlockArrayFormatter +MessagePack.Formatters.ForceUInt16BlockArrayFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> ushort[] +MessagePack.Formatters.ForceUInt16BlockArrayFormatter.Serialize(ref MessagePack.MessagePackWriter writer, ushort[] value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.ForceUInt16BlockFormatter +MessagePack.Formatters.ForceUInt16BlockFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> ushort +MessagePack.Formatters.ForceUInt16BlockFormatter.Serialize(ref MessagePack.MessagePackWriter writer, ushort value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.ForceUInt32BlockArrayFormatter +MessagePack.Formatters.ForceUInt32BlockArrayFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> uint[] +MessagePack.Formatters.ForceUInt32BlockArrayFormatter.Serialize(ref MessagePack.MessagePackWriter writer, uint[] value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.ForceUInt32BlockFormatter +MessagePack.Formatters.ForceUInt32BlockFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> uint +MessagePack.Formatters.ForceUInt32BlockFormatter.Serialize(ref MessagePack.MessagePackWriter writer, uint value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.ForceUInt64BlockArrayFormatter +MessagePack.Formatters.ForceUInt64BlockArrayFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> ulong[] +MessagePack.Formatters.ForceUInt64BlockArrayFormatter.Serialize(ref MessagePack.MessagePackWriter writer, ulong[] value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.ForceUInt64BlockFormatter +MessagePack.Formatters.ForceUInt64BlockFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> ulong +MessagePack.Formatters.ForceUInt64BlockFormatter.Serialize(ref MessagePack.MessagePackWriter writer, ulong value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.FourDimensionalArrayFormatter +MessagePack.Formatters.FourDimensionalArrayFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> T[,,,] +MessagePack.Formatters.FourDimensionalArrayFormatter.FourDimensionalArrayFormatter() -> void +MessagePack.Formatters.FourDimensionalArrayFormatter.Serialize(ref MessagePack.MessagePackWriter writer, T[,,,] value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.GenericCollectionFormatter +MessagePack.Formatters.GenericCollectionFormatter.GenericCollectionFormatter() -> void +MessagePack.Formatters.GenericDictionaryFormatter +MessagePack.Formatters.GenericDictionaryFormatter.GenericDictionaryFormatter() -> void +MessagePack.Formatters.GenericEnumFormatter +MessagePack.Formatters.GenericEnumFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> T +MessagePack.Formatters.GenericEnumFormatter.GenericEnumFormatter() -> void +MessagePack.Formatters.GenericEnumFormatter.Serialize(ref MessagePack.MessagePackWriter writer, T value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.GuidFormatter +MessagePack.Formatters.GuidFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> System.Guid +MessagePack.Formatters.GuidFormatter.Serialize(ref MessagePack.MessagePackWriter writer, System.Guid value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.HashSetFormatter +MessagePack.Formatters.HashSetFormatter.HashSetFormatter() -> void +MessagePack.Formatters.IMessagePackFormatter +MessagePack.Formatters.IMessagePackFormatter +MessagePack.Formatters.IMessagePackFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> T +MessagePack.Formatters.IMessagePackFormatter.Serialize(ref MessagePack.MessagePackWriter writer, T value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.IgnoreFormatter +MessagePack.Formatters.IgnoreFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> T +MessagePack.Formatters.IgnoreFormatter.IgnoreFormatter() -> void +MessagePack.Formatters.IgnoreFormatter.Serialize(ref MessagePack.MessagePackWriter writer, T value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.Int16ArrayFormatter +MessagePack.Formatters.Int16ArrayFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> short[] +MessagePack.Formatters.Int16ArrayFormatter.Serialize(ref MessagePack.MessagePackWriter writer, short[] value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.Int16Formatter +MessagePack.Formatters.Int16Formatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> short +MessagePack.Formatters.Int16Formatter.Serialize(ref MessagePack.MessagePackWriter writer, short value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.Int32ArrayFormatter +MessagePack.Formatters.Int32ArrayFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> int[] +MessagePack.Formatters.Int32ArrayFormatter.Serialize(ref MessagePack.MessagePackWriter writer, int[] value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.Int32Formatter +MessagePack.Formatters.Int32Formatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> int +MessagePack.Formatters.Int32Formatter.Serialize(ref MessagePack.MessagePackWriter writer, int value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.Int64ArrayFormatter +MessagePack.Formatters.Int64ArrayFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> long[] +MessagePack.Formatters.Int64ArrayFormatter.Serialize(ref MessagePack.MessagePackWriter writer, long[] value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.Int64Formatter +MessagePack.Formatters.Int64Formatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> long +MessagePack.Formatters.Int64Formatter.Serialize(ref MessagePack.MessagePackWriter writer, long value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.InterfaceCollectionFormatter +MessagePack.Formatters.InterfaceCollectionFormatter.InterfaceCollectionFormatter() -> void +MessagePack.Formatters.InterfaceDictionaryFormatter +MessagePack.Formatters.InterfaceDictionaryFormatter.InterfaceDictionaryFormatter() -> void +MessagePack.Formatters.InterfaceEnumerableFormatter +MessagePack.Formatters.InterfaceEnumerableFormatter.InterfaceEnumerableFormatter() -> void +MessagePack.Formatters.InterfaceGroupingFormatter +MessagePack.Formatters.InterfaceGroupingFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> System.Linq.IGrouping +MessagePack.Formatters.InterfaceGroupingFormatter.InterfaceGroupingFormatter() -> void +MessagePack.Formatters.InterfaceGroupingFormatter.Serialize(ref MessagePack.MessagePackWriter writer, System.Linq.IGrouping value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.InterfaceListFormatter +MessagePack.Formatters.InterfaceListFormatter.InterfaceListFormatter() -> void +MessagePack.Formatters.InterfaceLookupFormatter +MessagePack.Formatters.InterfaceLookupFormatter.InterfaceLookupFormatter() -> void +MessagePack.Formatters.InterfaceReadOnlyCollectionFormatter +MessagePack.Formatters.InterfaceReadOnlyCollectionFormatter.InterfaceReadOnlyCollectionFormatter() -> void +MessagePack.Formatters.InterfaceReadOnlyDictionaryFormatter +MessagePack.Formatters.InterfaceReadOnlyDictionaryFormatter.InterfaceReadOnlyDictionaryFormatter() -> void +MessagePack.Formatters.InterfaceReadOnlyListFormatter +MessagePack.Formatters.InterfaceReadOnlyListFormatter.InterfaceReadOnlyListFormatter() -> void +MessagePack.Formatters.InterfaceSetFormatter +MessagePack.Formatters.InterfaceSetFormatter.InterfaceSetFormatter() -> void +MessagePack.Formatters.KeyValuePairFormatter +MessagePack.Formatters.KeyValuePairFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> System.Collections.Generic.KeyValuePair +MessagePack.Formatters.KeyValuePairFormatter.KeyValuePairFormatter() -> void +MessagePack.Formatters.KeyValuePairFormatter.Serialize(ref MessagePack.MessagePackWriter writer, System.Collections.Generic.KeyValuePair value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.LazyFormatter +MessagePack.Formatters.LazyFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> System.Lazy +MessagePack.Formatters.LazyFormatter.LazyFormatter() -> void +MessagePack.Formatters.LazyFormatter.Serialize(ref MessagePack.MessagePackWriter writer, System.Lazy value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.LinkedListFormatter +MessagePack.Formatters.LinkedListFormatter.LinkedListFormatter() -> void +MessagePack.Formatters.ListFormatter +MessagePack.Formatters.ListFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> System.Collections.Generic.List +MessagePack.Formatters.ListFormatter.ListFormatter() -> void +MessagePack.Formatters.ListFormatter.Serialize(ref MessagePack.MessagePackWriter writer, System.Collections.Generic.List value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.NativeDateTimeArrayFormatter +MessagePack.Formatters.NativeDateTimeArrayFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> System.DateTime[] +MessagePack.Formatters.NativeDateTimeArrayFormatter.NativeDateTimeArrayFormatter() -> void +MessagePack.Formatters.NativeDateTimeArrayFormatter.Serialize(ref MessagePack.MessagePackWriter writer, System.DateTime[] value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.NativeDateTimeFormatter +MessagePack.Formatters.NativeDateTimeFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> System.DateTime +MessagePack.Formatters.NativeDateTimeFormatter.NativeDateTimeFormatter() -> void +MessagePack.Formatters.NativeDateTimeFormatter.Serialize(ref MessagePack.MessagePackWriter writer, System.DateTime value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.NativeDecimalFormatter +MessagePack.Formatters.NativeDecimalFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> decimal +MessagePack.Formatters.NativeDecimalFormatter.Serialize(ref MessagePack.MessagePackWriter writer, decimal value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.NativeGuidFormatter +MessagePack.Formatters.NativeGuidFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> System.Guid +MessagePack.Formatters.NativeGuidFormatter.Serialize(ref MessagePack.MessagePackWriter writer, System.Guid value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.NilFormatter +MessagePack.Formatters.NilFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> MessagePack.Nil +MessagePack.Formatters.NilFormatter.Serialize(ref MessagePack.MessagePackWriter writer, MessagePack.Nil value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.NonGenericDictionaryFormatter +MessagePack.Formatters.NonGenericDictionaryFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> T +MessagePack.Formatters.NonGenericDictionaryFormatter.NonGenericDictionaryFormatter() -> void +MessagePack.Formatters.NonGenericDictionaryFormatter.Serialize(ref MessagePack.MessagePackWriter writer, T value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.NonGenericInterfaceDictionaryFormatter +MessagePack.Formatters.NonGenericInterfaceDictionaryFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> System.Collections.IDictionary +MessagePack.Formatters.NonGenericInterfaceDictionaryFormatter.Serialize(ref MessagePack.MessagePackWriter writer, System.Collections.IDictionary value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.NonGenericInterfaceListFormatter +MessagePack.Formatters.NonGenericInterfaceListFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> System.Collections.IList +MessagePack.Formatters.NonGenericInterfaceListFormatter.Serialize(ref MessagePack.MessagePackWriter writer, System.Collections.IList value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.NonGenericListFormatter +MessagePack.Formatters.NonGenericListFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> T +MessagePack.Formatters.NonGenericListFormatter.NonGenericListFormatter() -> void +MessagePack.Formatters.NonGenericListFormatter.Serialize(ref MessagePack.MessagePackWriter writer, T value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.NullableBooleanFormatter +MessagePack.Formatters.NullableBooleanFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> bool? +MessagePack.Formatters.NullableBooleanFormatter.Serialize(ref MessagePack.MessagePackWriter writer, bool? value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.NullableByteFormatter +MessagePack.Formatters.NullableByteFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> byte? +MessagePack.Formatters.NullableByteFormatter.Serialize(ref MessagePack.MessagePackWriter writer, byte? value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.NullableCharFormatter +MessagePack.Formatters.NullableCharFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> char? +MessagePack.Formatters.NullableCharFormatter.Serialize(ref MessagePack.MessagePackWriter writer, char? value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.NullableDateTimeFormatter +MessagePack.Formatters.NullableDateTimeFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> System.DateTime? +MessagePack.Formatters.NullableDateTimeFormatter.Serialize(ref MessagePack.MessagePackWriter writer, System.DateTime? value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.NullableDoubleFormatter +MessagePack.Formatters.NullableDoubleFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> double? +MessagePack.Formatters.NullableDoubleFormatter.Serialize(ref MessagePack.MessagePackWriter writer, double? value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.NullableForceByteBlockFormatter +MessagePack.Formatters.NullableForceByteBlockFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> byte? +MessagePack.Formatters.NullableForceByteBlockFormatter.Serialize(ref MessagePack.MessagePackWriter writer, byte? value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.NullableForceInt16BlockFormatter +MessagePack.Formatters.NullableForceInt16BlockFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> short? +MessagePack.Formatters.NullableForceInt16BlockFormatter.Serialize(ref MessagePack.MessagePackWriter writer, short? value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.NullableForceInt32BlockFormatter +MessagePack.Formatters.NullableForceInt32BlockFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> int? +MessagePack.Formatters.NullableForceInt32BlockFormatter.Serialize(ref MessagePack.MessagePackWriter writer, int? value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.NullableForceInt64BlockFormatter +MessagePack.Formatters.NullableForceInt64BlockFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> long? +MessagePack.Formatters.NullableForceInt64BlockFormatter.Serialize(ref MessagePack.MessagePackWriter writer, long? value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.NullableForceSByteBlockFormatter +MessagePack.Formatters.NullableForceSByteBlockFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> sbyte? +MessagePack.Formatters.NullableForceSByteBlockFormatter.Serialize(ref MessagePack.MessagePackWriter writer, sbyte? value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.NullableForceUInt16BlockFormatter +MessagePack.Formatters.NullableForceUInt16BlockFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> ushort? +MessagePack.Formatters.NullableForceUInt16BlockFormatter.Serialize(ref MessagePack.MessagePackWriter writer, ushort? value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.NullableForceUInt32BlockFormatter +MessagePack.Formatters.NullableForceUInt32BlockFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> uint? +MessagePack.Formatters.NullableForceUInt32BlockFormatter.Serialize(ref MessagePack.MessagePackWriter writer, uint? value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.NullableForceUInt64BlockFormatter +MessagePack.Formatters.NullableForceUInt64BlockFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> ulong? +MessagePack.Formatters.NullableForceUInt64BlockFormatter.Serialize(ref MessagePack.MessagePackWriter writer, ulong? value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.NullableFormatter +MessagePack.Formatters.NullableFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> T? +MessagePack.Formatters.NullableFormatter.NullableFormatter() -> void +MessagePack.Formatters.NullableFormatter.Serialize(ref MessagePack.MessagePackWriter writer, T? value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.NullableInt16Formatter +MessagePack.Formatters.NullableInt16Formatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> short? +MessagePack.Formatters.NullableInt16Formatter.Serialize(ref MessagePack.MessagePackWriter writer, short? value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.NullableInt32Formatter +MessagePack.Formatters.NullableInt32Formatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> int? +MessagePack.Formatters.NullableInt32Formatter.Serialize(ref MessagePack.MessagePackWriter writer, int? value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.NullableInt64Formatter +MessagePack.Formatters.NullableInt64Formatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> long? +MessagePack.Formatters.NullableInt64Formatter.Serialize(ref MessagePack.MessagePackWriter writer, long? value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.NullableNilFormatter +MessagePack.Formatters.NullableNilFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> MessagePack.Nil? +MessagePack.Formatters.NullableNilFormatter.Serialize(ref MessagePack.MessagePackWriter writer, MessagePack.Nil? value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.NullableSByteFormatter +MessagePack.Formatters.NullableSByteFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> sbyte? +MessagePack.Formatters.NullableSByteFormatter.Serialize(ref MessagePack.MessagePackWriter writer, sbyte? value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.NullableSingleFormatter +MessagePack.Formatters.NullableSingleFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> float? +MessagePack.Formatters.NullableSingleFormatter.Serialize(ref MessagePack.MessagePackWriter writer, float? value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.NullableStringArrayFormatter +MessagePack.Formatters.NullableStringArrayFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> string[] +MessagePack.Formatters.NullableStringArrayFormatter.Serialize(ref MessagePack.MessagePackWriter writer, string[] value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.NullableStringFormatter +MessagePack.Formatters.NullableStringFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> string +MessagePack.Formatters.NullableStringFormatter.Serialize(ref MessagePack.MessagePackWriter writer, string value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.NullableUInt16Formatter +MessagePack.Formatters.NullableUInt16Formatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> ushort? +MessagePack.Formatters.NullableUInt16Formatter.Serialize(ref MessagePack.MessagePackWriter writer, ushort? value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.NullableUInt32Formatter +MessagePack.Formatters.NullableUInt32Formatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> uint? +MessagePack.Formatters.NullableUInt32Formatter.Serialize(ref MessagePack.MessagePackWriter writer, uint? value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.NullableUInt64Formatter +MessagePack.Formatters.NullableUInt64Formatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> ulong? +MessagePack.Formatters.NullableUInt64Formatter.Serialize(ref MessagePack.MessagePackWriter writer, ulong? value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.ObservableCollectionFormatter +MessagePack.Formatters.ObservableCollectionFormatter.ObservableCollectionFormatter() -> void +MessagePack.Formatters.PrimitiveObjectFormatter +MessagePack.Formatters.PrimitiveObjectFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> object +MessagePack.Formatters.PrimitiveObjectFormatter.Serialize(ref MessagePack.MessagePackWriter writer, object value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.QueueFormatter +MessagePack.Formatters.QueueFormatter.QueueFormatter() -> void +MessagePack.Formatters.ReadOnlyCollectionFormatter +MessagePack.Formatters.ReadOnlyCollectionFormatter.ReadOnlyCollectionFormatter() -> void +MessagePack.Formatters.ReadOnlyDictionaryFormatter +MessagePack.Formatters.ReadOnlyDictionaryFormatter.ReadOnlyDictionaryFormatter() -> void +MessagePack.Formatters.ReadOnlyObservableCollectionFormatter +MessagePack.Formatters.ReadOnlyObservableCollectionFormatter.ReadOnlyObservableCollectionFormatter() -> void +MessagePack.Formatters.SByteArrayFormatter +MessagePack.Formatters.SByteArrayFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> sbyte[] +MessagePack.Formatters.SByteArrayFormatter.Serialize(ref MessagePack.MessagePackWriter writer, sbyte[] value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.SByteFormatter +MessagePack.Formatters.SByteFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> sbyte +MessagePack.Formatters.SByteFormatter.Serialize(ref MessagePack.MessagePackWriter writer, sbyte value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.SingleArrayFormatter +MessagePack.Formatters.SingleArrayFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> float[] +MessagePack.Formatters.SingleArrayFormatter.Serialize(ref MessagePack.MessagePackWriter writer, float[] value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.SingleFormatter +MessagePack.Formatters.SingleFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> float +MessagePack.Formatters.SingleFormatter.Serialize(ref MessagePack.MessagePackWriter writer, float value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.SortedDictionaryFormatter +MessagePack.Formatters.SortedDictionaryFormatter.SortedDictionaryFormatter() -> void +MessagePack.Formatters.SortedListFormatter +MessagePack.Formatters.SortedListFormatter.SortedListFormatter() -> void +MessagePack.Formatters.StackFormatter +MessagePack.Formatters.StackFormatter.StackFormatter() -> void +MessagePack.Formatters.StaticNullableFormatter +MessagePack.Formatters.StaticNullableFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> T? +MessagePack.Formatters.StaticNullableFormatter.Serialize(ref MessagePack.MessagePackWriter writer, T? value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.StaticNullableFormatter.StaticNullableFormatter(MessagePack.Formatters.IMessagePackFormatter underlyingFormatter) -> void +MessagePack.Formatters.StringBuilderFormatter +MessagePack.Formatters.StringBuilderFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> System.Text.StringBuilder +MessagePack.Formatters.StringBuilderFormatter.Serialize(ref MessagePack.MessagePackWriter writer, System.Text.StringBuilder value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.ThreeDimensionalArrayFormatter +MessagePack.Formatters.ThreeDimensionalArrayFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> T[,,] +MessagePack.Formatters.ThreeDimensionalArrayFormatter.Serialize(ref MessagePack.MessagePackWriter writer, T[,,] value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.ThreeDimensionalArrayFormatter.ThreeDimensionalArrayFormatter() -> void +MessagePack.Formatters.TimeSpanFormatter +MessagePack.Formatters.TimeSpanFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> System.TimeSpan +MessagePack.Formatters.TimeSpanFormatter.Serialize(ref MessagePack.MessagePackWriter writer, System.TimeSpan value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.TupleFormatter +MessagePack.Formatters.TupleFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> System.Tuple +MessagePack.Formatters.TupleFormatter.Serialize(ref MessagePack.MessagePackWriter writer, System.Tuple value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.TupleFormatter.TupleFormatter() -> void +MessagePack.Formatters.TupleFormatter +MessagePack.Formatters.TupleFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> System.Tuple +MessagePack.Formatters.TupleFormatter.Serialize(ref MessagePack.MessagePackWriter writer, System.Tuple value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.TupleFormatter.TupleFormatter() -> void +MessagePack.Formatters.TupleFormatter +MessagePack.Formatters.TupleFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> System.Tuple +MessagePack.Formatters.TupleFormatter.Serialize(ref MessagePack.MessagePackWriter writer, System.Tuple value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.TupleFormatter.TupleFormatter() -> void +MessagePack.Formatters.TupleFormatter +MessagePack.Formatters.TupleFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> System.Tuple +MessagePack.Formatters.TupleFormatter.Serialize(ref MessagePack.MessagePackWriter writer, System.Tuple value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.TupleFormatter.TupleFormatter() -> void +MessagePack.Formatters.TupleFormatter +MessagePack.Formatters.TupleFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> System.Tuple +MessagePack.Formatters.TupleFormatter.Serialize(ref MessagePack.MessagePackWriter writer, System.Tuple value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.TupleFormatter.TupleFormatter() -> void +MessagePack.Formatters.TupleFormatter +MessagePack.Formatters.TupleFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> System.Tuple +MessagePack.Formatters.TupleFormatter.Serialize(ref MessagePack.MessagePackWriter writer, System.Tuple value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.TupleFormatter.TupleFormatter() -> void +MessagePack.Formatters.TupleFormatter +MessagePack.Formatters.TupleFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> System.Tuple +MessagePack.Formatters.TupleFormatter.Serialize(ref MessagePack.MessagePackWriter writer, System.Tuple value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.TupleFormatter.TupleFormatter() -> void +MessagePack.Formatters.TupleFormatter +MessagePack.Formatters.TupleFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> System.Tuple +MessagePack.Formatters.TupleFormatter.Serialize(ref MessagePack.MessagePackWriter writer, System.Tuple value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.TupleFormatter.TupleFormatter() -> void +MessagePack.Formatters.TwoDimensionalArrayFormatter +MessagePack.Formatters.TwoDimensionalArrayFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> T[,] +MessagePack.Formatters.TwoDimensionalArrayFormatter.Serialize(ref MessagePack.MessagePackWriter writer, T[,] value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.TwoDimensionalArrayFormatter.TwoDimensionalArrayFormatter() -> void +MessagePack.Formatters.TypelessFormatter +MessagePack.Formatters.TypelessFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> object +MessagePack.Formatters.TypelessFormatter.Serialize(ref MessagePack.MessagePackWriter writer, object value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.UInt16ArrayFormatter +MessagePack.Formatters.UInt16ArrayFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> ushort[] +MessagePack.Formatters.UInt16ArrayFormatter.Serialize(ref MessagePack.MessagePackWriter writer, ushort[] value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.UInt16Formatter +MessagePack.Formatters.UInt16Formatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> ushort +MessagePack.Formatters.UInt16Formatter.Serialize(ref MessagePack.MessagePackWriter writer, ushort value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.UInt32ArrayFormatter +MessagePack.Formatters.UInt32ArrayFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> uint[] +MessagePack.Formatters.UInt32ArrayFormatter.Serialize(ref MessagePack.MessagePackWriter writer, uint[] value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.UInt32Formatter +MessagePack.Formatters.UInt32Formatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> uint +MessagePack.Formatters.UInt32Formatter.Serialize(ref MessagePack.MessagePackWriter writer, uint value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.UInt64ArrayFormatter +MessagePack.Formatters.UInt64ArrayFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> ulong[] +MessagePack.Formatters.UInt64ArrayFormatter.Serialize(ref MessagePack.MessagePackWriter writer, ulong[] value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.UInt64Formatter +MessagePack.Formatters.UInt64Formatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> ulong +MessagePack.Formatters.UInt64Formatter.Serialize(ref MessagePack.MessagePackWriter writer, ulong value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.UriFormatter +MessagePack.Formatters.UriFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> System.Uri +MessagePack.Formatters.UriFormatter.Serialize(ref MessagePack.MessagePackWriter writer, System.Uri value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.ValueTupleFormatter +MessagePack.Formatters.ValueTupleFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> System.ValueTuple +MessagePack.Formatters.ValueTupleFormatter.Serialize(ref MessagePack.MessagePackWriter writer, System.ValueTuple value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.ValueTupleFormatter.ValueTupleFormatter() -> void +MessagePack.Formatters.ValueTupleFormatter +MessagePack.Formatters.ValueTupleFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> (T1, T2, T3, T4, T5, T6, T7) +MessagePack.Formatters.ValueTupleFormatter.Serialize(ref MessagePack.MessagePackWriter writer, (T1, T2, T3, T4, T5, T6, T7) value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.ValueTupleFormatter.ValueTupleFormatter() -> void +MessagePack.Formatters.ValueTupleFormatter +MessagePack.Formatters.ValueTupleFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> (T1, T2, T3, T4, T5, T6) +MessagePack.Formatters.ValueTupleFormatter.Serialize(ref MessagePack.MessagePackWriter writer, (T1, T2, T3, T4, T5, T6) value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.ValueTupleFormatter.ValueTupleFormatter() -> void +MessagePack.Formatters.ValueTupleFormatter +MessagePack.Formatters.ValueTupleFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> (T1, T2, T3, T4, T5) +MessagePack.Formatters.ValueTupleFormatter.Serialize(ref MessagePack.MessagePackWriter writer, (T1, T2, T3, T4, T5) value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.ValueTupleFormatter.ValueTupleFormatter() -> void +MessagePack.Formatters.ValueTupleFormatter +MessagePack.Formatters.ValueTupleFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> (T1, T2, T3, T4) +MessagePack.Formatters.ValueTupleFormatter.Serialize(ref MessagePack.MessagePackWriter writer, (T1, T2, T3, T4) value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.ValueTupleFormatter.ValueTupleFormatter() -> void +MessagePack.Formatters.ValueTupleFormatter +MessagePack.Formatters.ValueTupleFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> (T1, T2, T3) +MessagePack.Formatters.ValueTupleFormatter.Serialize(ref MessagePack.MessagePackWriter writer, (T1, T2, T3) value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.ValueTupleFormatter.ValueTupleFormatter() -> void +MessagePack.Formatters.ValueTupleFormatter +MessagePack.Formatters.ValueTupleFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> (T1, T2) +MessagePack.Formatters.ValueTupleFormatter.Serialize(ref MessagePack.MessagePackWriter writer, (T1, T2) value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.ValueTupleFormatter.ValueTupleFormatter() -> void +MessagePack.Formatters.ValueTupleFormatter +MessagePack.Formatters.ValueTupleFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> System.ValueTuple +MessagePack.Formatters.ValueTupleFormatter.Serialize(ref MessagePack.MessagePackWriter writer, System.ValueTuple value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.ValueTupleFormatter.ValueTupleFormatter() -> void +MessagePack.Formatters.VersionFormatter +MessagePack.Formatters.VersionFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> System.Version +MessagePack.Formatters.VersionFormatter.Serialize(ref MessagePack.MessagePackWriter writer, System.Version value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.IFormatterResolver +MessagePack.IFormatterResolver.GetFormatter() -> MessagePack.Formatters.IMessagePackFormatter +MessagePack.Internal.AutomataDictionary +MessagePack.Internal.AutomataDictionary.Add(string str, int value) -> void +MessagePack.Internal.AutomataDictionary.AutomataDictionary() -> void +MessagePack.Internal.AutomataDictionary.EmitMatch(System.Reflection.Emit.ILGenerator il, System.Reflection.Emit.LocalBuilder bytesSpan, System.Reflection.Emit.LocalBuilder key, System.Action> onFound, System.Action onNotFound) -> void +MessagePack.Internal.AutomataDictionary.GetEnumerator() -> System.Collections.Generic.IEnumerator> +MessagePack.Internal.AutomataDictionary.TryGetValue(System.ReadOnlySpan bytes, out int value) -> bool +MessagePack.Internal.AutomataDictionary.TryGetValue(in System.Buffers.ReadOnlySequence bytes, out int value) -> bool +MessagePack.Internal.AutomataKeyGen +MessagePack.Internal.ByteArrayStringHashTable +MessagePack.Internal.ByteArrayStringHashTable.Add(byte[] key, int value) -> void +MessagePack.Internal.ByteArrayStringHashTable.Add(string key, int value) -> void +MessagePack.Internal.ByteArrayStringHashTable.ByteArrayStringHashTable(int capacity) -> void +MessagePack.Internal.ByteArrayStringHashTable.ByteArrayStringHashTable(int capacity, float loadFactor) -> void +MessagePack.Internal.ByteArrayStringHashTable.GetEnumerator() -> System.Collections.Generic.IEnumerator> +MessagePack.Internal.ByteArrayStringHashTable.TryGetValue(System.ReadOnlySpan key, out int value) -> bool +MessagePack.Internal.ByteArrayStringHashTable.TryGetValue(in System.Buffers.ReadOnlySequence key, out int value) -> bool +MessagePack.Internal.CodeGenHelpers +MessagePack.Internal.RuntimeTypeHandleEqualityComparer +MessagePack.Internal.RuntimeTypeHandleEqualityComparer.Equals(System.RuntimeTypeHandle x, System.RuntimeTypeHandle y) -> bool +MessagePack.Internal.RuntimeTypeHandleEqualityComparer.GetHashCode(System.RuntimeTypeHandle obj) -> int +MessagePack.Internal.UnsafeMemory +MessagePack.Internal.UnsafeMemory32 +MessagePack.Internal.UnsafeMemory64 +MessagePack.MessagePackCode +MessagePack.MessagePackCompression +MessagePack.MessagePackCompression.Lz4Block = 1 -> MessagePack.MessagePackCompression +MessagePack.MessagePackCompression.Lz4BlockArray = 2 -> MessagePack.MessagePackCompression +MessagePack.MessagePackCompression.None = 0 -> MessagePack.MessagePackCompression +MessagePack.MessagePackRange +MessagePack.MessagePackReader +MessagePack.MessagePackReader.CancellationToken.get -> System.Threading.CancellationToken +MessagePack.MessagePackReader.CancellationToken.set -> void +MessagePack.MessagePackReader.Clone(in System.Buffers.ReadOnlySequence readOnlySequence) -> MessagePack.MessagePackReader +MessagePack.MessagePackReader.Consumed.get -> long +MessagePack.MessagePackReader.CreatePeekReader() -> MessagePack.MessagePackReader +MessagePack.MessagePackReader.End.get -> bool +MessagePack.MessagePackReader.IsNil.get -> bool +MessagePack.MessagePackReader.MessagePackReader(System.ReadOnlyMemory memory) -> void +MessagePack.MessagePackReader.MessagePackReader(in System.Buffers.ReadOnlySequence readOnlySequence) -> void +MessagePack.MessagePackReader.NextCode.get -> byte +MessagePack.MessagePackReader.NextMessagePackType.get -> MessagePack.MessagePackType +MessagePack.MessagePackReader.Position.get -> System.SequencePosition +MessagePack.MessagePackReader.ReadArrayHeader() -> int +MessagePack.MessagePackReader.ReadBoolean() -> bool +MessagePack.MessagePackReader.ReadByte() -> byte +MessagePack.MessagePackReader.ReadBytes() -> System.Buffers.ReadOnlySequence? +MessagePack.MessagePackReader.ReadChar() -> char +MessagePack.MessagePackReader.ReadDateTime() -> System.DateTime +MessagePack.MessagePackReader.ReadDouble() -> double +MessagePack.MessagePackReader.ReadExtensionFormat() -> MessagePack.ExtensionResult +MessagePack.MessagePackReader.ReadExtensionFormatHeader() -> MessagePack.ExtensionHeader +MessagePack.MessagePackReader.ReadInt16() -> short +MessagePack.MessagePackReader.ReadInt32() -> int +MessagePack.MessagePackReader.ReadInt64() -> long +MessagePack.MessagePackReader.ReadMapHeader() -> int +MessagePack.MessagePackReader.ReadNil() -> MessagePack.Nil +MessagePack.MessagePackReader.ReadRaw() -> System.Buffers.ReadOnlySequence +MessagePack.MessagePackReader.ReadRaw(long length) -> System.Buffers.ReadOnlySequence +MessagePack.MessagePackReader.ReadSByte() -> sbyte +MessagePack.MessagePackReader.ReadSingle() -> float +MessagePack.MessagePackReader.ReadString() -> string +MessagePack.MessagePackReader.ReadStringSequence() -> System.Buffers.ReadOnlySequence? +MessagePack.MessagePackReader.ReadUInt16() -> ushort +MessagePack.MessagePackReader.ReadUInt32() -> uint +MessagePack.MessagePackReader.ReadUInt64() -> ulong +MessagePack.MessagePackReader.Sequence.get -> System.Buffers.ReadOnlySequence +MessagePack.MessagePackReader.Skip() -> void +MessagePack.MessagePackReader.TryReadNil() -> bool +MessagePack.MessagePackReader.TryReadStringSpan(out System.ReadOnlySpan span) -> bool +MessagePack.MessagePackSerializationException +MessagePack.MessagePackSerializationException.MessagePackSerializationException() -> void +MessagePack.MessagePackSerializationException.MessagePackSerializationException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) -> void +MessagePack.MessagePackSerializationException.MessagePackSerializationException(string message) -> void +MessagePack.MessagePackSerializationException.MessagePackSerializationException(string message, System.Exception inner) -> void +MessagePack.MessagePackSerializer +MessagePack.MessagePackSerializer.Typeless +MessagePack.MessagePackSerializerOptions +MessagePack.MessagePackSerializerOptions.AllowAssemblyVersionMismatch.get -> bool +MessagePack.MessagePackSerializerOptions.Compression.get -> MessagePack.MessagePackCompression +MessagePack.MessagePackSerializerOptions.MessagePackSerializerOptions(MessagePack.IFormatterResolver resolver) -> void +MessagePack.MessagePackSerializerOptions.MessagePackSerializerOptions(MessagePack.MessagePackSerializerOptions copyFrom) -> void +MessagePack.MessagePackSerializerOptions.OldSpec.get -> bool? +MessagePack.MessagePackSerializerOptions.OmitAssemblyVersion.get -> bool +MessagePack.MessagePackSerializerOptions.Resolver.get -> MessagePack.IFormatterResolver +MessagePack.MessagePackSerializerOptions.WithAllowAssemblyVersionMismatch(bool allowAssemblyVersionMismatch) -> MessagePack.MessagePackSerializerOptions +MessagePack.MessagePackSerializerOptions.WithCompression(MessagePack.MessagePackCompression compression) -> MessagePack.MessagePackSerializerOptions +MessagePack.MessagePackSerializerOptions.WithOldSpec(bool? oldSpec = true) -> MessagePack.MessagePackSerializerOptions +MessagePack.MessagePackSerializerOptions.WithOmitAssemblyVersion(bool omitAssemblyVersion) -> MessagePack.MessagePackSerializerOptions +MessagePack.MessagePackSerializerOptions.WithResolver(MessagePack.IFormatterResolver resolver) -> MessagePack.MessagePackSerializerOptions +MessagePack.MessagePackStreamReader +MessagePack.MessagePackStreamReader.Dispose() -> void +MessagePack.MessagePackStreamReader.MessagePackStreamReader(System.IO.Stream stream) -> void +MessagePack.MessagePackStreamReader.ReadAsync(System.Threading.CancellationToken cancellationToken) -> System.Threading.Tasks.ValueTask?> +MessagePack.MessagePackStreamReader.RemainingBytes.get -> System.Buffers.ReadOnlySequence +MessagePack.MessagePackType +MessagePack.MessagePackType.Array = 7 -> MessagePack.MessagePackType +MessagePack.MessagePackType.Binary = 6 -> MessagePack.MessagePackType +MessagePack.MessagePackType.Boolean = 3 -> MessagePack.MessagePackType +MessagePack.MessagePackType.Extension = 9 -> MessagePack.MessagePackType +MessagePack.MessagePackType.Float = 4 -> MessagePack.MessagePackType +MessagePack.MessagePackType.Integer = 1 -> MessagePack.MessagePackType +MessagePack.MessagePackType.Map = 8 -> MessagePack.MessagePackType +MessagePack.MessagePackType.Nil = 2 -> MessagePack.MessagePackType +MessagePack.MessagePackType.String = 5 -> MessagePack.MessagePackType +MessagePack.MessagePackType.Unknown = 0 -> MessagePack.MessagePackType +MessagePack.MessagePackWriter +MessagePack.MessagePackWriter.Advance(int length) -> void +MessagePack.MessagePackWriter.CancellationToken.get -> System.Threading.CancellationToken +MessagePack.MessagePackWriter.CancellationToken.set -> void +MessagePack.MessagePackWriter.Clone(System.Buffers.IBufferWriter writer) -> MessagePack.MessagePackWriter +MessagePack.MessagePackWriter.Flush() -> void +MessagePack.MessagePackWriter.GetSpan(int length) -> System.Span +MessagePack.MessagePackWriter.MessagePackWriter(System.Buffers.IBufferWriter writer) -> void +MessagePack.MessagePackWriter.OldSpec.get -> bool +MessagePack.MessagePackWriter.OldSpec.set -> void +MessagePack.MessagePackWriter.Write(System.DateTime dateTime) -> void +MessagePack.MessagePackWriter.Write(System.ReadOnlySpan src) -> void +MessagePack.MessagePackWriter.Write(System.ReadOnlySpan value) -> void +MessagePack.MessagePackWriter.Write(bool value) -> void +MessagePack.MessagePackWriter.Write(byte value) -> void +MessagePack.MessagePackWriter.Write(byte[] src) -> void +MessagePack.MessagePackWriter.Write(char value) -> void +MessagePack.MessagePackWriter.Write(double value) -> void +MessagePack.MessagePackWriter.Write(float value) -> void +MessagePack.MessagePackWriter.Write(in System.Buffers.ReadOnlySequence src) -> void +MessagePack.MessagePackWriter.Write(int value) -> void +MessagePack.MessagePackWriter.Write(long value) -> void +MessagePack.MessagePackWriter.Write(sbyte value) -> void +MessagePack.MessagePackWriter.Write(short value) -> void +MessagePack.MessagePackWriter.Write(string value) -> void +MessagePack.MessagePackWriter.Write(uint value) -> void +MessagePack.MessagePackWriter.Write(ulong value) -> void +MessagePack.MessagePackWriter.Write(ushort value) -> void +MessagePack.MessagePackWriter.WriteArrayHeader(int count) -> void +MessagePack.MessagePackWriter.WriteArrayHeader(uint count) -> void +MessagePack.MessagePackWriter.WriteExtensionFormat(MessagePack.ExtensionResult extensionData) -> void +MessagePack.MessagePackWriter.WriteExtensionFormatHeader(MessagePack.ExtensionHeader extensionHeader) -> void +MessagePack.MessagePackWriter.WriteInt16(short value) -> void +MessagePack.MessagePackWriter.WriteInt32(int value) -> void +MessagePack.MessagePackWriter.WriteInt64(long value) -> void +MessagePack.MessagePackWriter.WriteInt8(sbyte value) -> void +MessagePack.MessagePackWriter.WriteMapHeader(int count) -> void +MessagePack.MessagePackWriter.WriteMapHeader(uint count) -> void +MessagePack.MessagePackWriter.WriteNil() -> void +MessagePack.MessagePackWriter.WriteRaw(System.ReadOnlySpan rawMessagePackBlock) -> void +MessagePack.MessagePackWriter.WriteRaw(in System.Buffers.ReadOnlySequence rawMessagePackBlock) -> void +MessagePack.MessagePackWriter.WriteString(System.ReadOnlySpan utf8stringBytes) -> void +MessagePack.MessagePackWriter.WriteString(in System.Buffers.ReadOnlySequence utf8stringBytes) -> void +MessagePack.MessagePackWriter.WriteUInt16(ushort value) -> void +MessagePack.MessagePackWriter.WriteUInt32(uint value) -> void +MessagePack.MessagePackWriter.WriteUInt64(ulong value) -> void +MessagePack.MessagePackWriter.WriteUInt8(byte value) -> void +MessagePack.Nil +MessagePack.Nil.Equals(MessagePack.Nil other) -> bool +MessagePack.Nil.Nil() -> void +MessagePack.ReservedMessagePackExtensionTypeCode +MessagePack.Resolvers.AttributeFormatterResolver +MessagePack.Resolvers.AttributeFormatterResolver.GetFormatter() -> MessagePack.Formatters.IMessagePackFormatter +MessagePack.Resolvers.BuiltinResolver +MessagePack.Resolvers.BuiltinResolver.GetFormatter() -> MessagePack.Formatters.IMessagePackFormatter +MessagePack.Resolvers.CompositeResolver +MessagePack.Resolvers.ContractlessStandardResolver +MessagePack.Resolvers.ContractlessStandardResolver.GetFormatter() -> MessagePack.Formatters.IMessagePackFormatter +MessagePack.Resolvers.ContractlessStandardResolverAllowPrivate +MessagePack.Resolvers.ContractlessStandardResolverAllowPrivate.GetFormatter() -> MessagePack.Formatters.IMessagePackFormatter +MessagePack.Resolvers.DynamicContractlessObjectResolver +MessagePack.Resolvers.DynamicContractlessObjectResolver.GetFormatter() -> MessagePack.Formatters.IMessagePackFormatter +MessagePack.Resolvers.DynamicContractlessObjectResolverAllowPrivate +MessagePack.Resolvers.DynamicContractlessObjectResolverAllowPrivate.DynamicContractlessObjectResolverAllowPrivate() -> void +MessagePack.Resolvers.DynamicContractlessObjectResolverAllowPrivate.GetFormatter() -> MessagePack.Formatters.IMessagePackFormatter +MessagePack.Resolvers.DynamicEnumAsStringResolver +MessagePack.Resolvers.DynamicEnumAsStringResolver.GetFormatter() -> MessagePack.Formatters.IMessagePackFormatter +MessagePack.Resolvers.DynamicEnumResolver +MessagePack.Resolvers.DynamicEnumResolver.GetFormatter() -> MessagePack.Formatters.IMessagePackFormatter +MessagePack.Resolvers.DynamicGenericResolver +MessagePack.Resolvers.DynamicGenericResolver.GetFormatter() -> MessagePack.Formatters.IMessagePackFormatter +MessagePack.Resolvers.DynamicObjectResolver +MessagePack.Resolvers.DynamicObjectResolver.GetFormatter() -> MessagePack.Formatters.IMessagePackFormatter +MessagePack.Resolvers.DynamicObjectResolverAllowPrivate +MessagePack.Resolvers.DynamicObjectResolverAllowPrivate.GetFormatter() -> MessagePack.Formatters.IMessagePackFormatter +MessagePack.Resolvers.DynamicUnionResolver +MessagePack.Resolvers.DynamicUnionResolver.GetFormatter() -> MessagePack.Formatters.IMessagePackFormatter +MessagePack.Resolvers.NativeDateTimeResolver +MessagePack.Resolvers.NativeDateTimeResolver.GetFormatter() -> MessagePack.Formatters.IMessagePackFormatter +MessagePack.Resolvers.NativeDecimalResolver +MessagePack.Resolvers.NativeDecimalResolver.GetFormatter() -> MessagePack.Formatters.IMessagePackFormatter +MessagePack.Resolvers.NativeGuidResolver +MessagePack.Resolvers.NativeGuidResolver.GetFormatter() -> MessagePack.Formatters.IMessagePackFormatter +MessagePack.Resolvers.PrimitiveObjectResolver +MessagePack.Resolvers.PrimitiveObjectResolver.GetFormatter() -> MessagePack.Formatters.IMessagePackFormatter +MessagePack.Resolvers.StandardResolver +MessagePack.Resolvers.StandardResolver.GetFormatter() -> MessagePack.Formatters.IMessagePackFormatter +MessagePack.Resolvers.StandardResolverAllowPrivate +MessagePack.Resolvers.StandardResolverAllowPrivate.GetFormatter() -> MessagePack.Formatters.IMessagePackFormatter +MessagePack.Resolvers.StaticCompositeResolver +MessagePack.Resolvers.StaticCompositeResolver.GetFormatter() -> MessagePack.Formatters.IMessagePackFormatter +MessagePack.Resolvers.StaticCompositeResolver.Register(System.Collections.Generic.IReadOnlyList formatters, System.Collections.Generic.IReadOnlyList resolvers) -> void +MessagePack.Resolvers.StaticCompositeResolver.Register(params MessagePack.Formatters.IMessagePackFormatter[] formatters) -> void +MessagePack.Resolvers.StaticCompositeResolver.Register(params MessagePack.IFormatterResolver[] resolvers) -> void +MessagePack.Resolvers.TypelessContractlessStandardResolver +MessagePack.Resolvers.TypelessContractlessStandardResolver.GetFormatter() -> MessagePack.Formatters.IMessagePackFormatter +MessagePack.Resolvers.TypelessContractlessStandardResolver.TypelessContractlessStandardResolver() -> void +MessagePack.Resolvers.TypelessObjectResolver +MessagePack.Resolvers.TypelessObjectResolver.GetFormatter() -> MessagePack.Formatters.IMessagePackFormatter +MessagePack.TinyJsonException +MessagePack.TinyJsonException.TinyJsonException(string message) -> void +abstract MessagePack.Formatters.CollectionFormatterBase.Add(TIntermediate collection, int index, TElement value, MessagePack.MessagePackSerializerOptions options) -> void +abstract MessagePack.Formatters.CollectionFormatterBase.Complete(TIntermediate intermediateCollection) -> TCollection +abstract MessagePack.Formatters.CollectionFormatterBase.Create(int count, MessagePack.MessagePackSerializerOptions options) -> TIntermediate +abstract MessagePack.Formatters.CollectionFormatterBase.GetSourceEnumerator(TCollection source) -> TEnumerator +abstract MessagePack.Formatters.DictionaryFormatterBase.Add(TIntermediate collection, int index, TKey key, TValue value, MessagePack.MessagePackSerializerOptions options) -> void +abstract MessagePack.Formatters.DictionaryFormatterBase.Complete(TIntermediate intermediateCollection) -> TDictionary +abstract MessagePack.Formatters.DictionaryFormatterBase.Create(int count, MessagePack.MessagePackSerializerOptions options) -> TIntermediate +abstract MessagePack.Formatters.DictionaryFormatterBase.GetSourceEnumerator(TDictionary source) -> TEnumerator +const MessagePack.MessagePackCode.Array16 = 220 -> byte +const MessagePack.MessagePackCode.Array32 = 221 -> byte +const MessagePack.MessagePackCode.Bin16 = 197 -> byte +const MessagePack.MessagePackCode.Bin32 = 198 -> byte +const MessagePack.MessagePackCode.Bin8 = 196 -> byte +const MessagePack.MessagePackCode.Ext16 = 200 -> byte +const MessagePack.MessagePackCode.Ext32 = 201 -> byte +const MessagePack.MessagePackCode.Ext8 = 199 -> byte +const MessagePack.MessagePackCode.False = 194 -> byte +const MessagePack.MessagePackCode.FixExt1 = 212 -> byte +const MessagePack.MessagePackCode.FixExt16 = 216 -> byte +const MessagePack.MessagePackCode.FixExt2 = 213 -> byte +const MessagePack.MessagePackCode.FixExt4 = 214 -> byte +const MessagePack.MessagePackCode.FixExt8 = 215 -> byte +const MessagePack.MessagePackCode.Float32 = 202 -> byte +const MessagePack.MessagePackCode.Float64 = 203 -> byte +const MessagePack.MessagePackCode.Int16 = 209 -> byte +const MessagePack.MessagePackCode.Int32 = 210 -> byte +const MessagePack.MessagePackCode.Int64 = 211 -> byte +const MessagePack.MessagePackCode.Int8 = 208 -> byte +const MessagePack.MessagePackCode.Map16 = 222 -> byte +const MessagePack.MessagePackCode.Map32 = 223 -> byte +const MessagePack.MessagePackCode.MaxFixArray = 159 -> byte +const MessagePack.MessagePackCode.MaxFixInt = 127 -> byte +const MessagePack.MessagePackCode.MaxFixMap = 143 -> byte +const MessagePack.MessagePackCode.MaxFixStr = 191 -> byte +const MessagePack.MessagePackCode.MaxNegativeFixInt = 255 -> byte +const MessagePack.MessagePackCode.MinFixArray = 144 -> byte +const MessagePack.MessagePackCode.MinFixInt = 0 -> byte +const MessagePack.MessagePackCode.MinFixMap = 128 -> byte +const MessagePack.MessagePackCode.MinFixStr = 160 -> byte +const MessagePack.MessagePackCode.MinNegativeFixInt = 224 -> byte +const MessagePack.MessagePackCode.NeverUsed = 193 -> byte +const MessagePack.MessagePackCode.Nil = 192 -> byte +const MessagePack.MessagePackCode.Str16 = 218 -> byte +const MessagePack.MessagePackCode.Str32 = 219 -> byte +const MessagePack.MessagePackCode.Str8 = 217 -> byte +const MessagePack.MessagePackCode.True = 195 -> byte +const MessagePack.MessagePackCode.UInt16 = 205 -> byte +const MessagePack.MessagePackCode.UInt32 = 206 -> byte +const MessagePack.MessagePackCode.UInt64 = 207 -> byte +const MessagePack.MessagePackCode.UInt8 = 204 -> byte +const MessagePack.MessagePackRange.MaxFixArrayCount = 15 -> int +const MessagePack.MessagePackRange.MaxFixMapCount = 15 -> int +const MessagePack.MessagePackRange.MaxFixNegativeInt = -1 -> int +const MessagePack.MessagePackRange.MaxFixPositiveInt = 127 -> int +const MessagePack.MessagePackRange.MaxFixStringLength = 31 -> int +const MessagePack.MessagePackRange.MinFixNegativeInt = -32 -> int +const MessagePack.MessagePackRange.MinFixStringLength = 0 -> int +const MessagePack.ReservedMessagePackExtensionTypeCode.DateTime = -1 -> sbyte +override MessagePack.Formatters.CollectionFormatterBase.GetSourceEnumerator(TCollection source) -> System.Collections.Generic.IEnumerator +override MessagePack.Formatters.DictionaryFormatterBase.Complete(TDictionary intermediateCollection) -> TDictionary +override MessagePack.Formatters.DictionaryFormatterBase.GetSourceEnumerator(TDictionary source) -> System.Collections.Generic.IEnumerator> +override MessagePack.Internal.AutomataDictionary.ToString() -> string +override MessagePack.Nil.Equals(object obj) -> bool +override MessagePack.Nil.GetHashCode() -> int +override MessagePack.Nil.ToString() -> string +override sealed MessagePack.Formatters.CollectionFormatterBase.Complete(TCollection intermediateCollection) -> TCollection +static MessagePack.FormatterResolverExtensions.GetFormatterDynamic(this MessagePack.IFormatterResolver resolver, System.Type type) -> object +static MessagePack.FormatterResolverExtensions.GetFormatterWithVerify(this MessagePack.IFormatterResolver resolver) -> MessagePack.Formatters.IMessagePackFormatter +static MessagePack.Formatters.PrimitiveObjectFormatter.IsSupportedType(System.Type type, System.Reflection.TypeInfo typeInfo, object value) -> bool +static MessagePack.Internal.AutomataKeyGen.GetKey(ref System.ReadOnlySpan span) -> ulong +static MessagePack.Internal.CodeGenHelpers.GetArrayFromNullableSequence(in System.Buffers.ReadOnlySequence? sequence) -> byte[] +static MessagePack.Internal.CodeGenHelpers.GetEncodedStringBytes(string value) -> byte[] +static MessagePack.Internal.CodeGenHelpers.GetSpanFromSequence(in System.Buffers.ReadOnlySequence sequence) -> System.ReadOnlySpan +static MessagePack.Internal.CodeGenHelpers.ReadStringSpan(ref MessagePack.MessagePackReader reader) -> System.ReadOnlySpan +static MessagePack.Internal.UnsafeMemory32.WriteRaw1(ref MessagePack.MessagePackWriter writer, System.ReadOnlySpan src) -> void +static MessagePack.Internal.UnsafeMemory32.WriteRaw10(ref MessagePack.MessagePackWriter writer, System.ReadOnlySpan src) -> void +static MessagePack.Internal.UnsafeMemory32.WriteRaw11(ref MessagePack.MessagePackWriter writer, System.ReadOnlySpan src) -> void +static MessagePack.Internal.UnsafeMemory32.WriteRaw12(ref MessagePack.MessagePackWriter writer, System.ReadOnlySpan src) -> void +static MessagePack.Internal.UnsafeMemory32.WriteRaw13(ref MessagePack.MessagePackWriter writer, System.ReadOnlySpan src) -> void +static MessagePack.Internal.UnsafeMemory32.WriteRaw14(ref MessagePack.MessagePackWriter writer, System.ReadOnlySpan src) -> void +static MessagePack.Internal.UnsafeMemory32.WriteRaw15(ref MessagePack.MessagePackWriter writer, System.ReadOnlySpan src) -> void +static MessagePack.Internal.UnsafeMemory32.WriteRaw16(ref MessagePack.MessagePackWriter writer, System.ReadOnlySpan src) -> void +static MessagePack.Internal.UnsafeMemory32.WriteRaw17(ref MessagePack.MessagePackWriter writer, System.ReadOnlySpan src) -> void +static MessagePack.Internal.UnsafeMemory32.WriteRaw18(ref MessagePack.MessagePackWriter writer, System.ReadOnlySpan src) -> void +static MessagePack.Internal.UnsafeMemory32.WriteRaw19(ref MessagePack.MessagePackWriter writer, System.ReadOnlySpan src) -> void +static MessagePack.Internal.UnsafeMemory32.WriteRaw2(ref MessagePack.MessagePackWriter writer, System.ReadOnlySpan src) -> void +static MessagePack.Internal.UnsafeMemory32.WriteRaw20(ref MessagePack.MessagePackWriter writer, System.ReadOnlySpan src) -> void +static MessagePack.Internal.UnsafeMemory32.WriteRaw21(ref MessagePack.MessagePackWriter writer, System.ReadOnlySpan src) -> void +static MessagePack.Internal.UnsafeMemory32.WriteRaw22(ref MessagePack.MessagePackWriter writer, System.ReadOnlySpan src) -> void +static MessagePack.Internal.UnsafeMemory32.WriteRaw23(ref MessagePack.MessagePackWriter writer, System.ReadOnlySpan src) -> void +static MessagePack.Internal.UnsafeMemory32.WriteRaw24(ref MessagePack.MessagePackWriter writer, System.ReadOnlySpan src) -> void +static MessagePack.Internal.UnsafeMemory32.WriteRaw25(ref MessagePack.MessagePackWriter writer, System.ReadOnlySpan src) -> void +static MessagePack.Internal.UnsafeMemory32.WriteRaw26(ref MessagePack.MessagePackWriter writer, System.ReadOnlySpan src) -> void +static MessagePack.Internal.UnsafeMemory32.WriteRaw27(ref MessagePack.MessagePackWriter writer, System.ReadOnlySpan src) -> void +static MessagePack.Internal.UnsafeMemory32.WriteRaw28(ref MessagePack.MessagePackWriter writer, System.ReadOnlySpan src) -> void +static MessagePack.Internal.UnsafeMemory32.WriteRaw29(ref MessagePack.MessagePackWriter writer, System.ReadOnlySpan src) -> void +static MessagePack.Internal.UnsafeMemory32.WriteRaw3(ref MessagePack.MessagePackWriter writer, System.ReadOnlySpan src) -> void +static MessagePack.Internal.UnsafeMemory32.WriteRaw30(ref MessagePack.MessagePackWriter writer, System.ReadOnlySpan src) -> void +static MessagePack.Internal.UnsafeMemory32.WriteRaw31(ref MessagePack.MessagePackWriter writer, System.ReadOnlySpan src) -> void +static MessagePack.Internal.UnsafeMemory32.WriteRaw4(ref MessagePack.MessagePackWriter writer, System.ReadOnlySpan src) -> void +static MessagePack.Internal.UnsafeMemory32.WriteRaw5(ref MessagePack.MessagePackWriter writer, System.ReadOnlySpan src) -> void +static MessagePack.Internal.UnsafeMemory32.WriteRaw6(ref MessagePack.MessagePackWriter writer, System.ReadOnlySpan src) -> void +static MessagePack.Internal.UnsafeMemory32.WriteRaw7(ref MessagePack.MessagePackWriter writer, System.ReadOnlySpan src) -> void +static MessagePack.Internal.UnsafeMemory32.WriteRaw8(ref MessagePack.MessagePackWriter writer, System.ReadOnlySpan src) -> void +static MessagePack.Internal.UnsafeMemory32.WriteRaw9(ref MessagePack.MessagePackWriter writer, System.ReadOnlySpan src) -> void +static MessagePack.Internal.UnsafeMemory64.WriteRaw1(ref MessagePack.MessagePackWriter writer, System.ReadOnlySpan src) -> void +static MessagePack.Internal.UnsafeMemory64.WriteRaw10(ref MessagePack.MessagePackWriter writer, System.ReadOnlySpan src) -> void +static MessagePack.Internal.UnsafeMemory64.WriteRaw11(ref MessagePack.MessagePackWriter writer, System.ReadOnlySpan src) -> void +static MessagePack.Internal.UnsafeMemory64.WriteRaw12(ref MessagePack.MessagePackWriter writer, System.ReadOnlySpan src) -> void +static MessagePack.Internal.UnsafeMemory64.WriteRaw13(ref MessagePack.MessagePackWriter writer, System.ReadOnlySpan src) -> void +static MessagePack.Internal.UnsafeMemory64.WriteRaw14(ref MessagePack.MessagePackWriter writer, System.ReadOnlySpan src) -> void +static MessagePack.Internal.UnsafeMemory64.WriteRaw15(ref MessagePack.MessagePackWriter writer, System.ReadOnlySpan src) -> void +static MessagePack.Internal.UnsafeMemory64.WriteRaw16(ref MessagePack.MessagePackWriter writer, System.ReadOnlySpan src) -> void +static MessagePack.Internal.UnsafeMemory64.WriteRaw17(ref MessagePack.MessagePackWriter writer, System.ReadOnlySpan src) -> void +static MessagePack.Internal.UnsafeMemory64.WriteRaw18(ref MessagePack.MessagePackWriter writer, System.ReadOnlySpan src) -> void +static MessagePack.Internal.UnsafeMemory64.WriteRaw19(ref MessagePack.MessagePackWriter writer, System.ReadOnlySpan src) -> void +static MessagePack.Internal.UnsafeMemory64.WriteRaw2(ref MessagePack.MessagePackWriter writer, System.ReadOnlySpan src) -> void +static MessagePack.Internal.UnsafeMemory64.WriteRaw20(ref MessagePack.MessagePackWriter writer, System.ReadOnlySpan src) -> void +static MessagePack.Internal.UnsafeMemory64.WriteRaw21(ref MessagePack.MessagePackWriter writer, System.ReadOnlySpan src) -> void +static MessagePack.Internal.UnsafeMemory64.WriteRaw22(ref MessagePack.MessagePackWriter writer, System.ReadOnlySpan src) -> void +static MessagePack.Internal.UnsafeMemory64.WriteRaw23(ref MessagePack.MessagePackWriter writer, System.ReadOnlySpan src) -> void +static MessagePack.Internal.UnsafeMemory64.WriteRaw24(ref MessagePack.MessagePackWriter writer, System.ReadOnlySpan src) -> void +static MessagePack.Internal.UnsafeMemory64.WriteRaw25(ref MessagePack.MessagePackWriter writer, System.ReadOnlySpan src) -> void +static MessagePack.Internal.UnsafeMemory64.WriteRaw26(ref MessagePack.MessagePackWriter writer, System.ReadOnlySpan src) -> void +static MessagePack.Internal.UnsafeMemory64.WriteRaw27(ref MessagePack.MessagePackWriter writer, System.ReadOnlySpan src) -> void +static MessagePack.Internal.UnsafeMemory64.WriteRaw28(ref MessagePack.MessagePackWriter writer, System.ReadOnlySpan src) -> void +static MessagePack.Internal.UnsafeMemory64.WriteRaw29(ref MessagePack.MessagePackWriter writer, System.ReadOnlySpan src) -> void +static MessagePack.Internal.UnsafeMemory64.WriteRaw3(ref MessagePack.MessagePackWriter writer, System.ReadOnlySpan src) -> void +static MessagePack.Internal.UnsafeMemory64.WriteRaw30(ref MessagePack.MessagePackWriter writer, System.ReadOnlySpan src) -> void +static MessagePack.Internal.UnsafeMemory64.WriteRaw31(ref MessagePack.MessagePackWriter writer, System.ReadOnlySpan src) -> void +static MessagePack.Internal.UnsafeMemory64.WriteRaw4(ref MessagePack.MessagePackWriter writer, System.ReadOnlySpan src) -> void +static MessagePack.Internal.UnsafeMemory64.WriteRaw5(ref MessagePack.MessagePackWriter writer, System.ReadOnlySpan src) -> void +static MessagePack.Internal.UnsafeMemory64.WriteRaw6(ref MessagePack.MessagePackWriter writer, System.ReadOnlySpan src) -> void +static MessagePack.Internal.UnsafeMemory64.WriteRaw7(ref MessagePack.MessagePackWriter writer, System.ReadOnlySpan src) -> void +static MessagePack.Internal.UnsafeMemory64.WriteRaw8(ref MessagePack.MessagePackWriter writer, System.ReadOnlySpan src) -> void +static MessagePack.Internal.UnsafeMemory64.WriteRaw9(ref MessagePack.MessagePackWriter writer, System.ReadOnlySpan src) -> void +static MessagePack.MessagePackCode.ToFormatName(byte code) -> string +static MessagePack.MessagePackCode.ToMessagePackType(byte code) -> MessagePack.MessagePackType +static MessagePack.MessagePackSerializer.ConvertFromJson(System.IO.TextReader reader, ref MessagePack.MessagePackWriter writer, MessagePack.MessagePackSerializerOptions options = null) -> void +static MessagePack.MessagePackSerializer.ConvertFromJson(string str, MessagePack.MessagePackSerializerOptions options = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) -> byte[] +static MessagePack.MessagePackSerializer.ConvertFromJson(string str, ref MessagePack.MessagePackWriter writer, MessagePack.MessagePackSerializerOptions options = null) -> void +static MessagePack.MessagePackSerializer.ConvertToJson(System.ReadOnlyMemory bytes, MessagePack.MessagePackSerializerOptions options = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) -> string +static MessagePack.MessagePackSerializer.ConvertToJson(in System.Buffers.ReadOnlySequence bytes, MessagePack.MessagePackSerializerOptions options = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) -> string +static MessagePack.MessagePackSerializer.ConvertToJson(ref MessagePack.MessagePackReader reader, System.IO.TextWriter jsonWriter, MessagePack.MessagePackSerializerOptions options = null) -> void +static MessagePack.MessagePackSerializer.DefaultOptions.get -> MessagePack.MessagePackSerializerOptions +static MessagePack.MessagePackSerializer.DefaultOptions.set -> void +static MessagePack.MessagePackSerializer.Deserialize(System.Type type, System.Buffers.ReadOnlySequence bytes, MessagePack.MessagePackSerializerOptions options = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) -> object +static MessagePack.MessagePackSerializer.Deserialize(System.Type type, System.IO.Stream stream, MessagePack.MessagePackSerializerOptions options = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) -> object +static MessagePack.MessagePackSerializer.Deserialize(System.Type type, System.ReadOnlyMemory bytes, MessagePack.MessagePackSerializerOptions options = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) -> object +static MessagePack.MessagePackSerializer.Deserialize(System.Type type, ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options = null) -> object +static MessagePack.MessagePackSerializer.Deserialize(System.IO.Stream stream, MessagePack.MessagePackSerializerOptions options = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) -> T +static MessagePack.MessagePackSerializer.Deserialize(System.ReadOnlyMemory buffer, MessagePack.MessagePackSerializerOptions options = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) -> T +static MessagePack.MessagePackSerializer.Deserialize(System.ReadOnlyMemory buffer, MessagePack.MessagePackSerializerOptions options, out int bytesRead, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) -> T +static MessagePack.MessagePackSerializer.Deserialize(System.ReadOnlyMemory buffer, out int bytesRead, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) -> T +static MessagePack.MessagePackSerializer.Deserialize(in System.Buffers.ReadOnlySequence byteSequence, MessagePack.MessagePackSerializerOptions options = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) -> T +static MessagePack.MessagePackSerializer.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options = null) -> T +static MessagePack.MessagePackSerializer.DeserializeAsync(System.Type type, System.IO.Stream stream, MessagePack.MessagePackSerializerOptions options = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) -> System.Threading.Tasks.ValueTask +static MessagePack.MessagePackSerializer.DeserializeAsync(System.IO.Stream stream, MessagePack.MessagePackSerializerOptions options = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) -> System.Threading.Tasks.ValueTask +static MessagePack.MessagePackSerializer.Serialize(System.Type type, System.Buffers.IBufferWriter writer, object obj, MessagePack.MessagePackSerializerOptions options = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) -> void +static MessagePack.MessagePackSerializer.Serialize(System.Type type, System.IO.Stream stream, object obj, MessagePack.MessagePackSerializerOptions options = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) -> void +static MessagePack.MessagePackSerializer.Serialize(System.Type type, object obj, MessagePack.MessagePackSerializerOptions options = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) -> byte[] +static MessagePack.MessagePackSerializer.Serialize(System.Type type, ref MessagePack.MessagePackWriter writer, object obj, MessagePack.MessagePackSerializerOptions options = null) -> void +static MessagePack.MessagePackSerializer.Serialize(System.Buffers.IBufferWriter writer, T value, MessagePack.MessagePackSerializerOptions options = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) -> void +static MessagePack.MessagePackSerializer.Serialize(System.IO.Stream stream, T value, MessagePack.MessagePackSerializerOptions options = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) -> void +static MessagePack.MessagePackSerializer.Serialize(T value, MessagePack.MessagePackSerializerOptions options = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) -> byte[] +static MessagePack.MessagePackSerializer.Serialize(ref MessagePack.MessagePackWriter writer, T value, MessagePack.MessagePackSerializerOptions options = null) -> void +static MessagePack.MessagePackSerializer.SerializeAsync(System.Type type, System.IO.Stream stream, object obj, MessagePack.MessagePackSerializerOptions options = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) -> System.Threading.Tasks.Task +static MessagePack.MessagePackSerializer.SerializeAsync(System.IO.Stream stream, T value, MessagePack.MessagePackSerializerOptions options = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) -> System.Threading.Tasks.Task +static MessagePack.MessagePackSerializer.SerializeToJson(System.IO.TextWriter textWriter, T obj, MessagePack.MessagePackSerializerOptions options = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) -> void +static MessagePack.MessagePackSerializer.SerializeToJson(T obj, MessagePack.MessagePackSerializerOptions options = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) -> string +static MessagePack.MessagePackSerializer.Typeless.DefaultOptions.get -> MessagePack.MessagePackSerializerOptions +static MessagePack.MessagePackSerializer.Typeless.DefaultOptions.set -> void +static MessagePack.MessagePackSerializer.Typeless.Deserialize(System.IO.Stream stream, MessagePack.MessagePackSerializerOptions options = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) -> object +static MessagePack.MessagePackSerializer.Typeless.Deserialize(System.Memory bytes, MessagePack.MessagePackSerializerOptions options = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) -> object +static MessagePack.MessagePackSerializer.Typeless.Deserialize(in System.Buffers.ReadOnlySequence byteSequence, MessagePack.MessagePackSerializerOptions options = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) -> object +static MessagePack.MessagePackSerializer.Typeless.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options = null) -> object +static MessagePack.MessagePackSerializer.Typeless.DeserializeAsync(System.IO.Stream stream, MessagePack.MessagePackSerializerOptions options = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) -> System.Threading.Tasks.ValueTask +static MessagePack.MessagePackSerializer.Typeless.Serialize(System.Buffers.IBufferWriter writer, object obj, MessagePack.MessagePackSerializerOptions options = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) -> void +static MessagePack.MessagePackSerializer.Typeless.Serialize(System.IO.Stream stream, object obj, MessagePack.MessagePackSerializerOptions options = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) -> void +static MessagePack.MessagePackSerializer.Typeless.Serialize(object obj, MessagePack.MessagePackSerializerOptions options = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) -> byte[] +static MessagePack.MessagePackSerializer.Typeless.Serialize(ref MessagePack.MessagePackWriter writer, object obj, MessagePack.MessagePackSerializerOptions options = null) -> void +static MessagePack.MessagePackSerializer.Typeless.SerializeAsync(System.IO.Stream stream, object obj, MessagePack.MessagePackSerializerOptions options = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) -> System.Threading.Tasks.Task +static MessagePack.MessagePackSerializerOptions.Standard.get -> MessagePack.MessagePackSerializerOptions +static MessagePack.Resolvers.CompositeResolver.Create(System.Collections.Generic.IReadOnlyList formatters, System.Collections.Generic.IReadOnlyList resolvers) -> MessagePack.IFormatterResolver +static MessagePack.Resolvers.CompositeResolver.Create(params MessagePack.Formatters.IMessagePackFormatter[] formatters) -> MessagePack.IFormatterResolver +static MessagePack.Resolvers.CompositeResolver.Create(params MessagePack.IFormatterResolver[] resolvers) -> MessagePack.IFormatterResolver +static readonly MessagePack.Formatters.BigIntegerFormatter.Instance -> MessagePack.Formatters.IMessagePackFormatter +static readonly MessagePack.Formatters.BitArrayFormatter.Instance -> MessagePack.Formatters.IMessagePackFormatter +static readonly MessagePack.Formatters.BooleanArrayFormatter.Instance -> MessagePack.Formatters.BooleanArrayFormatter +static readonly MessagePack.Formatters.BooleanFormatter.Instance -> MessagePack.Formatters.BooleanFormatter +static readonly MessagePack.Formatters.ByteArrayFormatter.Instance -> MessagePack.Formatters.ByteArrayFormatter +static readonly MessagePack.Formatters.ByteArraySegmentFormatter.Instance -> MessagePack.Formatters.ByteArraySegmentFormatter +static readonly MessagePack.Formatters.ByteFormatter.Instance -> MessagePack.Formatters.ByteFormatter +static readonly MessagePack.Formatters.CharArrayFormatter.Instance -> MessagePack.Formatters.CharArrayFormatter +static readonly MessagePack.Formatters.CharFormatter.Instance -> MessagePack.Formatters.CharFormatter +static readonly MessagePack.Formatters.ComplexFormatter.Instance -> MessagePack.Formatters.IMessagePackFormatter +static readonly MessagePack.Formatters.DateTimeArrayFormatter.Instance -> MessagePack.Formatters.DateTimeArrayFormatter +static readonly MessagePack.Formatters.DateTimeFormatter.Instance -> MessagePack.Formatters.DateTimeFormatter +static readonly MessagePack.Formatters.DateTimeOffsetFormatter.Instance -> MessagePack.Formatters.IMessagePackFormatter +static readonly MessagePack.Formatters.DecimalFormatter.Instance -> MessagePack.Formatters.DecimalFormatter +static readonly MessagePack.Formatters.DoubleArrayFormatter.Instance -> MessagePack.Formatters.DoubleArrayFormatter +static readonly MessagePack.Formatters.DoubleFormatter.Instance -> MessagePack.Formatters.DoubleFormatter +static readonly MessagePack.Formatters.DynamicObjectTypeFallbackFormatter.Instance -> MessagePack.Formatters.IMessagePackFormatter +static readonly MessagePack.Formatters.ForceByteBlockFormatter.Instance -> MessagePack.Formatters.ForceByteBlockFormatter +static readonly MessagePack.Formatters.ForceInt16BlockArrayFormatter.Instance -> MessagePack.Formatters.ForceInt16BlockArrayFormatter +static readonly MessagePack.Formatters.ForceInt16BlockFormatter.Instance -> MessagePack.Formatters.ForceInt16BlockFormatter +static readonly MessagePack.Formatters.ForceInt32BlockArrayFormatter.Instance -> MessagePack.Formatters.ForceInt32BlockArrayFormatter +static readonly MessagePack.Formatters.ForceInt32BlockFormatter.Instance -> MessagePack.Formatters.ForceInt32BlockFormatter +static readonly MessagePack.Formatters.ForceInt64BlockArrayFormatter.Instance -> MessagePack.Formatters.ForceInt64BlockArrayFormatter +static readonly MessagePack.Formatters.ForceInt64BlockFormatter.Instance -> MessagePack.Formatters.ForceInt64BlockFormatter +static readonly MessagePack.Formatters.ForceSByteBlockArrayFormatter.Instance -> MessagePack.Formatters.ForceSByteBlockArrayFormatter +static readonly MessagePack.Formatters.ForceSByteBlockFormatter.Instance -> MessagePack.Formatters.ForceSByteBlockFormatter +static readonly MessagePack.Formatters.ForceUInt16BlockArrayFormatter.Instance -> MessagePack.Formatters.ForceUInt16BlockArrayFormatter +static readonly MessagePack.Formatters.ForceUInt16BlockFormatter.Instance -> MessagePack.Formatters.ForceUInt16BlockFormatter +static readonly MessagePack.Formatters.ForceUInt32BlockArrayFormatter.Instance -> MessagePack.Formatters.ForceUInt32BlockArrayFormatter +static readonly MessagePack.Formatters.ForceUInt32BlockFormatter.Instance -> MessagePack.Formatters.ForceUInt32BlockFormatter +static readonly MessagePack.Formatters.ForceUInt64BlockArrayFormatter.Instance -> MessagePack.Formatters.ForceUInt64BlockArrayFormatter +static readonly MessagePack.Formatters.ForceUInt64BlockFormatter.Instance -> MessagePack.Formatters.ForceUInt64BlockFormatter +static readonly MessagePack.Formatters.GuidFormatter.Instance -> MessagePack.Formatters.IMessagePackFormatter +static readonly MessagePack.Formatters.Int16ArrayFormatter.Instance -> MessagePack.Formatters.Int16ArrayFormatter +static readonly MessagePack.Formatters.Int16Formatter.Instance -> MessagePack.Formatters.Int16Formatter +static readonly MessagePack.Formatters.Int32ArrayFormatter.Instance -> MessagePack.Formatters.Int32ArrayFormatter +static readonly MessagePack.Formatters.Int32Formatter.Instance -> MessagePack.Formatters.Int32Formatter +static readonly MessagePack.Formatters.Int64ArrayFormatter.Instance -> MessagePack.Formatters.Int64ArrayFormatter +static readonly MessagePack.Formatters.Int64Formatter.Instance -> MessagePack.Formatters.Int64Formatter +static readonly MessagePack.Formatters.NativeDateTimeArrayFormatter.Instance -> MessagePack.Formatters.NativeDateTimeArrayFormatter +static readonly MessagePack.Formatters.NativeDateTimeFormatter.Instance -> MessagePack.Formatters.NativeDateTimeFormatter +static readonly MessagePack.Formatters.NativeDecimalFormatter.Instance -> MessagePack.Formatters.IMessagePackFormatter +static readonly MessagePack.Formatters.NativeGuidFormatter.Instance -> MessagePack.Formatters.IMessagePackFormatter +static readonly MessagePack.Formatters.NilFormatter.Instance -> MessagePack.Formatters.IMessagePackFormatter +static readonly MessagePack.Formatters.NonGenericInterfaceDictionaryFormatter.Instance -> MessagePack.Formatters.IMessagePackFormatter +static readonly MessagePack.Formatters.NonGenericInterfaceListFormatter.Instance -> MessagePack.Formatters.IMessagePackFormatter +static readonly MessagePack.Formatters.NullableBooleanFormatter.Instance -> MessagePack.Formatters.NullableBooleanFormatter +static readonly MessagePack.Formatters.NullableByteFormatter.Instance -> MessagePack.Formatters.NullableByteFormatter +static readonly MessagePack.Formatters.NullableCharFormatter.Instance -> MessagePack.Formatters.NullableCharFormatter +static readonly MessagePack.Formatters.NullableDateTimeFormatter.Instance -> MessagePack.Formatters.NullableDateTimeFormatter +static readonly MessagePack.Formatters.NullableDoubleFormatter.Instance -> MessagePack.Formatters.NullableDoubleFormatter +static readonly MessagePack.Formatters.NullableForceByteBlockFormatter.Instance -> MessagePack.Formatters.NullableForceByteBlockFormatter +static readonly MessagePack.Formatters.NullableForceInt16BlockFormatter.Instance -> MessagePack.Formatters.NullableForceInt16BlockFormatter +static readonly MessagePack.Formatters.NullableForceInt32BlockFormatter.Instance -> MessagePack.Formatters.NullableForceInt32BlockFormatter +static readonly MessagePack.Formatters.NullableForceInt64BlockFormatter.Instance -> MessagePack.Formatters.NullableForceInt64BlockFormatter +static readonly MessagePack.Formatters.NullableForceSByteBlockFormatter.Instance -> MessagePack.Formatters.NullableForceSByteBlockFormatter +static readonly MessagePack.Formatters.NullableForceUInt16BlockFormatter.Instance -> MessagePack.Formatters.NullableForceUInt16BlockFormatter +static readonly MessagePack.Formatters.NullableForceUInt32BlockFormatter.Instance -> MessagePack.Formatters.NullableForceUInt32BlockFormatter +static readonly MessagePack.Formatters.NullableForceUInt64BlockFormatter.Instance -> MessagePack.Formatters.NullableForceUInt64BlockFormatter +static readonly MessagePack.Formatters.NullableInt16Formatter.Instance -> MessagePack.Formatters.NullableInt16Formatter +static readonly MessagePack.Formatters.NullableInt32Formatter.Instance -> MessagePack.Formatters.NullableInt32Formatter +static readonly MessagePack.Formatters.NullableInt64Formatter.Instance -> MessagePack.Formatters.NullableInt64Formatter +static readonly MessagePack.Formatters.NullableNilFormatter.Instance -> MessagePack.Formatters.IMessagePackFormatter +static readonly MessagePack.Formatters.NullableSByteFormatter.Instance -> MessagePack.Formatters.NullableSByteFormatter +static readonly MessagePack.Formatters.NullableSingleFormatter.Instance -> MessagePack.Formatters.NullableSingleFormatter +static readonly MessagePack.Formatters.NullableStringArrayFormatter.Instance -> MessagePack.Formatters.NullableStringArrayFormatter +static readonly MessagePack.Formatters.NullableStringFormatter.Instance -> MessagePack.Formatters.NullableStringFormatter +static readonly MessagePack.Formatters.NullableUInt16Formatter.Instance -> MessagePack.Formatters.NullableUInt16Formatter +static readonly MessagePack.Formatters.NullableUInt32Formatter.Instance -> MessagePack.Formatters.NullableUInt32Formatter +static readonly MessagePack.Formatters.NullableUInt64Formatter.Instance -> MessagePack.Formatters.NullableUInt64Formatter +static readonly MessagePack.Formatters.PrimitiveObjectFormatter.Instance -> MessagePack.Formatters.IMessagePackFormatter +static readonly MessagePack.Formatters.SByteArrayFormatter.Instance -> MessagePack.Formatters.SByteArrayFormatter +static readonly MessagePack.Formatters.SByteFormatter.Instance -> MessagePack.Formatters.SByteFormatter +static readonly MessagePack.Formatters.SingleArrayFormatter.Instance -> MessagePack.Formatters.SingleArrayFormatter +static readonly MessagePack.Formatters.SingleFormatter.Instance -> MessagePack.Formatters.SingleFormatter +static readonly MessagePack.Formatters.StringBuilderFormatter.Instance -> MessagePack.Formatters.IMessagePackFormatter +static readonly MessagePack.Formatters.TimeSpanFormatter.Instance -> MessagePack.Formatters.IMessagePackFormatter +static readonly MessagePack.Formatters.TypelessFormatter.Instance -> MessagePack.Formatters.IMessagePackFormatter +static readonly MessagePack.Formatters.UInt16ArrayFormatter.Instance -> MessagePack.Formatters.UInt16ArrayFormatter +static readonly MessagePack.Formatters.UInt16Formatter.Instance -> MessagePack.Formatters.UInt16Formatter +static readonly MessagePack.Formatters.UInt32ArrayFormatter.Instance -> MessagePack.Formatters.UInt32ArrayFormatter +static readonly MessagePack.Formatters.UInt32Formatter.Instance -> MessagePack.Formatters.UInt32Formatter +static readonly MessagePack.Formatters.UInt64ArrayFormatter.Instance -> MessagePack.Formatters.UInt64ArrayFormatter +static readonly MessagePack.Formatters.UInt64Formatter.Instance -> MessagePack.Formatters.UInt64Formatter +static readonly MessagePack.Formatters.UriFormatter.Instance -> MessagePack.Formatters.IMessagePackFormatter +static readonly MessagePack.Formatters.VersionFormatter.Instance -> MessagePack.Formatters.IMessagePackFormatter +static readonly MessagePack.Internal.AutomataKeyGen.GetKeyMethod -> System.Reflection.MethodInfo +static readonly MessagePack.Internal.RuntimeTypeHandleEqualityComparer.Default -> System.Collections.Generic.IEqualityComparer +static readonly MessagePack.Internal.UnsafeMemory.Is32Bit -> bool +static readonly MessagePack.Nil.Default -> MessagePack.Nil +static readonly MessagePack.Resolvers.AttributeFormatterResolver.Instance -> MessagePack.Resolvers.AttributeFormatterResolver +static readonly MessagePack.Resolvers.BuiltinResolver.Instance -> MessagePack.Resolvers.BuiltinResolver +static readonly MessagePack.Resolvers.ContractlessStandardResolver.Instance -> MessagePack.Resolvers.ContractlessStandardResolver +static readonly MessagePack.Resolvers.ContractlessStandardResolver.Options -> MessagePack.MessagePackSerializerOptions +static readonly MessagePack.Resolvers.ContractlessStandardResolverAllowPrivate.Instance -> MessagePack.Resolvers.ContractlessStandardResolverAllowPrivate +static readonly MessagePack.Resolvers.ContractlessStandardResolverAllowPrivate.Options -> MessagePack.MessagePackSerializerOptions +static readonly MessagePack.Resolvers.DynamicContractlessObjectResolver.Instance -> MessagePack.Resolvers.DynamicContractlessObjectResolver +static readonly MessagePack.Resolvers.DynamicContractlessObjectResolverAllowPrivate.Instance -> MessagePack.Resolvers.DynamicContractlessObjectResolverAllowPrivate +static readonly MessagePack.Resolvers.DynamicEnumAsStringResolver.Instance -> MessagePack.Resolvers.DynamicEnumAsStringResolver +static readonly MessagePack.Resolvers.DynamicEnumAsStringResolver.Options -> MessagePack.MessagePackSerializerOptions +static readonly MessagePack.Resolvers.DynamicEnumResolver.Instance -> MessagePack.Resolvers.DynamicEnumResolver +static readonly MessagePack.Resolvers.DynamicGenericResolver.Instance -> MessagePack.Resolvers.DynamicGenericResolver +static readonly MessagePack.Resolvers.DynamicObjectResolver.Instance -> MessagePack.Resolvers.DynamicObjectResolver +static readonly MessagePack.Resolvers.DynamicObjectResolver.Options -> MessagePack.MessagePackSerializerOptions +static readonly MessagePack.Resolvers.DynamicObjectResolverAllowPrivate.Instance -> MessagePack.Resolvers.DynamicObjectResolverAllowPrivate +static readonly MessagePack.Resolvers.DynamicUnionResolver.Instance -> MessagePack.Resolvers.DynamicUnionResolver +static readonly MessagePack.Resolvers.DynamicUnionResolver.Options -> MessagePack.MessagePackSerializerOptions +static readonly MessagePack.Resolvers.NativeDateTimeResolver.Instance -> MessagePack.Resolvers.NativeDateTimeResolver +static readonly MessagePack.Resolvers.NativeDateTimeResolver.Options -> MessagePack.MessagePackSerializerOptions +static readonly MessagePack.Resolvers.NativeDecimalResolver.Instance -> MessagePack.Resolvers.NativeDecimalResolver +static readonly MessagePack.Resolvers.NativeGuidResolver.Instance -> MessagePack.Resolvers.NativeGuidResolver +static readonly MessagePack.Resolvers.PrimitiveObjectResolver.Instance -> MessagePack.Resolvers.PrimitiveObjectResolver +static readonly MessagePack.Resolvers.PrimitiveObjectResolver.Options -> MessagePack.MessagePackSerializerOptions +static readonly MessagePack.Resolvers.StandardResolver.Instance -> MessagePack.Resolvers.StandardResolver +static readonly MessagePack.Resolvers.StandardResolver.Options -> MessagePack.MessagePackSerializerOptions +static readonly MessagePack.Resolvers.StandardResolverAllowPrivate.Instance -> MessagePack.Resolvers.StandardResolverAllowPrivate +static readonly MessagePack.Resolvers.StandardResolverAllowPrivate.Options -> MessagePack.MessagePackSerializerOptions +static readonly MessagePack.Resolvers.StaticCompositeResolver.Instance -> MessagePack.Resolvers.StaticCompositeResolver +static readonly MessagePack.Resolvers.TypelessContractlessStandardResolver.Instance -> MessagePack.Resolvers.TypelessContractlessStandardResolver +static readonly MessagePack.Resolvers.TypelessContractlessStandardResolver.Options -> MessagePack.MessagePackSerializerOptions +static readonly MessagePack.Resolvers.TypelessObjectResolver.Instance -> MessagePack.IFormatterResolver +virtual MessagePack.Formatters.CollectionFormatterBase.GetCount(TCollection sequence) -> int? +virtual MessagePack.MessagePackSerializerOptions.Clone() -> MessagePack.MessagePackSerializerOptions +virtual MessagePack.MessagePackSerializerOptions.LoadType(string typeName) -> System.Type +virtual MessagePack.MessagePackSerializerOptions.ThrowIfDeserializingTypeIsDisallowed(System.Type type) -> void +MessagePack.ExtensionHeader.Equals(MessagePack.ExtensionHeader other) -> bool +MessagePack.Formatters.InterfaceCollectionFormatter2 +MessagePack.Formatters.InterfaceCollectionFormatter2.InterfaceCollectionFormatter2() -> void +MessagePack.Formatters.InterfaceListFormatter2 +MessagePack.Formatters.InterfaceListFormatter2.InterfaceListFormatter2() -> void +MessagePack.MessagePackReader.Depth.get -> int +MessagePack.MessagePackReader.Depth.set -> void +MessagePack.MessagePackReader.ReadDateTime(MessagePack.ExtensionHeader header) -> System.DateTime +MessagePack.MessagePackReader.TryReadArrayHeader(out int count) -> bool +MessagePack.MessagePackReader.TryReadExtensionFormatHeader(out MessagePack.ExtensionHeader extensionHeader) -> bool +MessagePack.MessagePackReader.TryReadMapHeader(out int count) -> bool +MessagePack.MessagePackSecurity +MessagePack.MessagePackSecurity.DepthStep(ref MessagePack.MessagePackReader reader) -> void +MessagePack.MessagePackSecurity.GetEqualityComparer() -> System.Collections.IEqualityComparer +MessagePack.MessagePackSecurity.GetEqualityComparer() -> System.Collections.Generic.IEqualityComparer +MessagePack.MessagePackSecurity.HashCollisionResistant.get -> bool +MessagePack.MessagePackSecurity.MaximumObjectGraphDepth.get -> int +MessagePack.MessagePackSecurity.MessagePackSecurity(MessagePack.MessagePackSecurity copyFrom) -> void +MessagePack.MessagePackSecurity.WithHashCollisionResistant(bool hashCollisionResistant) -> MessagePack.MessagePackSecurity +MessagePack.MessagePackSecurity.WithMaximumObjectGraphDepth(int maximumObjectGraphDepth) -> MessagePack.MessagePackSecurity +MessagePack.MessagePackSerializerOptions.Security.get -> MessagePack.MessagePackSecurity +MessagePack.MessagePackSerializerOptions.WithSecurity(MessagePack.MessagePackSecurity security) -> MessagePack.MessagePackSerializerOptions +MessagePack.MessagePackStreamReader.DiscardBufferedData() -> void +MessagePack.MessagePackStreamReader.MessagePackStreamReader(System.IO.Stream stream, bool leaveOpen) -> void +MessagePack.MessagePackStreamReader.ReadArrayAsync(System.Threading.CancellationToken cancellationToken) -> System.Collections.Generic.IAsyncEnumerable> +MessagePack.MessagePackWriter.WriteBinHeader(int length) -> void +MessagePack.MessagePackWriter.WriteStringHeader(int byteCount) -> void +static readonly MessagePack.MessagePackSecurity.TrustedData -> MessagePack.MessagePackSecurity +static readonly MessagePack.MessagePackSecurity.UntrustedData -> MessagePack.MessagePackSecurity +virtual MessagePack.MessagePackSecurity.Clone() -> MessagePack.MessagePackSecurity +virtual MessagePack.MessagePackSecurity.GetHashCollisionResistantEqualityComparer() -> System.Collections.IEqualityComparer +virtual MessagePack.MessagePackSecurity.GetHashCollisionResistantEqualityComparer() -> System.Collections.Generic.IEqualityComparer +MessagePack.Formatters.ByteMemoryFormatter +MessagePack.Formatters.ByteMemoryFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> System.Memory +MessagePack.Formatters.ByteMemoryFormatter.Serialize(ref MessagePack.MessagePackWriter writer, System.Memory value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.ByteReadOnlyMemoryFormatter +MessagePack.Formatters.ByteReadOnlyMemoryFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> System.ReadOnlyMemory +MessagePack.Formatters.ByteReadOnlyMemoryFormatter.Serialize(ref MessagePack.MessagePackWriter writer, System.ReadOnlyMemory value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.ByteReadOnlySequenceFormatter +MessagePack.Formatters.ByteReadOnlySequenceFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> System.Buffers.ReadOnlySequence +MessagePack.Formatters.ByteReadOnlySequenceFormatter.Serialize(ref MessagePack.MessagePackWriter writer, System.Buffers.ReadOnlySequence value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.ExpandoObjectFormatter +MessagePack.Formatters.ExpandoObjectFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> System.Dynamic.ExpandoObject +MessagePack.Formatters.ExpandoObjectFormatter.Serialize(ref MessagePack.MessagePackWriter writer, System.Dynamic.ExpandoObject value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.ForceTypelessFormatter +MessagePack.Formatters.ForceTypelessFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> T +MessagePack.Formatters.ForceTypelessFormatter.ForceTypelessFormatter() -> void +MessagePack.Formatters.ForceTypelessFormatter.Serialize(ref MessagePack.MessagePackWriter writer, T value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.MemoryFormatter +MessagePack.Formatters.MemoryFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> System.Memory +MessagePack.Formatters.MemoryFormatter.MemoryFormatter() -> void +MessagePack.Formatters.MemoryFormatter.Serialize(ref MessagePack.MessagePackWriter writer, System.Memory value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.NonGenericInterfaceCollectionFormatter +MessagePack.Formatters.NonGenericInterfaceCollectionFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> System.Collections.ICollection +MessagePack.Formatters.NonGenericInterfaceCollectionFormatter.Serialize(ref MessagePack.MessagePackWriter writer, System.Collections.ICollection value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.NonGenericInterfaceEnumerableFormatter +MessagePack.Formatters.NonGenericInterfaceEnumerableFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> System.Collections.IEnumerable +MessagePack.Formatters.NonGenericInterfaceEnumerableFormatter.Serialize(ref MessagePack.MessagePackWriter writer, System.Collections.IEnumerable value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.PrimitiveObjectFormatter.PrimitiveObjectFormatter() -> void +MessagePack.Formatters.ReadOnlyMemoryFormatter +MessagePack.Formatters.ReadOnlyMemoryFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> System.ReadOnlyMemory +MessagePack.Formatters.ReadOnlyMemoryFormatter.ReadOnlyMemoryFormatter() -> void +MessagePack.Formatters.ReadOnlyMemoryFormatter.Serialize(ref MessagePack.MessagePackWriter writer, System.ReadOnlyMemory value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.ReadOnlySequenceFormatter +MessagePack.Formatters.ReadOnlySequenceFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> System.Buffers.ReadOnlySequence +MessagePack.Formatters.ReadOnlySequenceFormatter.ReadOnlySequenceFormatter() -> void +MessagePack.Formatters.ReadOnlySequenceFormatter.Serialize(ref MessagePack.MessagePackWriter writer, System.Buffers.ReadOnlySequence value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.TypeFormatter +MessagePack.Formatters.TypeFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> T +MessagePack.Formatters.TypeFormatter.Serialize(ref MessagePack.MessagePackWriter writer, T value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.TypelessFormatter.TypelessFormatter() -> void +MessagePack.ImmutableCollection.ImmutableArrayFormatter +MessagePack.ImmutableCollection.ImmutableArrayFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> System.Collections.Immutable.ImmutableArray +MessagePack.ImmutableCollection.ImmutableArrayFormatter.ImmutableArrayFormatter() -> void +MessagePack.ImmutableCollection.ImmutableArrayFormatter.Serialize(ref MessagePack.MessagePackWriter writer, System.Collections.Immutable.ImmutableArray value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.ImmutableCollection.ImmutableCollectionResolver +MessagePack.ImmutableCollection.ImmutableCollectionResolver.GetFormatter() -> MessagePack.Formatters.IMessagePackFormatter +MessagePack.ImmutableCollection.ImmutableDictionaryFormatter +MessagePack.ImmutableCollection.ImmutableDictionaryFormatter.ImmutableDictionaryFormatter() -> void +MessagePack.ImmutableCollection.ImmutableHashSetFormatter +MessagePack.ImmutableCollection.ImmutableHashSetFormatter.ImmutableHashSetFormatter() -> void +MessagePack.ImmutableCollection.ImmutableListFormatter +MessagePack.ImmutableCollection.ImmutableListFormatter.ImmutableListFormatter() -> void +MessagePack.ImmutableCollection.ImmutableQueueBuilder +MessagePack.ImmutableCollection.ImmutableQueueBuilder.Add(T value) -> void +MessagePack.ImmutableCollection.ImmutableQueueBuilder.ImmutableQueueBuilder() -> void +MessagePack.ImmutableCollection.ImmutableQueueBuilder.Q.get -> System.Collections.Immutable.ImmutableQueue +MessagePack.ImmutableCollection.ImmutableQueueBuilder.Q.set -> void +MessagePack.ImmutableCollection.ImmutableQueueFormatter +MessagePack.ImmutableCollection.ImmutableQueueFormatter.ImmutableQueueFormatter() -> void +MessagePack.ImmutableCollection.ImmutableSortedDictionaryFormatter +MessagePack.ImmutableCollection.ImmutableSortedDictionaryFormatter.ImmutableSortedDictionaryFormatter() -> void +MessagePack.ImmutableCollection.ImmutableSortedSetFormatter +MessagePack.ImmutableCollection.ImmutableSortedSetFormatter.ImmutableSortedSetFormatter() -> void +MessagePack.ImmutableCollection.ImmutableStackFormatter +MessagePack.ImmutableCollection.ImmutableStackFormatter.ImmutableStackFormatter() -> void +MessagePack.ImmutableCollection.InterfaceImmutableDictionaryFormatter +MessagePack.ImmutableCollection.InterfaceImmutableDictionaryFormatter.InterfaceImmutableDictionaryFormatter() -> void +MessagePack.ImmutableCollection.InterfaceImmutableListFormatter +MessagePack.ImmutableCollection.InterfaceImmutableListFormatter.InterfaceImmutableListFormatter() -> void +MessagePack.ImmutableCollection.InterfaceImmutableQueueFormatter +MessagePack.ImmutableCollection.InterfaceImmutableQueueFormatter.InterfaceImmutableQueueFormatter() -> void +MessagePack.ImmutableCollection.InterfaceImmutableSetFormatter +MessagePack.ImmutableCollection.InterfaceImmutableSetFormatter.InterfaceImmutableSetFormatter() -> void +MessagePack.ImmutableCollection.InterfaceImmutableStackFormatter +MessagePack.ImmutableCollection.InterfaceImmutableStackFormatter.InterfaceImmutableStackFormatter() -> void +MessagePack.Resolvers.ExpandoObjectResolver +override MessagePack.ImmutableCollection.ImmutableDictionaryFormatter.Add(System.Collections.Immutable.ImmutableDictionary.Builder collection, int index, TKey key, TValue value, MessagePack.MessagePackSerializerOptions options) -> void +override MessagePack.ImmutableCollection.ImmutableDictionaryFormatter.Complete(System.Collections.Immutable.ImmutableDictionary.Builder intermediateCollection) -> System.Collections.Immutable.ImmutableDictionary +override MessagePack.ImmutableCollection.ImmutableDictionaryFormatter.Create(int count, MessagePack.MessagePackSerializerOptions options) -> System.Collections.Immutable.ImmutableDictionary.Builder +override MessagePack.ImmutableCollection.ImmutableDictionaryFormatter.GetSourceEnumerator(System.Collections.Immutable.ImmutableDictionary source) -> System.Collections.Immutable.ImmutableDictionary.Enumerator +override MessagePack.ImmutableCollection.ImmutableHashSetFormatter.Add(System.Collections.Immutable.ImmutableHashSet.Builder collection, int index, T value, MessagePack.MessagePackSerializerOptions options) -> void +override MessagePack.ImmutableCollection.ImmutableHashSetFormatter.Complete(System.Collections.Immutable.ImmutableHashSet.Builder intermediateCollection) -> System.Collections.Immutable.ImmutableHashSet +override MessagePack.ImmutableCollection.ImmutableHashSetFormatter.Create(int count, MessagePack.MessagePackSerializerOptions options) -> System.Collections.Immutable.ImmutableHashSet.Builder +override MessagePack.ImmutableCollection.ImmutableHashSetFormatter.GetSourceEnumerator(System.Collections.Immutable.ImmutableHashSet source) -> System.Collections.Immutable.ImmutableHashSet.Enumerator +override MessagePack.ImmutableCollection.ImmutableListFormatter.Add(System.Collections.Immutable.ImmutableList.Builder collection, int index, T value, MessagePack.MessagePackSerializerOptions options) -> void +override MessagePack.ImmutableCollection.ImmutableListFormatter.Complete(System.Collections.Immutable.ImmutableList.Builder intermediateCollection) -> System.Collections.Immutable.ImmutableList +override MessagePack.ImmutableCollection.ImmutableListFormatter.Create(int count, MessagePack.MessagePackSerializerOptions options) -> System.Collections.Immutable.ImmutableList.Builder +override MessagePack.ImmutableCollection.ImmutableListFormatter.GetSourceEnumerator(System.Collections.Immutable.ImmutableList source) -> System.Collections.Immutable.ImmutableList.Enumerator +override MessagePack.ImmutableCollection.ImmutableQueueFormatter.Add(MessagePack.ImmutableCollection.ImmutableQueueBuilder collection, int index, T value, MessagePack.MessagePackSerializerOptions options) -> void +override MessagePack.ImmutableCollection.ImmutableQueueFormatter.Complete(MessagePack.ImmutableCollection.ImmutableQueueBuilder intermediateCollection) -> System.Collections.Immutable.ImmutableQueue +override MessagePack.ImmutableCollection.ImmutableQueueFormatter.Create(int count, MessagePack.MessagePackSerializerOptions options) -> MessagePack.ImmutableCollection.ImmutableQueueBuilder +override MessagePack.ImmutableCollection.ImmutableSortedDictionaryFormatter.Add(System.Collections.Immutable.ImmutableSortedDictionary.Builder collection, int index, TKey key, TValue value, MessagePack.MessagePackSerializerOptions options) -> void +override MessagePack.ImmutableCollection.ImmutableSortedDictionaryFormatter.Complete(System.Collections.Immutable.ImmutableSortedDictionary.Builder intermediateCollection) -> System.Collections.Immutable.ImmutableSortedDictionary +override MessagePack.ImmutableCollection.ImmutableSortedDictionaryFormatter.Create(int count, MessagePack.MessagePackSerializerOptions options) -> System.Collections.Immutable.ImmutableSortedDictionary.Builder +override MessagePack.ImmutableCollection.ImmutableSortedDictionaryFormatter.GetSourceEnumerator(System.Collections.Immutable.ImmutableSortedDictionary source) -> System.Collections.Immutable.ImmutableSortedDictionary.Enumerator +override MessagePack.ImmutableCollection.ImmutableSortedSetFormatter.Add(System.Collections.Immutable.ImmutableSortedSet.Builder collection, int index, T value, MessagePack.MessagePackSerializerOptions options) -> void +override MessagePack.ImmutableCollection.ImmutableSortedSetFormatter.Complete(System.Collections.Immutable.ImmutableSortedSet.Builder intermediateCollection) -> System.Collections.Immutable.ImmutableSortedSet +override MessagePack.ImmutableCollection.ImmutableSortedSetFormatter.Create(int count, MessagePack.MessagePackSerializerOptions options) -> System.Collections.Immutable.ImmutableSortedSet.Builder +override MessagePack.ImmutableCollection.ImmutableSortedSetFormatter.GetSourceEnumerator(System.Collections.Immutable.ImmutableSortedSet source) -> System.Collections.Immutable.ImmutableSortedSet.Enumerator +override MessagePack.ImmutableCollection.ImmutableStackFormatter.Add(T[] collection, int index, T value, MessagePack.MessagePackSerializerOptions options) -> void +override MessagePack.ImmutableCollection.ImmutableStackFormatter.Complete(T[] intermediateCollection) -> System.Collections.Immutable.ImmutableStack +override MessagePack.ImmutableCollection.ImmutableStackFormatter.Create(int count, MessagePack.MessagePackSerializerOptions options) -> T[] +override MessagePack.ImmutableCollection.InterfaceImmutableDictionaryFormatter.Add(System.Collections.Immutable.ImmutableDictionary.Builder collection, int index, TKey key, TValue value, MessagePack.MessagePackSerializerOptions options) -> void +override MessagePack.ImmutableCollection.InterfaceImmutableDictionaryFormatter.Complete(System.Collections.Immutable.ImmutableDictionary.Builder intermediateCollection) -> System.Collections.Immutable.IImmutableDictionary +override MessagePack.ImmutableCollection.InterfaceImmutableDictionaryFormatter.Create(int count, MessagePack.MessagePackSerializerOptions options) -> System.Collections.Immutable.ImmutableDictionary.Builder +override MessagePack.ImmutableCollection.InterfaceImmutableListFormatter.Add(System.Collections.Immutable.ImmutableList.Builder collection, int index, T value, MessagePack.MessagePackSerializerOptions options) -> void +override MessagePack.ImmutableCollection.InterfaceImmutableListFormatter.Complete(System.Collections.Immutable.ImmutableList.Builder intermediateCollection) -> System.Collections.Immutable.IImmutableList +override MessagePack.ImmutableCollection.InterfaceImmutableListFormatter.Create(int count, MessagePack.MessagePackSerializerOptions options) -> System.Collections.Immutable.ImmutableList.Builder +override MessagePack.ImmutableCollection.InterfaceImmutableQueueFormatter.Add(MessagePack.ImmutableCollection.ImmutableQueueBuilder collection, int index, T value, MessagePack.MessagePackSerializerOptions options) -> void +override MessagePack.ImmutableCollection.InterfaceImmutableQueueFormatter.Complete(MessagePack.ImmutableCollection.ImmutableQueueBuilder intermediateCollection) -> System.Collections.Immutable.IImmutableQueue +override MessagePack.ImmutableCollection.InterfaceImmutableQueueFormatter.Create(int count, MessagePack.MessagePackSerializerOptions options) -> MessagePack.ImmutableCollection.ImmutableQueueBuilder +override MessagePack.ImmutableCollection.InterfaceImmutableSetFormatter.Add(System.Collections.Immutable.ImmutableHashSet.Builder collection, int index, T value, MessagePack.MessagePackSerializerOptions options) -> void +override MessagePack.ImmutableCollection.InterfaceImmutableSetFormatter.Complete(System.Collections.Immutable.ImmutableHashSet.Builder intermediateCollection) -> System.Collections.Immutable.IImmutableSet +override MessagePack.ImmutableCollection.InterfaceImmutableSetFormatter.Create(int count, MessagePack.MessagePackSerializerOptions options) -> System.Collections.Immutable.ImmutableHashSet.Builder +override MessagePack.ImmutableCollection.InterfaceImmutableStackFormatter.Add(T[] collection, int index, T value, MessagePack.MessagePackSerializerOptions options) -> void +override MessagePack.ImmutableCollection.InterfaceImmutableStackFormatter.Complete(T[] intermediateCollection) -> System.Collections.Immutable.IImmutableStack +override MessagePack.ImmutableCollection.InterfaceImmutableStackFormatter.Create(int count, MessagePack.MessagePackSerializerOptions options) -> T[] +static readonly MessagePack.Formatters.ByteMemoryFormatter.Instance -> MessagePack.Formatters.ByteMemoryFormatter +static readonly MessagePack.Formatters.ByteReadOnlyMemoryFormatter.Instance -> MessagePack.Formatters.ByteReadOnlyMemoryFormatter +static readonly MessagePack.Formatters.ByteReadOnlySequenceFormatter.Instance -> MessagePack.Formatters.ByteReadOnlySequenceFormatter +static readonly MessagePack.Formatters.ExpandoObjectFormatter.Instance -> MessagePack.Formatters.IMessagePackFormatter +static readonly MessagePack.Formatters.NonGenericInterfaceCollectionFormatter.Instance -> MessagePack.Formatters.IMessagePackFormatter +static readonly MessagePack.Formatters.NonGenericInterfaceEnumerableFormatter.Instance -> MessagePack.Formatters.IMessagePackFormatter +static readonly MessagePack.Formatters.TypeFormatter.Instance -> MessagePack.Formatters.IMessagePackFormatter +static readonly MessagePack.ImmutableCollection.ImmutableCollectionResolver.Instance -> MessagePack.ImmutableCollection.ImmutableCollectionResolver +static readonly MessagePack.Resolvers.ExpandoObjectResolver.Instance -> MessagePack.IFormatterResolver +static readonly MessagePack.Resolvers.ExpandoObjectResolver.Options -> MessagePack.MessagePackSerializerOptions +virtual MessagePack.Formatters.PrimitiveObjectFormatter.DeserializeMap(ref MessagePack.MessagePackReader reader, int length, MessagePack.MessagePackSerializerOptions options) -> object +MessagePack.ExtensionHeader.ExtensionHeader() -> void +MessagePack.ExtensionResult.ExtensionResult() -> void +MessagePack.FormatterNotRegisteredException.FormatterNotRegisteredException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) -> void +MessagePack.MessagePackReader.MessagePackReader() -> void +MessagePack.MessagePackSerializerOptions.SequencePool.get -> MessagePack.SequencePool +MessagePack.MessagePackSerializerOptions.WithPool(MessagePack.SequencePool pool) -> MessagePack.MessagePackSerializerOptions +MessagePack.MessagePackStreamReader.MessagePackStreamReader(System.IO.Stream stream, bool leaveOpen, MessagePack.SequencePool sequencePool) -> void +MessagePack.MessagePackStreamReader.ReadArrayHeaderAsync(System.Threading.CancellationToken cancellationToken) -> System.Threading.Tasks.ValueTask +MessagePack.MessagePackStreamReader.ReadMapHeaderAsync(System.Threading.CancellationToken cancellationToken) -> System.Threading.Tasks.ValueTask +MessagePack.MessagePackWriter.MessagePackWriter() -> void +MessagePack.SequencePool +MessagePack.SequencePool.SequencePool() -> void +MessagePack.SequencePool.SequencePool(int maxSize) -> void +MessagePack.SequencePool.SequencePool(int maxSize, System.Buffers.ArrayPool arrayPool) -> void +MessagePack.TinyJsonException.TinyJsonException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) -> void +static MessagePack.Nil.operator !=(MessagePack.Nil left, MessagePack.Nil right) -> bool +static MessagePack.Nil.operator ==(MessagePack.Nil left, MessagePack.Nil right) -> bool +virtual MessagePack.MessagePackStreamReader.Dispose(bool disposing) -> void +MessagePack.Formatters.GenericEnumerableFormatter +MessagePack.Formatters.GenericEnumerableFormatter.GenericEnumerableFormatter() -> void +MessagePack.Formatters.GenericReadOnlyDictionaryFormatter +MessagePack.Formatters.GenericReadOnlyDictionaryFormatter.GenericReadOnlyDictionaryFormatter() -> void diff --git a/src/MessagePack/netstandard2.0/PublicAPI.Unshipped.txt b/src/MessagePack/netstandard2.0/PublicAPI.Unshipped.txt new file mode 100644 index 000000000..2cdd3d32f --- /dev/null +++ b/src/MessagePack/netstandard2.0/PublicAPI.Unshipped.txt @@ -0,0 +1,8 @@ +MessagePack.Formatters.StringInterningFormatter +MessagePack.Formatters.StringInterningFormatter.Deserialize(ref MessagePack.MessagePackReader reader, MessagePack.MessagePackSerializerOptions options) -> string +MessagePack.Formatters.StringInterningFormatter.Serialize(ref MessagePack.MessagePackWriter writer, string value, MessagePack.MessagePackSerializerOptions options) -> void +MessagePack.Formatters.StringInterningFormatter.StringInterningFormatter() -> void +MessagePack.MessagePackSerializerOptions.CompressionMinLength.get -> int +MessagePack.MessagePackSerializerOptions.SuggestedContiguousMemorySize.get -> int +MessagePack.MessagePackSerializerOptions.WithCompressionMinLength(int compressionMinLength) -> MessagePack.MessagePackSerializerOptions +MessagePack.MessagePackSerializerOptions.WithSuggestedContiguousMemorySize(int suggestedContiguousMemorySize) -> MessagePack.MessagePackSerializerOptions \ No newline at end of file diff --git a/src/MessagePackAnalyzer.Vsix/MessagePackAnalyzer.Vsix.csproj b/src/MessagePackAnalyzer.Vsix/MessagePackAnalyzer.Vsix.csproj deleted file mode 100644 index a6b8cc67e..000000000 --- a/src/MessagePackAnalyzer.Vsix/MessagePackAnalyzer.Vsix.csproj +++ /dev/null @@ -1,91 +0,0 @@ - - - - - 15.0 - $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) - publish\ - true - Disk - false - Foreground - 7 - Days - false - false - true - 0 - 1.0.0.%2a - false - false - true - - - - Debug - AnyCPU - AnyCPU - 2.0 - {82b43b9b-a64c-4715-b499-d71e9ca2bd60};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - {09B87BEB-D9A3-4EEB-B56A-ED53D27DF1A3} - Library - Properties - MessagePackAnalyzer.Vsix - MessagePackAnalyzer.Vsix - MessagePackAnalyzer.vsix - v4.7.2 - false - false - false - false - false - false - Roslyn - $(BaseOutputPath)$(Configuration)\ - win - false - - - true - full - false - DEBUG;TRACE - prompt - 4 - - - pdbonly - true - TRACE - prompt - 4 - - - Program - $(DevEnvDir)devenv.exe - /rootsuffix Roslyn - - - - Designer - - - - - False - .NET Framework 3.5 SP1 - false - - - - - {2F9A6E0C-DE95-4460-96B7-EB72BBEAEE9E} - MessagePackAnalyzer - BuiltProjectOutputGroup%3bBuiltProjectOutputGroupDependencies%3bGetCopyToOutputDirectoryItems%3bSatelliteDllsProjectOutputGroup%3b - DebugSymbolsProjectOutputGroup%3b - - - - - - diff --git a/src/MessagePackAnalyzer.Vsix/source.extension.vsixmanifest b/src/MessagePackAnalyzer.Vsix/source.extension.vsixmanifest deleted file mode 100644 index 9b6caf57f..000000000 --- a/src/MessagePackAnalyzer.Vsix/source.extension.vsixmanifest +++ /dev/null @@ -1,19 +0,0 @@ - - - - - MessagePackAnalyzer - MessagePack AnalyzerMessagePack Analyzer - - - - - - - - - - - - - diff --git a/src/MessagePackAnalyzer/MessagePackAnalyzer.cs b/src/MessagePackAnalyzer/MessagePackAnalyzer.cs index bfb0b21e5..7fd3f7926 100644 --- a/src/MessagePackAnalyzer/MessagePackAnalyzer.cs +++ b/src/MessagePackAnalyzer/MessagePackAnalyzer.cs @@ -16,6 +16,7 @@ public class MessagePackAnalyzer : DiagnosticAnalyzer public const string UseMessagePackObjectAttributeId = "MsgPack003"; public const string AttributeMessagePackObjectMembersId = "MsgPack004"; public const string InvalidMessagePackObjectId = "MsgPack005"; + public const string MessagePackFormatterMustBeMessagePackFormatterId = "MsgPack006"; internal const string Category = "Usage"; @@ -35,6 +36,16 @@ public class MessagePackAnalyzer : DiagnosticAnalyzer isEnabledByDefault: true, helpLinkUri: AnalyzerUtilities.GetHelpLink(UseMessagePackObjectAttributeId)); + internal static readonly DiagnosticDescriptor MessageFormatterMustBeMessagePackFormatter = new DiagnosticDescriptor( + id: MessagePackFormatterMustBeMessagePackFormatterId, + title: "Must be IMessageFormatter", + category: Category, + messageFormat: "Type must be of IMessagePackFormatter. {0}.", // type.Name + description: "Type must be of IMessagePackFormatter.", + defaultSeverity: DiagnosticSeverity.Error, + isEnabledByDefault: true, + helpLinkUri: AnalyzerUtilities.GetHelpLink(UseMessagePackObjectAttributeId)); + internal static readonly DiagnosticDescriptor PublicMemberNeedsKey = new DiagnosticDescriptor( id: AttributeMessagePackObjectMembersId, title: "Attribute public members of MessagePack objects", @@ -58,7 +69,8 @@ public class MessagePackAnalyzer : DiagnosticAnalyzer public override ImmutableArray SupportedDiagnostics { get; } = ImmutableArray.Create( TypeMustBeMessagePackObject, PublicMemberNeedsKey, - InvalidMessagePackObject); + InvalidMessagePackObject, + MessageFormatterMustBeMessagePackFormatter); public override void Initialize(AnalysisContext context) { diff --git a/src/MessagePackAnalyzer/MessagePackAnalyzer.csproj b/src/MessagePackAnalyzer/MessagePackAnalyzer.csproj index 51952963a..5a5a18f88 100644 --- a/src/MessagePackAnalyzer/MessagePackAnalyzer.csproj +++ b/src/MessagePackAnalyzer/MessagePackAnalyzer.csproj @@ -11,6 +11,7 @@ $(TargetsForTfmSpecificContentInPackage);PackBuildOutputs true false + true diff --git a/src/MessagePackAnalyzer/ReferenceSymbols.cs b/src/MessagePackAnalyzer/ReferenceSymbols.cs index 354599ad8..36787e73c 100644 --- a/src/MessagePackAnalyzer/ReferenceSymbols.cs +++ b/src/MessagePackAnalyzer/ReferenceSymbols.cs @@ -13,12 +13,16 @@ private ReferenceSymbols( INamedTypeSymbol unionAttribute, INamedTypeSymbol keyAttribute, INamedTypeSymbol ignoreAttribute, + INamedTypeSymbol formatterAttribute, + INamedTypeSymbol messagePackFormatter, INamedTypeSymbol ignoreDataMemberAttribute) { this.MessagePackObjectAttribute = messagePackObjectAttribute; this.UnionAttribute = unionAttribute; this.KeyAttribute = keyAttribute; this.IgnoreAttribute = ignoreAttribute; + this.FormatterAttribute = formatterAttribute; + this.MessagePackFormatter = messagePackFormatter; this.IgnoreDataMemberAttribute = ignoreDataMemberAttribute; } @@ -30,6 +34,10 @@ private ReferenceSymbols( internal INamedTypeSymbol IgnoreAttribute { get; } + internal INamedTypeSymbol FormatterAttribute { get; } + + internal INamedTypeSymbol MessagePackFormatter { get; } + internal INamedTypeSymbol IgnoreDataMemberAttribute { get; } public static bool TryCreate(Compilation compilation, [NotNullWhen(true)] out ReferenceSymbols? instance) @@ -60,6 +68,18 @@ public static bool TryCreate(Compilation compilation, [NotNullWhen(true)] out Re return false; } + var formatterAttribute = compilation.GetTypeByMetadataName("MessagePack.MessagePackFormatterAttribute"); + if (formatterAttribute is null) + { + return false; + } + + var messageFormatter = compilation.GetTypeByMetadataName("MessagePack.Formatters.IMessagePackFormatter"); + if (messageFormatter is null) + { + return false; + } + var ignoreDataMemberAttribute = compilation.GetTypeByMetadataName("System.Runtime.Serialization.IgnoreDataMemberAttribute"); if (ignoreDataMemberAttribute is null) { @@ -71,6 +91,8 @@ public static bool TryCreate(Compilation compilation, [NotNullWhen(true)] out Re unionAttribute, keyAttribute, ignoreAttribute, + formatterAttribute, + messageFormatter, ignoreDataMemberAttribute); return true; } diff --git a/src/MessagePackAnalyzer/TypeCollector.cs b/src/MessagePackAnalyzer/TypeCollector.cs index 55c481a94..a2ece5781 100644 --- a/src/MessagePackAnalyzer/TypeCollector.cs +++ b/src/MessagePackAnalyzer/TypeCollector.cs @@ -183,6 +183,22 @@ private void CollectObject(INamedTypeSymbol type, ISymbol? callerSymbol) { var isClass = !type.IsValueType; + AttributeData formatterAttr = type.GetAttributes().FirstOrDefault(x => Equals(x.AttributeClass, this.typeReferences.FormatterAttribute)); + if (formatterAttr != null) + { + // Validate that the typed formatter is actually of `IMessagePackFormatter` + var formatterType = (ITypeSymbol)formatterAttr.ConstructorArguments[0].Value; + var isMessagePackFormatter = formatterType.AllInterfaces.Any(x => x.Equals(this.typeReferences.MessagePackFormatter)); + if (!isMessagePackFormatter) + { + var location = formatterAttr.ApplicationSyntaxReference.SyntaxTree.GetLocation(formatterAttr.ApplicationSyntaxReference.Span); + var typeInfo = ImmutableDictionary.Create().Add("type", formatterType.ToDisplayString(SymbolDisplayFormat.FullyQualifiedFormat)); + this.ReportContext.Add(Diagnostic.Create(MessagePackAnalyzer.MessageFormatterMustBeMessagePackFormatter, location, typeInfo)); + } + + return; + } + AttributeData contractAttr = type.GetAttributes().FirstOrDefault(x => Equals(x.AttributeClass, this.typeReferences.MessagePackObjectAttribute)); if (contractAttr == null) { diff --git a/tests/MessagePack.AspNetCoreMvcFormatter.Tests/AspNetCoreMvcFormatterTest.cs b/tests/MessagePack.AspNetCoreMvcFormatter.Tests/AspNetCoreMvcFormatterTest.cs index 55726235e..96b54b315 100644 --- a/tests/MessagePack.AspNetCoreMvcFormatter.Tests/AspNetCoreMvcFormatterTest.cs +++ b/tests/MessagePack.AspNetCoreMvcFormatter.Tests/AspNetCoreMvcFormatterTest.cs @@ -181,6 +181,20 @@ public void LZ4MessagePackFormatterCanNotRead() inputFormatter.CanRead(inputFormatterContext).IsFalse(); } + [Fact] + public void MessagePackOutputFormatterSupportsXMsgPack() + { + var outputFormatter = new MessagePackOutputFormatter(); + outputFormatter.SupportedMediaTypes.Is(MsgPackContentType); + } + + [Fact] + public void MessagePackInputFormatterSupportsXMsgPack() + { + var inputFormatter = new MessagePackInputFormatter(); + inputFormatter.SupportedMediaTypes.Is(MsgPackContentType); + } + /// /// JsonOutputFormatterTests.cs#L453. /// diff --git a/tests/MessagePack.AspNetCoreMvcFormatter.Tests/MessagePack.AspNetCoreMvcFormatter.Tests.csproj b/tests/MessagePack.AspNetCoreMvcFormatter.Tests/MessagePack.AspNetCoreMvcFormatter.Tests.csproj index 975fc82a1..0a9041bd2 100644 --- a/tests/MessagePack.AspNetCoreMvcFormatter.Tests/MessagePack.AspNetCoreMvcFormatter.Tests.csproj +++ b/tests/MessagePack.AspNetCoreMvcFormatter.Tests/MessagePack.AspNetCoreMvcFormatter.Tests.csproj @@ -1,14 +1,13 @@  - netcoreapp2.1 + netcoreapp3.1 false ..\MessagePack.Tests\MessagePack.Tests.ruleset - diff --git a/tests/MessagePack.GeneratedCode.Tests/MessagePack.GeneratedCode.Tests.csproj b/tests/MessagePack.GeneratedCode.Tests/MessagePack.GeneratedCode.Tests.csproj new file mode 100644 index 000000000..0844ff4e4 --- /dev/null +++ b/tests/MessagePack.GeneratedCode.Tests/MessagePack.GeneratedCode.Tests.csproj @@ -0,0 +1,21 @@ + + + + netcoreapp3.1 + + false + + + + + + + + + + + + + + + diff --git a/tests/MessagePack.GeneratedCode.Tests/MissingPropertiesTest.cs b/tests/MessagePack.GeneratedCode.Tests/MissingPropertiesTest.cs new file mode 100644 index 000000000..0db93add3 --- /dev/null +++ b/tests/MessagePack.GeneratedCode.Tests/MissingPropertiesTest.cs @@ -0,0 +1,105 @@ +// Copyright (c) All contributors. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +using MessagePack.Resolvers; +using Nerdbank.Streams; +using SharedData; +using Xunit; + +namespace MessagePack.GeneratedCode.Tests +{ + public class MissingPropertiesTest + { + private readonly MessagePackSerializerOptions options; + + public MissingPropertiesTest() + { + var resolver = CompositeResolver.Create(GeneratedResolver.Instance, StandardResolver.Instance); + options = MessagePackSerializerOptions.Standard.WithResolver(resolver); + } + + [Fact] + public void DefaultValueStringKeyClassWithoutExplicitConstructorTest() + { + var seq = new Sequence(); + var writer = new MessagePackWriter(seq); + writer.WriteMapHeader(0); + writer.Flush(); + + var instance = MessagePackSerializer.Deserialize(seq, options); + Assert.Equal(DefaultValueStringKeyClassWithoutExplicitConstructor.Prop1Constant, instance.Prop1); + Assert.Equal(DefaultValueStringKeyClassWithoutExplicitConstructor.Prop2Constant, instance.Prop2); + } + + [Fact] + public void DefaultValueStringKeyClassWithExplicitConstructorTest() + { + var seq = new Sequence(); + var writer = new MessagePackWriter(seq); + writer.WriteMapHeader(1); + writer.Write(nameof(DefaultValueStringKeyClassWithExplicitConstructor.Prop1)); + writer.Write(-1); + writer.Flush(); + + var instance = MessagePackSerializer.Deserialize(seq, options); + Assert.Equal(-1, instance.Prop1); + Assert.Equal(DefaultValueStringKeyClassWithExplicitConstructor.Prop2Constant, instance.Prop2); + } + + [Fact] + public void DefaultValueStringKeyStructWithExplicitConstructorTest() + { + var seq = new Sequence(); + var writer = new MessagePackWriter(seq); + writer.WriteMapHeader(1); + writer.Write(nameof(DefaultValueStringKeyStructWithExplicitConstructor.Prop1)); + writer.Write(-1); + writer.Flush(); + + var instance = MessagePackSerializer.Deserialize(seq, options); + Assert.Equal(-1, instance.Prop1); + Assert.Equal(DefaultValueStringKeyStructWithExplicitConstructor.Prop2Constant, instance.Prop2); + } + + [Fact] + public void DefaultValueIntKeyClassWithoutExplicitConstructorTest() + { + var seq = new Sequence(); + var writer = new MessagePackWriter(seq); + writer.WriteArrayHeader(0); + writer.Flush(); + + var instance = MessagePackSerializer.Deserialize(seq, options); + Assert.Equal(DefaultValueIntKeyClassWithoutExplicitConstructor.Prop1Constant, instance.Prop1); + Assert.Equal(DefaultValueIntKeyClassWithoutExplicitConstructor.Prop2Constant, instance.Prop2); + } + + [Fact] + public void DefaultValueIntKeyClassWithExplicitConstructorTest() + { + var seq = new Sequence(); + var writer = new MessagePackWriter(seq); + writer.WriteArrayHeader(1); + writer.Write(-1); + writer.Flush(); + + var instance = MessagePackSerializer.Deserialize(seq, options); + Assert.Equal(-1, instance.Prop1); + Assert.Equal(DefaultValueIntKeyClassWithExplicitConstructor.Prop2Constant, instance.Prop2); + } + + [Fact] + public void DefaultValueIntKeyStructWithExplicitConstructorTest() + { + var seq = new Sequence(); + var writer = new MessagePackWriter(seq); + writer.WriteArrayHeader(1); + writer.Write(-1); + writer.Flush(); + + var instance = MessagePackSerializer.Deserialize(seq, options); + Assert.Equal(-1, instance.Prop1); + Assert.Equal(DefaultValueIntKeyStructWithExplicitConstructor.Prop2Constant, instance.Prop2); + } + } +} diff --git a/tests/MessagePack.Generator.Tests/GenerateEnumFormatterTest.cs b/tests/MessagePack.Generator.Tests/GenerateEnumFormatterTest.cs index ac735c3e3..2ad23fcbe 100644 --- a/tests/MessagePack.Generator.Tests/GenerateEnumFormatterTest.cs +++ b/tests/MessagePack.Generator.Tests/GenerateEnumFormatterTest.cs @@ -43,7 +43,7 @@ public enum MyEnum } } "; - tempWorkarea.AddFileToProject("MyMessagePackObject.cs", contents); + tempWorkarea.AddFileToTargetProject("MyMessagePackObject.cs", contents); var compiler = new MessagePackCompiler.CodeGenerator(testOutputHelper.WriteLine, CancellationToken.None); await compiler.GenerateFileAsync( diff --git a/tests/MessagePack.Generator.Tests/GenerateGenericsFormatterTest.cs b/tests/MessagePack.Generator.Tests/GenerateGenericsFormatterTest.cs index 05040322a..675817fcc 100644 --- a/tests/MessagePack.Generator.Tests/GenerateGenericsFormatterTest.cs +++ b/tests/MessagePack.Generator.Tests/GenerateGenericsFormatterTest.cs @@ -53,7 +53,7 @@ public enum MyEnum } } "; - tempWorkarea.AddFileToProject("MyMessagePackObject.cs", contents); + tempWorkarea.AddFileToTargetProject("MyMessagePackObject.cs", contents); var compiler = new MessagePackCompiler.CodeGenerator(testOutputHelper.WriteLine, CancellationToken.None); await compiler.GenerateFileAsync( @@ -100,7 +100,7 @@ public class MyObject } } "; - tempWorkarea.AddFileToProject("MyMessagePackObject.cs", contents); + tempWorkarea.AddFileToTargetProject("MyMessagePackObject.cs", contents); var compiler = new MessagePackCompiler.CodeGenerator(testOutputHelper.WriteLine, CancellationToken.None); await compiler.GenerateFileAsync( @@ -148,7 +148,7 @@ public class Wrapper } } "; - tempWorkarea.AddFileToProject("MyMessagePackObject.cs", contents); + tempWorkarea.AddFileToTargetProject("MyMessagePackObject.cs", contents); var compiler = new MessagePackCompiler.CodeGenerator(testOutputHelper.WriteLine, CancellationToken.None); await compiler.GenerateFileAsync( @@ -213,7 +213,7 @@ public class MyInnerGenericObject } } "; - tempWorkarea.AddFileToProject("MyMessagePackObject.cs", contents); + tempWorkarea.AddFileToTargetProject("MyMessagePackObject.cs", contents); var compiler = new MessagePackCompiler.CodeGenerator(testOutputHelper.WriteLine, CancellationToken.None); await compiler.GenerateFileAsync( @@ -297,7 +297,7 @@ public class MyInnerGenericObject } } "; - tempWorkarea.AddFileToProject("MyMessagePackObject.cs", contents); + tempWorkarea.AddFileToTargetProject("MyMessagePackObject.cs", contents); var compiler = new MessagePackCompiler.CodeGenerator(testOutputHelper.WriteLine, CancellationToken.None); await compiler.GenerateFileAsync( @@ -365,7 +365,7 @@ public class MyGenericObject } } "; - tempWorkarea.AddFileToProject("MyMessagePackObject.cs", contents); + tempWorkarea.AddFileToTargetProject("MyMessagePackObject.cs", contents); var compiler = new MessagePackCompiler.CodeGenerator(testOutputHelper.WriteLine, CancellationToken.None); await compiler.GenerateFileAsync( @@ -434,7 +434,7 @@ public class MyObjectNested } } "; - tempWorkarea.AddFileToProject("MyMessagePackObject.cs", contents); + tempWorkarea.AddFileToTargetProject("MyMessagePackObject.cs", contents); var compiler = new MessagePackCompiler.CodeGenerator(testOutputHelper.WriteLine, CancellationToken.None); await compiler.GenerateFileAsync( @@ -503,7 +503,7 @@ public class MyObjectNested } } "; - tempWorkarea.AddFileToProject("MyMessagePackObject.cs", contents); + tempWorkarea.AddFileToTargetProject("MyMessagePackObject.cs", contents); var compiler = new MessagePackCompiler.CodeGenerator(testOutputHelper.WriteLine, CancellationToken.None); await compiler.GenerateFileAsync( @@ -558,7 +558,7 @@ public class MyGenericObject } } "; - tempWorkarea.AddFileToProject("MyMessagePackObject.cs", contents); + tempWorkarea.AddFileToTargetProject("MyMessagePackObject.cs", contents); var compiler = new MessagePackCompiler.CodeGenerator(testOutputHelper.WriteLine, CancellationToken.None); await compiler.GenerateFileAsync( @@ -607,7 +607,7 @@ public class MyGenericObject } } "; - tempWorkarea.AddFileToProject("MyMessagePackObject.cs", contents); + tempWorkarea.AddFileToTargetProject("MyMessagePackObject.cs", contents); var compiler = new MessagePackCompiler.CodeGenerator(testOutputHelper.WriteLine, CancellationToken.None); await compiler.GenerateFileAsync( @@ -664,7 +664,7 @@ public class MyGenericClass {} public interface IMyInterface {} } "; - tempWorkarea.AddFileToProject("MyMessagePackObject.cs", contents); + tempWorkarea.AddFileToTargetProject("MyMessagePackObject.cs", contents); var compiler = new MessagePackCompiler.CodeGenerator(testOutputHelper.WriteLine, CancellationToken.None); await compiler.GenerateFileAsync( @@ -722,7 +722,7 @@ public class MyGenericObject } } "; - tempWorkarea.AddFileToProject("MyMessagePackObject.cs", contents); + tempWorkarea.AddFileToTargetProject("MyMessagePackObject.cs", contents); var compiler = new MessagePackCompiler.CodeGenerator(testOutputHelper.WriteLine, CancellationToken.None); await compiler.GenerateFileAsync( @@ -781,7 +781,7 @@ public class MyGenericObject } } "; - tempWorkarea.AddFileToProject("MyMessagePackObject.cs", contents); + tempWorkarea.AddFileToTargetProject("MyMessagePackObject.cs", contents); var compiler = new MessagePackCompiler.CodeGenerator(testOutputHelper.WriteLine, CancellationToken.None); await compiler.GenerateFileAsync( @@ -855,7 +855,7 @@ public class MyGenericObject } } "; - tempWorkarea.AddFileToProject("MyMessagePackObject.cs", contents); + tempWorkarea.AddFileToTargetProject("MyMessagePackObject.cs", contents); var compiler = new MessagePackCompiler.CodeGenerator(testOutputHelper.WriteLine, CancellationToken.None); await compiler.GenerateFileAsync( @@ -883,5 +883,82 @@ await compiler.GenerateFileAsync( formatterType.TypeParameters[1].ConstraintTypes.Should().BeEmpty(); formatterType.TypeParameters[1].ReferenceTypeConstraintNullableAnnotation.Should().Be(NullableAnnotation.None); } + + [Theory] + [InlineData(true)] + [InlineData(false)] + public async Task Generics_Defined_In_ReferencedProject(bool isSingleFileOutput) + { + using var tempWorkarea = TemporaryProjectWorkarea.Create(); + var defineContents = @" +using System; +using System.Collections.Generic; +using MessagePack; + +namespace TempProject +{ + [MessagePackObject] + public class MyGenericObject + { + [Key(0)] + public T Content { get; set; } + } +} + "; + tempWorkarea.AddFileToReferencedProject("MyGenericObject.cs", defineContents); + + var usageContents = @" +using System; +using System.Collections.Generic; +using MessagePack; + +namespace TempProject +{ + [MessagePackObject] + public class MyObject + { + [Key(0)] + public MyGenericObject Value { get; set; } + } + + [MessagePackObject] + public class MyObjectNested + { + [Key(0)] + public MyGenericObject> Value { get; set; } + } +} + "; + tempWorkarea.AddFileToTargetProject("MyObject.cs", usageContents); + + var compiler = new MessagePackCompiler.CodeGenerator(testOutputHelper.WriteLine, CancellationToken.None); + await compiler.GenerateFileAsync( + tempWorkarea.GetOutputCompilation().Compilation, + isSingleFileOutput ? Path.Combine(tempWorkarea.OutputDirectory, "Generated.cs") : tempWorkarea.OutputDirectory, + "TempProjectResolver", + "TempProject.Generated", + false, + string.Empty, + Array.Empty()); + + var compilation = tempWorkarea.GetOutputCompilation(); + compilation.Compilation.GetDiagnostics().Where(x => x.WarningLevel == 0).Should().BeEmpty(); + + var symbols = compilation.GetNamedTypeSymbolsFromGenerated(); + + var types = symbols.Select(x => x.ToDisplayString()).ToArray(); + types.Should().Contain("TempProject.Generated.Formatters.TempProject.MyGenericObjectFormatter"); + + var formatters = symbols.SelectMany(x => x.Interfaces).Select(x => x.ToDisplayString()).ToArray(); + formatters.Should().Contain("MessagePack.Formatters.IMessagePackFormatter>"); + + compilation.GetResolverKnownFormatterTypes().Should().Contain(new[] + { + "TempProject.Generated.Formatters.TempProject.MyGenericObjectFormatter>", + "TempProject.Generated.Formatters.TempProject.MyGenericObjectFormatter", + "TempProject.Generated.Formatters.TempProject.MyObjectFormatter", + "TempProject.Generated.Formatters.TempProject.MyObjectNestedFormatter", + }); + } } } diff --git a/tests/MessagePack.Generator.Tests/GenerateKeyedFormatterTest.cs b/tests/MessagePack.Generator.Tests/GenerateKeyedFormatterTest.cs new file mode 100644 index 000000000..502093263 --- /dev/null +++ b/tests/MessagePack.Generator.Tests/GenerateKeyedFormatterTest.cs @@ -0,0 +1,164 @@ +// Copyright (c) All contributors. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +using System; +using System.Buffers; +using System.Threading; +using System.Threading.Tasks; +using FluentAssertions; +using MessagePack.Resolvers; +using Microsoft.CodeAnalysis; +using Nerdbank.Streams; +using Xunit; +using Xunit.Abstractions; + +namespace MessagePack.Generator.Tests +{ + public class GenerateKeyedFormatterTest + { + private readonly ITestOutputHelper testOutputHelper; + + public GenerateKeyedFormatterTest(ITestOutputHelper testOutputHelper) + { + this.testOutputHelper = testOutputHelper; + } + + [Fact] + public async Task PropertiesGetterSetter() + { + using var tempWorkarea = TemporaryProjectWorkarea.Create(); + var contents = @" +using System; +using System.Collections.Generic; +using MessagePack; + +namespace TempProject +{ + [MessagePackObject(false)] + public class MyMessagePackObject + { + [Key(0)] + public int A { get; set; } + [Key(1)] + public string B { get; set; } + } +} + "; + tempWorkarea.AddFileToTargetProject("MyMessagePackObject.cs", contents); + + var compiler = new MessagePackCompiler.CodeGenerator(testOutputHelper.WriteLine, CancellationToken.None); + await compiler.GenerateFileAsync( + tempWorkarea.GetOutputCompilation().Compilation, + tempWorkarea.OutputDirectory, + "TempProjectResolver", + "TempProject.Generated", + false, + string.Empty, + Array.Empty()); + + var compilation = tempWorkarea.GetOutputCompilation(); + compilation.Compilation.GetDiagnostics().Should().NotContain(x => x.Severity == DiagnosticSeverity.Error); + + // Run tests with the generated resolver/formatter assembly. + compilation.ExecuteWithGeneratedAssembly((ctx, assembly) => + { + var mpoType = assembly.GetType("TempProject.MyMessagePackObject"); + var options = MessagePackSerializerOptions.Standard + .WithResolver(CompositeResolver.Create( + StandardResolver.Instance, + TestUtilities.GetResolverInstance(assembly, "TempProject.Generated.Resolvers.TempProjectResolver"))); + + // Build `[]` + var seq = new Sequence(); + var writer = new MessagePackWriter(seq); + writer.WriteArrayHeader(0); + writer.Flush(); + + dynamic result = MessagePackSerializer.Deserialize(mpoType, seq, options); + + // The deserialized object has default values. + ((int)result.A).Should().Be(0); + ((string)result.B).Should().BeNull(); + + // Verify round trip serialization/deserialization. + result.A = 123; + result.B = "foobar"; + + var serialized = MessagePackSerializer.Serialize(mpoType, (object)result, options); + dynamic result2 = MessagePackSerializer.Deserialize(mpoType, serialized, options); + ((int)result2.A).Should().Be(123); + ((string)result2.B).Should().Be("foobar"); + }); + } + + [Fact] + public async Task PropertiesGetterOnlyWithParameterizedConstructor() + { + using var tempWorkarea = TemporaryProjectWorkarea.Create(); + var contents = @" +using System; +using System.Collections.Generic; +using MessagePack; + +namespace TempProject +{ + [MessagePackObject(false)] + public class MyMessagePackObject + { + [Key(0)] + public int A { get; } + [Key(1)] + public string B { get; } + + public MyMessagePackObject(int a, string b) + { + A = a; + B = b; + } + } +} + "; + tempWorkarea.AddFileToTargetProject("MyMessagePackObject.cs", contents); + + var compiler = new MessagePackCompiler.CodeGenerator(testOutputHelper.WriteLine, CancellationToken.None); + await compiler.GenerateFileAsync( + tempWorkarea.GetOutputCompilation().Compilation, + tempWorkarea.OutputDirectory, + "TempProjectResolver", + "TempProject.Generated", + false, + string.Empty, + Array.Empty()); + + var compilation = tempWorkarea.GetOutputCompilation(); + compilation.Compilation.GetDiagnostics().Should().NotContain(x => x.Severity == DiagnosticSeverity.Error); + + // Run tests with the generated resolver/formatter assembly. + compilation.ExecuteWithGeneratedAssembly((ctx, assembly) => + { + var mpoType = assembly.GetType("TempProject.MyMessagePackObject"); + var options = MessagePackSerializerOptions.Standard + .WithResolver(CompositeResolver.Create( + StandardResolver.Instance, + TestUtilities.GetResolverInstance(assembly, "TempProject.Generated.Resolvers.TempProjectResolver"))); + + // Build `[-1, "foobar"]` + var seq = new Sequence(); + var writer = new MessagePackWriter(seq); + writer.WriteArrayHeader(2); + writer.Write(-1); + writer.Write("foobar"); + writer.Flush(); + + // Verify deserialization + dynamic result = MessagePackSerializer.Deserialize(mpoType, seq, options); + ((int)result.A).Should().Be(-1); + ((string)result.B).Should().Be("foobar"); + + // Verify serialization + var serialized = MessagePackSerializer.Serialize(mpoType, (object)result, options); + serialized.Should().BeEquivalentTo(seq.AsReadOnlySequence.ToArray()); + }); + } + } +} diff --git a/tests/MessagePack.Generator.Tests/GenerateMessagePackFormatterAttrTest.cs b/tests/MessagePack.Generator.Tests/GenerateMessagePackFormatterAttrTest.cs index 44a778f1a..38e08f67b 100644 --- a/tests/MessagePack.Generator.Tests/GenerateMessagePackFormatterAttrTest.cs +++ b/tests/MessagePack.Generator.Tests/GenerateMessagePackFormatterAttrTest.cs @@ -56,7 +56,7 @@ public class Bar } } "; - tempWorkarea.AddFileToProject("MyMessagePackObject.cs", contents); + tempWorkarea.AddFileToTargetProject("MyMessagePackObject.cs", contents); var compiler = new MessagePackCompiler.CodeGenerator(testOutputHelper.WriteLine, CancellationToken.None); diff --git a/tests/MessagePack.Generator.Tests/GenerateStringKeyedFormatterTest.cs b/tests/MessagePack.Generator.Tests/GenerateStringKeyedFormatterTest.cs new file mode 100644 index 000000000..1719fb5fa --- /dev/null +++ b/tests/MessagePack.Generator.Tests/GenerateStringKeyedFormatterTest.cs @@ -0,0 +1,867 @@ +// Copyright (c) All contributors. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +using System; +using System.Buffers; +using System.IO; +using System.Linq; +using System.Runtime.Loader; +using System.Threading; +using System.Threading.Tasks; +using FluentAssertions; +using MessagePack.Resolvers; +using Microsoft.CodeAnalysis; +using Nerdbank.Streams; +using Xunit; +using Xunit.Abstractions; + +namespace MessagePack.Generator.Tests +{ + public class GenerateStringKeyedFormatterTest + { + private readonly ITestOutputHelper testOutputHelper; + + public GenerateStringKeyedFormatterTest(ITestOutputHelper testOutputHelper) + { + this.testOutputHelper = testOutputHelper; + } + + [Fact] + public async Task PropertiesGetterSetter() + { + using var tempWorkarea = TemporaryProjectWorkarea.Create(); + var contents = @" +using System; +using System.Collections.Generic; +using MessagePack; + +namespace TempProject +{ + [MessagePackObject(true)] + public class MyMessagePackObject + { + public int A { get; set; } + public string B { get; set; } + } +} + "; + tempWorkarea.AddFileToTargetProject("MyMessagePackObject.cs", contents); + + var compiler = new MessagePackCompiler.CodeGenerator(testOutputHelper.WriteLine, CancellationToken.None); + await compiler.GenerateFileAsync( + tempWorkarea.GetOutputCompilation().Compilation, + tempWorkarea.OutputDirectory, + "TempProjectResolver", + "TempProject.Generated", + false, + string.Empty, + Array.Empty()); + + var compilation = tempWorkarea.GetOutputCompilation(); + compilation.Compilation.GetDiagnostics().Should().NotContain(x => x.Severity == DiagnosticSeverity.Error); + + // Run tests with the generated resolver/formatter assembly. + compilation.ExecuteWithGeneratedAssembly((ctx, assembly) => + { + var mpoType = assembly.GetType("TempProject.MyMessagePackObject"); + var options = MessagePackSerializerOptions.Standard + .WithResolver(CompositeResolver.Create( + StandardResolver.Instance, + TestUtilities.GetResolverInstance(assembly, "TempProject.Generated.Resolvers.TempProjectResolver"))); + + // Build `{ }`. + var seq = new Sequence(); + var writer = new MessagePackWriter(seq); + writer.WriteMapHeader(0); + writer.Flush(); + + // Verify deserialization + dynamic result = MessagePackSerializer.Deserialize(mpoType, seq, options); + ((int)result.A).Should().Be(0); + ((string)result.B).Should().BeNull(); + + // Verify round trip serialization/deserialization. + result.A = 123; + result.B = "foobar"; + + var serialized = MessagePackSerializer.Serialize(mpoType, (object)result, options); + dynamic result2 = MessagePackSerializer.Deserialize(mpoType, serialized, options); + ((int)result2.A).Should().Be(123); + ((string)result2.B).Should().Be("foobar"); + }); + } + + [Fact] + public async Task PropertiesGetterOnlyMixed() + { + using var tempWorkarea = TemporaryProjectWorkarea.Create(); + var contents = @" +using System; +using System.Collections.Generic; +using MessagePack; + +namespace TempProject +{ + [MessagePackObject(true)] + public class MyMessagePackObject + { + public int A { get; } + public string B { get; set; } + } +} + "; + tempWorkarea.AddFileToTargetProject("MyMessagePackObject.cs", contents); + + var compiler = new MessagePackCompiler.CodeGenerator(testOutputHelper.WriteLine, CancellationToken.None); + await compiler.GenerateFileAsync( + tempWorkarea.GetOutputCompilation().Compilation, + tempWorkarea.OutputDirectory, + "TempProjectResolver", + "TempProject.Generated", + false, + string.Empty, + Array.Empty()); + + var compilation = tempWorkarea.GetOutputCompilation(); + compilation.Compilation.GetDiagnostics().Should().NotContain(x => x.Severity == DiagnosticSeverity.Error); + + // Run tests with the generated resolver/formatter assembly. + compilation.ExecuteWithGeneratedAssembly((ctx, assembly) => + { + var mpoType = assembly.GetType("TempProject.MyMessagePackObject"); + var options = MessagePackSerializerOptions.Standard + .WithResolver(CompositeResolver.Create( + StandardResolver.Instance, + TestUtilities.GetResolverInstance(assembly, "TempProject.Generated.Resolvers.TempProjectResolver"))); + + // Build `{ "A": -1, "B": "foobar" }`. + var seq = new Sequence(); + var writer = new MessagePackWriter(seq); + writer.WriteMapHeader(2); + writer.Write("A"); + writer.Write(-1); + writer.Write("B"); + writer.Write("foobar"); + writer.Flush(); + + // Verify deserialization + dynamic result = MessagePackSerializer.Deserialize(mpoType, seq, options); + ((int)result.A).Should().Be(0); // default + ((string)result.B).Should().Be("foobar"); // from input + }); + } + + [Fact] + public async Task PropertiesGetterOnlyIgnore() + { + using var tempWorkarea = TemporaryProjectWorkarea.Create(); + var contents = @" +using System; +using System.Collections.Generic; +using MessagePack; + +namespace TempProject +{ + [MessagePackObject(true)] + public class MyMessagePackObject + { + public int A { get; } + public string B { get; } + } +} + "; + tempWorkarea.AddFileToTargetProject("MyMessagePackObject.cs", contents); + + var compiler = new MessagePackCompiler.CodeGenerator(testOutputHelper.WriteLine, CancellationToken.None); + await compiler.GenerateFileAsync( + tempWorkarea.GetOutputCompilation().Compilation, + tempWorkarea.OutputDirectory, + "TempProjectResolver", + "TempProject.Generated", + false, + string.Empty, + Array.Empty()); + + var compilation = tempWorkarea.GetOutputCompilation(); + compilation.Compilation.GetDiagnostics().Should().NotContain(x => x.Severity == DiagnosticSeverity.Error); + + // Run tests with the generated resolver/formatter assembly. + compilation.ExecuteWithGeneratedAssembly((ctx, assembly) => + { + var mpoType = assembly.GetType("TempProject.MyMessagePackObject"); + var options = MessagePackSerializerOptions.Standard + .WithResolver(CompositeResolver.Create( + StandardResolver.Instance, + TestUtilities.GetResolverInstance(assembly, "TempProject.Generated.Resolvers.TempProjectResolver"))); + + // Build `{ "A": -1, "B": "foobar" }`. + var seq = new Sequence(); + var writer = new MessagePackWriter(seq); + writer.WriteMapHeader(2); + writer.Write("A"); + writer.Write(-1); + writer.Write("B"); + writer.Write("foobar"); + writer.Flush(); + + // Verify deserialization + dynamic result = MessagePackSerializer.Deserialize(mpoType, seq, options); + ((int)result.A).Should().Be(0); + ((string)result.B).Should().BeNull(); + }); + } + + [Fact] + public async Task PropertiesGetterOnlyDefaultValue() + { + using var tempWorkarea = TemporaryProjectWorkarea.Create(); + var contents = @" +using System; +using System.Collections.Generic; +using MessagePack; + +namespace TempProject +{ + [MessagePackObject(true)] + public class MyMessagePackObject + { + public int A { get; } = 123; + public string B { get; } = ""foobar""; + } +} + "; + tempWorkarea.AddFileToTargetProject("MyMessagePackObject.cs", contents); + + var compiler = new MessagePackCompiler.CodeGenerator(testOutputHelper.WriteLine, CancellationToken.None); + await compiler.GenerateFileAsync( + tempWorkarea.GetOutputCompilation().Compilation, + tempWorkarea.OutputDirectory, + "TempProjectResolver", + "TempProject.Generated", + false, + string.Empty, + Array.Empty()); + + var compilation = tempWorkarea.GetOutputCompilation(); + compilation.Compilation.GetDiagnostics().Should().NotContain(x => x.Severity == DiagnosticSeverity.Error); + + // Run tests with the generated resolver/formatter assembly. + compilation.ExecuteWithGeneratedAssembly((ctx, assembly) => + { + var mpoType = assembly.GetType("TempProject.MyMessagePackObject"); + var options = MessagePackSerializerOptions.Standard + .WithResolver(CompositeResolver.Create( + StandardResolver.Instance, + TestUtilities.GetResolverInstance(assembly, "TempProject.Generated.Resolvers.TempProjectResolver"))); + + // Build `{ }`. + var seq = new Sequence(); + var writer = new MessagePackWriter(seq); + writer.WriteMapHeader(0); + writer.Flush(); + + // Verify deserialization + // The deserialized object has default values. + dynamic result = MessagePackSerializer.Deserialize(mpoType, seq, options); + ((int)result.A).Should().Be(123); + ((string)result.B).Should().Be("foobar"); + }); + } + + [Fact] + public async Task PropertiesGetterSetterWithDefaultValue() + { + using var tempWorkarea = TemporaryProjectWorkarea.Create(); + var contents = @" +using System; +using System.Collections.Generic; +using MessagePack; + +namespace TempProject +{ + [MessagePackObject(true)] + public class MyMessagePackObject + { + public int A { get; set; } = 123; + public string B { get; set; } = ""foobar""; + } +} + "; + tempWorkarea.AddFileToTargetProject("MyMessagePackObject.cs", contents); + + var compiler = new MessagePackCompiler.CodeGenerator(testOutputHelper.WriteLine, CancellationToken.None); + await compiler.GenerateFileAsync( + tempWorkarea.GetOutputCompilation().Compilation, + tempWorkarea.OutputDirectory, + "TempProjectResolver", + "TempProject.Generated", + false, + string.Empty, + Array.Empty()); + + var compilation = tempWorkarea.GetOutputCompilation(); + compilation.Compilation.GetDiagnostics().Should().NotContain(x => x.Severity == DiagnosticSeverity.Error); + + // Run tests with the generated resolver/formatter assembly. + compilation.ExecuteWithGeneratedAssembly((ctx, assembly) => + { + var mpoType = assembly.GetType("TempProject.MyMessagePackObject"); + var options = MessagePackSerializerOptions.Standard + .WithResolver(CompositeResolver.Create( + StandardResolver.Instance, + TestUtilities.GetResolverInstance(assembly, "TempProject.Generated.Resolvers.TempProjectResolver"))); + + // Build an empty data. + var seq = new Sequence(); + var writer = new MessagePackWriter(seq); + writer.WriteMapHeader(0); + writer.Flush(); + + // Verify deserialization + // The deserialized object has default values. + dynamic result = MessagePackSerializer.Deserialize(mpoType, seq, options); + ((int)result.A).Should().Be(123); + ((string)result.B).Should().Be("foobar"); + + // Verify round trip serialization/deserialization. + result.A = 456; + result.B = "baz"; + + var serialized = MessagePackSerializer.Serialize(mpoType, (object)result, options); + dynamic result2 = MessagePackSerializer.Deserialize(mpoType, serialized, options); + ((int)result2.A).Should().Be(456); + ((string)result2.B).Should().Be("baz"); + }); + } + + [Fact] + public async Task PropertiesGetterSetterWithDefaultValueInputPartially() + { + using var tempWorkarea = TemporaryProjectWorkarea.Create(); + var contents = @" +using System; +using System.Collections.Generic; +using MessagePack; + +namespace TempProject +{ + [MessagePackObject(true)] + public class MyMessagePackObject + { + public int A { get; set; } = 123; + public string B { get; set; } = ""foobar""; + } +} + "; + tempWorkarea.AddFileToTargetProject("MyMessagePackObject.cs", contents); + + var compiler = new MessagePackCompiler.CodeGenerator(testOutputHelper.WriteLine, CancellationToken.None); + await compiler.GenerateFileAsync( + tempWorkarea.GetOutputCompilation().Compilation, + tempWorkarea.OutputDirectory, + "TempProjectResolver", + "TempProject.Generated", + false, + string.Empty, + Array.Empty()); + + var compilation = tempWorkarea.GetOutputCompilation(); + compilation.Compilation.GetDiagnostics().Should().NotContain(x => x.Severity == DiagnosticSeverity.Error); + + // Run tests with the generated resolver/formatter assembly. + compilation.ExecuteWithGeneratedAssembly((ctx, assembly) => + { + var mpoType = assembly.GetType("TempProject.MyMessagePackObject"); + var options = MessagePackSerializerOptions.Standard + .WithResolver(CompositeResolver.Create( + StandardResolver.Instance, + TestUtilities.GetResolverInstance(assembly, "TempProject.Generated.Resolvers.TempProjectResolver"))); + + // Build `{ "A": -1 }` + var seq = new Sequence(); + var writer = new MessagePackWriter(seq); + writer.WriteMapHeader(1); + writer.Write("A"); + writer.Write(-1); + writer.Flush(); + + // Verify deserialization + // The deserialized object has default value and should preserve it. + dynamic result = MessagePackSerializer.Deserialize(mpoType, seq, options); + ((int)result.A).Should().Be(-1); // from input + ((string)result.B).Should().Be("foobar"); // default value + + // Verify round trip serialization/deserialization. + result.A = 456; + result.B = "baz"; + + var serialized = MessagePackSerializer.Serialize(mpoType, (object)result, options); + dynamic result2 = MessagePackSerializer.Deserialize(mpoType, serialized, options); + ((int)result2.A).Should().Be(456); + ((string)result2.B).Should().Be("baz"); + }); + } + + [Fact] + public async Task PropertiesGetterOnlyWithParameterizedConstructor() + { + using var tempWorkarea = TemporaryProjectWorkarea.Create(); + var contents = @" +using System; +using System.Collections.Generic; +using MessagePack; + +namespace TempProject +{ + [MessagePackObject(true)] + public class MyMessagePackObject + { + public int A { get; } + public string B { get; } + + public MyMessagePackObject(int a, string b) + { + A = a; + B = b; + } + } +} + "; + tempWorkarea.AddFileToTargetProject("MyMessagePackObject.cs", contents); + + var compiler = new MessagePackCompiler.CodeGenerator(testOutputHelper.WriteLine, CancellationToken.None); + await compiler.GenerateFileAsync( + tempWorkarea.GetOutputCompilation().Compilation, + tempWorkarea.OutputDirectory, + "TempProjectResolver", + "TempProject.Generated", + false, + string.Empty, + Array.Empty()); + + var compilation = tempWorkarea.GetOutputCompilation(); + compilation.Compilation.GetDiagnostics().Should().NotContain(x => x.Severity == DiagnosticSeverity.Error); + + // Run tests with the generated resolver/formatter assembly. + compilation.ExecuteWithGeneratedAssembly((ctx, assembly) => + { + var mpoType = assembly.GetType("TempProject.MyMessagePackObject"); + var options = MessagePackSerializerOptions.Standard + .WithResolver(CompositeResolver.Create( + StandardResolver.Instance, + TestUtilities.GetResolverInstance(assembly, "TempProject.Generated.Resolvers.TempProjectResolver"))); + + // Build `{ "A": -1, "B": "foobar" }` + var seq = new Sequence(); + var writer = new MessagePackWriter(seq); + writer.WriteMapHeader(2); + writer.Write("A"); + writer.Write(-1); + writer.Write("B"); + writer.Write("foobar"); + writer.Flush(); + + // Verify deserialization + dynamic result = MessagePackSerializer.Deserialize(mpoType, seq, options); + ((int)result.A).Should().Be(-1); // from input + ((string)result.B).Should().Be("foobar"); // from input + + // Verify serialization + var serialized = MessagePackSerializer.Serialize(mpoType, (object)result, options); + serialized.Should().BeEquivalentTo(seq.AsReadOnlySequence.ToArray()); + }); + } + + [Fact] + public async Task PropertiesGetterOnlyWithParameterizedConstructorPartially() + { + using var tempWorkarea = TemporaryProjectWorkarea.Create(); + var contents = @" +using System; +using System.Collections.Generic; +using MessagePack; + +namespace TempProject +{ + [MessagePackObject(true)] + public class MyMessagePackObject + { + public int A { get; } + public string B { get; } + + public MyMessagePackObject(string b) + { + B = b; + } + } +} + "; + tempWorkarea.AddFileToTargetProject("MyMessagePackObject.cs", contents); + + var compiler = new MessagePackCompiler.CodeGenerator(testOutputHelper.WriteLine, CancellationToken.None); + await compiler.GenerateFileAsync( + tempWorkarea.GetOutputCompilation().Compilation, + tempWorkarea.OutputDirectory, + "TempProjectResolver", + "TempProject.Generated", + false, + string.Empty, + Array.Empty()); + + var compilation = tempWorkarea.GetOutputCompilation(); + compilation.Compilation.GetDiagnostics().Should().NotContain(x => x.Severity == DiagnosticSeverity.Error); + + // Run tests with the generated resolver/formatter assembly. + compilation.ExecuteWithGeneratedAssembly((ctx, assembly) => + { + var mpoType = assembly.GetType("TempProject.MyMessagePackObject"); + var options = MessagePackSerializerOptions.Standard + .WithResolver(CompositeResolver.Create( + StandardResolver.Instance, + TestUtilities.GetResolverInstance(assembly, "TempProject.Generated.Resolvers.TempProjectResolver"))); + + // Build `{ "A": -1, "B": "foobar" }` + var seq = new Sequence(); + var writer = new MessagePackWriter(seq); + writer.WriteMapHeader(2); + writer.Write("A"); + writer.Write(-1); + writer.Write("B"); + writer.Write("foobar"); + writer.Flush(); + + // Verify deserialization + dynamic result = MessagePackSerializer.Deserialize(mpoType, seq, options); + ((int)result.A).Should().Be(0); // default value + ((string)result.B).Should().Be("foobar"); // from input + }); + } + + [Fact] + public async Task PropertiesGetterOnlyWithParameterizedConstructorDefaultValue() + { + using var tempWorkarea = TemporaryProjectWorkarea.Create(); + var contents = @" +using System; +using System.Collections.Generic; +using MessagePack; + +namespace TempProject +{ + [MessagePackObject(true)] + public class MyMessagePackObject + { + public int A { get; } = 12345; + public string B { get; } = ""some""; + + public MyMessagePackObject(string b) + { + B = b; + } + } +} + "; + tempWorkarea.AddFileToTargetProject("MyMessagePackObject.cs", contents); + + var compiler = new MessagePackCompiler.CodeGenerator(testOutputHelper.WriteLine, CancellationToken.None); + await compiler.GenerateFileAsync( + tempWorkarea.GetOutputCompilation().Compilation, + tempWorkarea.OutputDirectory, + "TempProjectResolver", + "TempProject.Generated", + false, + string.Empty, + Array.Empty()); + + var compilation = tempWorkarea.GetOutputCompilation(); + compilation.Compilation.GetDiagnostics().Should().NotContain(x => x.Severity == DiagnosticSeverity.Error); + + // Run tests with the generated resolver/formatter assembly. + compilation.ExecuteWithGeneratedAssembly((ctx, assembly) => + { + var mpoType = assembly.GetType("TempProject.MyMessagePackObject"); + var options = MessagePackSerializerOptions.Standard + .WithResolver(CompositeResolver.Create( + StandardResolver.Instance, + TestUtilities.GetResolverInstance(assembly, "TempProject.Generated.Resolvers.TempProjectResolver"))); + + // Build `{ "A": -1, "B": "foobar" }` + var seq = new Sequence(); + var writer = new MessagePackWriter(seq); + writer.WriteMapHeader(2); + writer.Write("A"); + writer.Write(-1); + writer.Write("B"); + writer.Write("foobar"); + writer.Flush(); + + // Verify deserialization + dynamic result = MessagePackSerializer.Deserialize(mpoType, seq, options); + ((int)result.A).Should().Be(12345); // default value + ((string)result.B).Should().Be("foobar"); // from input + }); + } + + [Fact] + public async Task PropertiesGetterSetterWithParameterizedConstructor() + { + using var tempWorkarea = TemporaryProjectWorkarea.Create(); + var contents = @" +using System; +using System.Collections.Generic; +using MessagePack; + +namespace TempProject +{ + [MessagePackObject(true)] + public class MyMessagePackObject + { + public int A { get; set; } + public string B { get; set; } + + public MyMessagePackObject(int a, string b) + { + A = a; + B = b; + } + } +} + "; + tempWorkarea.AddFileToTargetProject("MyMessagePackObject.cs", contents); + + var compiler = new MessagePackCompiler.CodeGenerator(testOutputHelper.WriteLine, CancellationToken.None); + await compiler.GenerateFileAsync( + tempWorkarea.GetOutputCompilation().Compilation, + tempWorkarea.OutputDirectory, + "TempProjectResolver", + "TempProject.Generated", + false, + string.Empty, + Array.Empty()); + + var compilation = tempWorkarea.GetOutputCompilation(); + compilation.Compilation.GetDiagnostics().Should().NotContain(x => x.Severity == DiagnosticSeverity.Error); + + // Run tests with the generated resolver/formatter assembly. + compilation.ExecuteWithGeneratedAssembly((ctx, assembly) => + { + var mpoType = assembly.GetType("TempProject.MyMessagePackObject"); + var options = MessagePackSerializerOptions.Standard + .WithResolver(CompositeResolver.Create( + StandardResolver.Instance, + TestUtilities.GetResolverInstance(assembly, "TempProject.Generated.Resolvers.TempProjectResolver"))); + + // Build `{ "A": -1, "B": "foobar" }` + var seq = new Sequence(); + var writer = new MessagePackWriter(seq); + writer.WriteMapHeader(2); + writer.Write("A"); + writer.Write(-1); + writer.Write("B"); + writer.Write("foobar"); + writer.Flush(); + + // Verify deserialization + dynamic result = MessagePackSerializer.Deserialize(mpoType, seq, options); + ((int)result.A).Should().Be(-1); // from input + ((string)result.B).Should().Be("foobar"); // from input + + // Verify serialization + var serialized = MessagePackSerializer.Serialize(mpoType, (object)result, options); + serialized.Should().BeEquivalentTo(seq.AsReadOnlySequence.ToArray()); + }); + } + + [Fact] + public async Task PropertiesGetterSetterWithParameterizedConstructorPartially() + { + using var tempWorkarea = TemporaryProjectWorkarea.Create(); + var contents = @" +using System; +using System.Collections.Generic; +using MessagePack; + +namespace TempProject +{ + [MessagePackObject(true)] + public class MyMessagePackObject + { + public int A { get; set; } + public string B { get; set; } + + public MyMessagePackObject(int a) + { + A = a; + } + } +} + "; + tempWorkarea.AddFileToTargetProject("MyMessagePackObject.cs", contents); + + var compiler = new MessagePackCompiler.CodeGenerator(testOutputHelper.WriteLine, CancellationToken.None); + await compiler.GenerateFileAsync( + tempWorkarea.GetOutputCompilation().Compilation, + tempWorkarea.OutputDirectory, + "TempProjectResolver", + "TempProject.Generated", + false, + string.Empty, + Array.Empty()); + + var compilation = tempWorkarea.GetOutputCompilation(); + compilation.Compilation.GetDiagnostics().Should().NotContain(x => x.Severity == DiagnosticSeverity.Error); + + // Run tests with the generated resolver/formatter assembly. + compilation.ExecuteWithGeneratedAssembly((ctx, assembly) => + { + var mpoType = assembly.GetType("TempProject.MyMessagePackObject"); + var options = MessagePackSerializerOptions.Standard + .WithResolver(CompositeResolver.Create( + StandardResolver.Instance, + TestUtilities.GetResolverInstance(assembly, "TempProject.Generated.Resolvers.TempProjectResolver"))); + + // Build `{ "A": -1, "B": "foobar" }` + var seq = new Sequence(); + var writer = new MessagePackWriter(seq); + writer.WriteMapHeader(2); + writer.Write("A"); + writer.Write(-1); + writer.Write("B"); + writer.Write("foobar"); + writer.Flush(); + + // Verify deserialization + dynamic result = MessagePackSerializer.Deserialize(mpoType, seq, options); + ((int)result.A).Should().Be(-1); // from ctor + ((string)result.B).Should().Be("foobar"); // from setter + + // Verify serialization + var serialized = MessagePackSerializer.Serialize(mpoType, (object)result, options); + serialized.Should().BeEquivalentTo(seq.AsReadOnlySequence.ToArray()); + }); + } + + [Fact] + public async Task PropertiesGetterSetterWithParameterizedConstructorDoNotUseSetter() + { + using var tempWorkarea = TemporaryProjectWorkarea.Create(); + var contents = @" +using System; +using System.Collections.Generic; +using MessagePack; + +namespace TempProject +{ + [MessagePackObject(true)] + public class MyMessagePackObject + { + public int A { get; set; } + + public MyMessagePackObject(int a) + { + } + } +} + "; + tempWorkarea.AddFileToTargetProject("MyMessagePackObject.cs", contents); + + var compiler = new MessagePackCompiler.CodeGenerator(testOutputHelper.WriteLine, CancellationToken.None); + await compiler.GenerateFileAsync( + tempWorkarea.GetOutputCompilation().Compilation, + tempWorkarea.OutputDirectory, + "TempProjectResolver", + "TempProject.Generated", + false, + string.Empty, + Array.Empty()); + + var compilation = tempWorkarea.GetOutputCompilation(); + compilation.Compilation.GetDiagnostics().Should().NotContain(x => x.Severity == DiagnosticSeverity.Error); + + // Run tests with the generated resolver/formatter assembly. + compilation.ExecuteWithGeneratedAssembly((ctx, assembly) => + { + var mpoType = assembly.GetType("TempProject.MyMessagePackObject"); + var options = MessagePackSerializerOptions.Standard + .WithResolver(CompositeResolver.Create( + StandardResolver.Instance, + TestUtilities.GetResolverInstance(assembly, "TempProject.Generated.Resolvers.TempProjectResolver"))); + + // Build `{ "A": -1 }` + var seq = new Sequence(); + var writer = new MessagePackWriter(seq); + writer.WriteMapHeader(1); + writer.Write("A"); + writer.Write(-1); + writer.Flush(); + + // Verify deserialization + dynamic result = MessagePackSerializer.Deserialize(mpoType, seq, options); + ((int)result.A).Should().Be(0); + }); + } + + [Fact] + public async Task PropertiesGetterSetterWithParameterizedConstructorAndDefaultValue() + { + using var tempWorkarea = TemporaryProjectWorkarea.Create(); + var contents = @" +using System; +using System.Collections.Generic; +using MessagePack; + +namespace TempProject +{ + [MessagePackObject(true)] + public class MyMessagePackObject + { + public int A { get; set; } + public string B { get; set; } = ""foobar""; + + public MyMessagePackObject(int a) + { + A = a; + } + } +} + "; + tempWorkarea.AddFileToTargetProject("MyMessagePackObject.cs", contents); + + var compiler = new MessagePackCompiler.CodeGenerator(testOutputHelper.WriteLine, CancellationToken.None); + await compiler.GenerateFileAsync( + tempWorkarea.GetOutputCompilation().Compilation, + tempWorkarea.OutputDirectory, + "TempProjectResolver", + "TempProject.Generated", + false, + string.Empty, + Array.Empty()); + + var compilation = tempWorkarea.GetOutputCompilation(); + compilation.Compilation.GetDiagnostics().Should().NotContain(x => x.Severity == DiagnosticSeverity.Error); + + // Run tests with the generated resolver/formatter assembly. + compilation.ExecuteWithGeneratedAssembly((ctx, assembly) => + { + var mpoType = assembly.GetType("TempProject.MyMessagePackObject"); + var options = MessagePackSerializerOptions.Standard + .WithResolver(CompositeResolver.Create( + StandardResolver.Instance, + TestUtilities.GetResolverInstance(assembly, "TempProject.Generated.Resolvers.TempProjectResolver"))); + + // Build `{ "A": -1 }` + var seq = new Sequence(); + var writer = new MessagePackWriter(seq); + writer.WriteMapHeader(1); + writer.Write("A"); + writer.Write(-1); + writer.Flush(); + + // Verify deserialization + dynamic result = MessagePackSerializer.Deserialize(mpoType, seq, options); + ((int)result.A).Should().Be(-1); // from ctor + ((string)result.B).Should().Be("foobar"); // default value + }); + } + } +} diff --git a/tests/MessagePack.Generator.Tests/MessagePack.Generator.Tests.csproj b/tests/MessagePack.Generator.Tests/MessagePack.Generator.Tests.csproj index 08a0c8028..7c12e7f53 100644 --- a/tests/MessagePack.Generator.Tests/MessagePack.Generator.Tests.csproj +++ b/tests/MessagePack.Generator.Tests/MessagePack.Generator.Tests.csproj @@ -10,10 +10,11 @@ - + + diff --git a/tests/MessagePack.Generator.Tests/TemporaryProjectWorkarea.cs b/tests/MessagePack.Generator.Tests/TemporaryProjectWorkarea.cs index f32776659..243e9fcb1 100644 --- a/tests/MessagePack.Generator.Tests/TemporaryProjectWorkarea.cs +++ b/tests/MessagePack.Generator.Tests/TemporaryProjectWorkarea.cs @@ -6,11 +6,13 @@ using System.IO; using System.Linq; using System.Reflection; +using System.Runtime.Loader; using System.Threading.Tasks; using MessagePack.Formatters; using Microsoft.CodeAnalysis; using Microsoft.CodeAnalysis.CSharp; using Microsoft.CodeAnalysis.CSharp.Syntax; +using Nerdbank.Streams; namespace MessagePack.Generator.Tests { @@ -20,12 +22,28 @@ namespace MessagePack.Generator.Tests public class TemporaryProjectWorkarea : IDisposable { private readonly string tempDirPath; - private readonly string csprojFileName = "TempProject.csproj"; + private readonly string targetCsprojFileName = "TempTargetProject.csproj"; + private readonly string referencedCsprojFileName = "TempReferencedProject.csproj"; private readonly bool cleanOnDisposing; - public string CsProjectPath { get; } + /// + /// Gets the identifier of the workarea. + /// + public Guid WorkareaId { get; } - public string ProjectDirectory { get; } + /// + /// Gets Generator target csproj file path. + /// + public string TargetCsProjectPath { get; } + + /// + /// Gets csproj file path Referenced from TargetProject. + /// + public string ReferencedCsProjectPath { get; } + + public string TargetProjectDirectory { get; } + + public string ReferencedProjectDirectory { get; } public string OutputDirectory { get; } @@ -36,20 +54,38 @@ public static TemporaryProjectWorkarea Create(bool cleanOnDisposing = true) private TemporaryProjectWorkarea(bool cleanOnDisposing) { + WorkareaId = Guid.NewGuid(); this.cleanOnDisposing = cleanOnDisposing; - this.tempDirPath = Path.Combine(Path.GetTempPath(), $"MessagePack.Generator.Tests-{Guid.NewGuid()}"); + this.tempDirPath = Path.Combine(Path.GetTempPath(), $"MessagePack.Generator.Tests-{WorkareaId}"); - ProjectDirectory = Path.Combine(tempDirPath, "Project"); + TargetProjectDirectory = Path.Combine(tempDirPath, "TargetProject"); + ReferencedProjectDirectory = Path.Combine(tempDirPath, "ReferencedProject"); OutputDirectory = Path.Combine(tempDirPath, "Output"); - Directory.CreateDirectory(ProjectDirectory); + Directory.CreateDirectory(TargetProjectDirectory); + Directory.CreateDirectory(ReferencedProjectDirectory); Directory.CreateDirectory(OutputDirectory); + Directory.CreateDirectory(Path.Combine(OutputDirectory, "bin")); var solutionRootDir = Path.GetFullPath(Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "../../../..")); var messagePackProjectDir = Path.Combine(solutionRootDir, "src/MessagePack/MessagePack.csproj"); var annotationsProjectDir = Path.Combine(solutionRootDir, "src/MessagePack.Annotations/MessagePack.Annotations.csproj"); - CsProjectPath = Path.Combine(ProjectDirectory, csprojFileName); + ReferencedCsProjectPath = Path.Combine(ReferencedProjectDirectory, referencedCsprojFileName); + var referencedCsprojContents = @" + + + netstandard2.0 + + + + + + +"; + AddFileToReferencedProject(referencedCsprojFileName, referencedCsprojContents); + + TargetCsProjectPath = Path.Combine(TargetProjectDirectory, targetCsprojFileName); var csprojContents = @" @@ -59,26 +95,56 @@ private TemporaryProjectWorkarea(bool cleanOnDisposing) + "; - AddFileToProject(csprojFileName, csprojContents); + AddFileToTargetProject(targetCsprojFileName, csprojContents); + } + + /// + /// Add file to Generator target project. + /// + public void AddFileToTargetProject(string fileName, string contents) + { + File.WriteAllText(Path.Combine(TargetProjectDirectory, fileName), contents.Trim()); } - public void AddFileToProject(string fileName, string contents) + /// + /// Add file to project, referenced by Generator target project. + /// + public void AddFileToReferencedProject(string fileName, string contents) { - File.WriteAllText(Path.Combine(ProjectDirectory, fileName), contents.Trim()); + File.WriteAllText(Path.Combine(ReferencedProjectDirectory, fileName), contents.Trim()); } public OutputCompilation GetOutputCompilation() { var refAsmDir = Path.GetDirectoryName(typeof(object).Assembly.Location); + var referenceCompilation = CSharpCompilation.Create(Guid.NewGuid().ToString()) + .AddSyntaxTrees( + Directory.EnumerateFiles(ReferencedProjectDirectory, "*.cs", SearchOption.AllDirectories) + .Select(x => CSharpSyntaxTree.ParseText(File.ReadAllText(x), CSharpParseOptions.Default, x))) + .AddReferences(MetadataReference.CreateFromFile(Path.Combine(refAsmDir, "System.Private.CoreLib.dll"))) + .AddReferences(MetadataReference.CreateFromFile(Path.Combine(refAsmDir, "System.Runtime.Extensions.dll"))) + .AddReferences(MetadataReference.CreateFromFile(Path.Combine(refAsmDir, "System.Collections.dll"))) + .AddReferences(MetadataReference.CreateFromFile(Path.Combine(refAsmDir, "System.Linq.dll"))) + .AddReferences(MetadataReference.CreateFromFile(Path.Combine(refAsmDir, "System.Console.dll"))) + .AddReferences(MetadataReference.CreateFromFile(Path.Combine(refAsmDir, "System.Runtime.dll"))) + .AddReferences(MetadataReference.CreateFromFile(Path.Combine(refAsmDir, "System.Memory.dll"))) + .AddReferences(MetadataReference.CreateFromFile(Path.Combine(refAsmDir, "netstandard.dll"))) + .AddReferences(MetadataReference.CreateFromFile(typeof(object).Assembly.Location)) + .AddReferences(MetadataReference.CreateFromFile(typeof(MessagePack.MessagePackObjectAttribute).Assembly.Location)) + .AddReferences(MetadataReference.CreateFromFile(typeof(IMessagePackFormatter<>).Assembly.Location)) + .WithOptions(new CSharpCompilationOptions(OutputKind.DynamicallyLinkedLibrary)); + var compilation = CSharpCompilation.Create(Guid.NewGuid().ToString()) .AddSyntaxTrees( - Directory.EnumerateFiles(ProjectDirectory, "*.cs", SearchOption.AllDirectories) + Directory.EnumerateFiles(TargetProjectDirectory, "*.cs", SearchOption.AllDirectories) .Concat(Directory.EnumerateFiles(OutputDirectory, "*.cs", SearchOption.AllDirectories)) .Select(x => CSharpSyntaxTree.ParseText(File.ReadAllText(x), CSharpParseOptions.Default, x))) + .AddReferences(referenceCompilation.ToMetadataReference()) .AddReferences(MetadataReference.CreateFromFile(Path.Combine(refAsmDir, "System.Private.CoreLib.dll"))) .AddReferences(MetadataReference.CreateFromFile(Path.Combine(refAsmDir, "System.Runtime.Extensions.dll"))) .AddReferences(MetadataReference.CreateFromFile(Path.Combine(refAsmDir, "System.Collections.dll"))) @@ -92,7 +158,7 @@ public OutputCompilation GetOutputCompilation() .AddReferences(MetadataReference.CreateFromFile(typeof(IMessagePackFormatter<>).Assembly.Location)) .WithOptions(new CSharpCompilationOptions(OutputKind.DynamicallyLinkedLibrary)); - return new OutputCompilation(compilation); + return new OutputCompilation(this, compilation); } public void Dispose() @@ -106,10 +172,13 @@ public void Dispose() public class OutputCompilation { + private readonly TemporaryProjectWorkarea workarea; + public Compilation Compilation { get; } - public OutputCompilation(Compilation compilation) + public OutputCompilation(TemporaryProjectWorkarea workarea, Compilation compilation) { + this.workarea = workarea; this.Compilation = compilation ?? throw new ArgumentNullException(nameof(compilation)); } @@ -146,5 +215,26 @@ public IReadOnlyList GetResolverKnownFormatterTypes() .Select(x => x.ToString())) .ToArray(); } + + /// + /// Load the generated assembly and execute the code in that context. + /// + public void ExecuteWithGeneratedAssembly(Action action) + { + var memoryStream = new MemoryStream(); + Compilation.Emit(memoryStream); + memoryStream.Position = 0; + + var assemblyLoadContext = new AssemblyLoadContext($"TempProject-{workarea.WorkareaId}", isCollectible: true); + try + { + Assembly assembly = assemblyLoadContext.LoadFromStream(memoryStream); + action(assemblyLoadContext, assembly); + } + finally + { + assemblyLoadContext.Unload(); + } + } } } diff --git a/tests/MessagePack.Generator.Tests/TestUtilities.cs b/tests/MessagePack.Generator.Tests/TestUtilities.cs new file mode 100644 index 000000000..ad6bb13f5 --- /dev/null +++ b/tests/MessagePack.Generator.Tests/TestUtilities.cs @@ -0,0 +1,22 @@ +// Copyright (c) All contributors. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +using System.Reflection; + +namespace MessagePack.Generator.Tests +{ + internal static class TestUtilities + { + /// + /// Fetches the static instance of the named resolver, by its Instance property. + /// + /// The assembly to retrieve the resolver from. + /// The full name of the resolver. + /// The resolver. + internal static IFormatterResolver GetResolverInstance(Assembly assembly, string name) + { + var resolverType = assembly.GetType(name); + return (IFormatterResolver)resolverType.GetField("Instance", BindingFlags.Static | BindingFlags.Public).GetValue(null); + } + } +} diff --git a/tests/MessagePack.Internal.Tests/MessagePack.Internal.Tests.csproj b/tests/MessagePack.Internal.Tests/MessagePack.Internal.Tests.csproj index f75ede3e1..61f979640 100644 --- a/tests/MessagePack.Internal.Tests/MessagePack.Internal.Tests.csproj +++ b/tests/MessagePack.Internal.Tests/MessagePack.Internal.Tests.csproj @@ -1,6 +1,6 @@  - netcoreapp2.2 + netcoreapp3.1 ..\MessagePack.Tests\MessagePack.Tests.ruleset diff --git a/tests/MessagePack.Tests/DynamicObjectResolverRecordsTests.cs b/tests/MessagePack.Tests/DynamicObjectResolverRecordsTests.cs new file mode 100644 index 000000000..483fe4ce7 --- /dev/null +++ b/tests/MessagePack.Tests/DynamicObjectResolverRecordsTests.cs @@ -0,0 +1,101 @@ +// Copyright (c) All contributors. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +using MessagePack.Resolvers; +using Xunit; + +#if NET5_0_OR_GREATER + +namespace MessagePack.Tests +{ + public class DynamicObjectResolverRecordsTests : TestBase + { + [Fact] + public void RoundtripRecord() + { + this.AssertRoundTrip(new Person { FirstName = "bob", LastName = "smith" }); + } + + [Fact] + public void RoundtripPositionalRecord() + { + this.AssertRoundTrip(new PersonPositional("bob", "smith")); + } + + [Fact] + public void RoundtripGenericPositionalRecord() + { + this.AssertRoundTrip(new GenericPersonPositional("bob", "smith")); + } + + [Fact] + public void RoundtripDerivedRecord() + { + this.AssertRoundTrip(new Student { FirstName = "bob", LastName = "smith", Grade = 5 }); + } + + [Fact] + public void RoundtripPositionalDerivedRecord() + { + this.AssertRoundTrip(new StudentPositional("bob", "smith", 5)); + } + + [Fact] + public void RoundtripRecordWithPrivateProperties() + { + var original = new RecordWithPrivateProperties("PublicValue"); + original.SetPrivateProperty("PrivateValue"); + var deserializedValue = this.AssertRoundTrip(original, allowPrivate: true); + Assert.Equal(original.GetPrivateProperty(), deserializedValue.GetPrivateProperty()); + } + + protected T AssertRoundTrip(T value, bool allowPrivate = false) + { + var options = allowPrivate ? StandardResolverAllowPrivate.Options : MessagePackSerializerOptions.Standard; + byte[] msgpack = MessagePackSerializer.Serialize(value, options, this.TimeoutToken); + T deserializedValue = MessagePackSerializer.Deserialize(msgpack, options, this.TimeoutToken); + Assert.Equal(value, deserializedValue); + return deserializedValue; + } + + [MessagePackObject] + public record GenericPersonPositional([property: Key(0)] string FirstName, [property: Key(1)] string LastName); + + [MessagePackObject] + public record PersonPositional([property: Key(0)] string FirstName, [property: Key(1)] string LastName); + + [MessagePackObject] + public record StudentPositional(string FirstName, string LastName, [property: Key(2)] int Grade) + : PersonPositional(FirstName, LastName); + + [MessagePackObject] + public record Person + { + [Key(0)] + public string FirstName { get; init; } + + [Key(1)] + public string LastName { get; init; } + } + + [MessagePackObject] + public record Student : Person + { + [Key(2)] + public int Grade { get; init; } + } + + [MessagePackObject] + public record RecordWithPrivateProperties([property: Key(0)] string SomePublicProperty) + { + [Key(1)] + private string SomePrivateProperty { get; set; } + + public string GetPrivateProperty() => this.SomePrivateProperty; + + public void SetPrivateProperty(string value) => this.SomePrivateProperty = value; + } + } +} + +#endif diff --git a/tests/MessagePack.Tests/IsExternalInit.cs b/tests/MessagePack.Tests/IsExternalInit.cs new file mode 100644 index 000000000..62f1255f8 --- /dev/null +++ b/tests/MessagePack.Tests/IsExternalInit.cs @@ -0,0 +1,18 @@ +// Copyright (c) All contributors. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +#if !NET5_0_OR_GREATER + +#pragma warning disable CA1812 + +namespace System.Runtime.CompilerServices +{ + /// + /// Used by C# 9 for property init accessors. + /// + internal sealed class IsExternalInit + { + } +} + +#endif diff --git a/tests/MessagePack.Tests/MessagePack.Tests.csproj b/tests/MessagePack.Tests/MessagePack.Tests.csproj index 4c2da233f..5fb26383b 100644 --- a/tests/MessagePack.Tests/MessagePack.Tests.csproj +++ b/tests/MessagePack.Tests/MessagePack.Tests.csproj @@ -1,8 +1,8 @@  - net472;netcoreapp2.1;netcoreapp3.1 + net472;netcoreapp3.1;net6.0 true - 8.0 + 10 true true $(NoWarn);CS1701 @@ -27,7 +27,7 @@ - + diff --git a/tests/MessagePack.Tests/MessagePackStreamReaderArrayTests.cs b/tests/MessagePack.Tests/MessagePackStreamReaderArrayTests.cs index 69d5c0ded..80f38fef9 100644 --- a/tests/MessagePack.Tests/MessagePackStreamReaderArrayTests.cs +++ b/tests/MessagePack.Tests/MessagePackStreamReaderArrayTests.cs @@ -32,6 +32,19 @@ public MessagePackStreamReaderArrayTests() this.arraySequence = sequence; } + [Fact] + public async Task ReadArrayHeader() + { + var reader = new MessagePackStreamReader(this.arraySequence.AsStream()); + var length = await reader.ReadArrayHeaderAsync(this.TimeoutToken); + Assert.Equal(ArrayContent.Count, length); + for (var i = 0; i < length; i++) + { + var elementSequence = await reader.ReadAsync(this.TimeoutToken); + Assert.Equal(ArrayContent[i], MessagePackSerializer.Deserialize(elementSequence.Value)); + } + } + [Fact] public async Task EnumerateArrayElements_AllAtOnce() { diff --git a/tests/MessagePack.Tests/MessagePackStreamReaderMapTests.cs b/tests/MessagePack.Tests/MessagePackStreamReaderMapTests.cs new file mode 100644 index 000000000..ef33055e7 --- /dev/null +++ b/tests/MessagePack.Tests/MessagePackStreamReaderMapTests.cs @@ -0,0 +1,48 @@ +// Copyright (c) All contributors. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +using System; +using System.Buffers; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using Nerdbank.Streams; +using Xunit; + +namespace MessagePack.Tests +{ + public class MessagePackStreamReaderMapTests : TestBase + { + private static readonly IReadOnlyList MapContent = new object[] { (byte)5, "2", "23", "234", "2345" }; + private readonly ReadOnlySequence arraySequence; + + public MessagePackStreamReaderMapTests() + { + var sequence = new Sequence(); + var writer = new MessagePackWriter(sequence); + + writer.WriteMapHeader(MapContent.Count); + + for (int i = 0; i < MapContent.Count; i++) + { + MessagePackSerializer.Serialize(ref writer, MapContent[i]); + writer.Flush(); + } + + this.arraySequence = sequence; + } + + [Fact] + public async Task ReadMapHeader() + { + var reader = new MessagePackStreamReader(this.arraySequence.AsStream()); + var count = await reader.ReadMapHeaderAsync(this.TimeoutToken); + Assert.Equal(MapContent.Count, count); + for (var i = 0; i < count; i++) + { + var elementSequence = await reader.ReadAsync(this.TimeoutToken); + Assert.Equal(MapContent[i], MessagePackSerializer.Deserialize(elementSequence.Value)); + } + } + } +} diff --git a/tests/MessagePackAnalyzer.Tests/MessagePackAnalyzerTests.cs b/tests/MessagePackAnalyzer.Tests/MessagePackAnalyzerTests.cs index 9e27d3cca..8fc4c65f9 100644 --- a/tests/MessagePackAnalyzer.Tests/MessagePackAnalyzerTests.cs +++ b/tests/MessagePackAnalyzer.Tests/MessagePackAnalyzerTests.cs @@ -2,8 +2,11 @@ // Licensed under the MIT license. See LICENSE file in the project root for full license information. using System.Threading.Tasks; +using Microsoft.CodeAnalysis; +using Microsoft.CodeAnalysis.Testing; using Xunit; -using VerifyCS = CSharpCodeFixVerifier; +using VerifyCS = + CSharpCodeFixVerifier; public class MessagePackAnalyzerTests { @@ -23,6 +26,54 @@ public class Foo await VerifyCS.VerifyAnalyzerWithoutMessagePackReferenceAsync(input); } + [Fact] + public async Task MessageFormatterAttribute() + { + string input = Preamble + @"using MessagePack.Formatters; + +public class FooFormatter : IMessagePackFormatter { + public void Serialize(ref MessagePackWriter writer, Foo value, MessagePackSerializerOptions options) {} + public Foo Deserialize(ref MessagePackReader reader, MessagePackSerializerOptions options) => default; +} + + +[MessagePackFormatter(typeof(FooFormatter))] +public struct Foo +{ +} + +[MessagePackObject] +public class SomeClass { + [Key(0)] + public Foo SomeFoo { get; set; } +} +"; + + await VerifyCS.VerifyAnalyzerAsync(input); + } + + [Fact] + public async Task InvalidMessageFormatterType() + { + string input = Preamble + @"using MessagePack.Formatters; + +public class InvalidMessageFormatter { } + +[{|MsgPack006:MessagePackFormatter(typeof(InvalidMessageFormatter))|}] +public struct Foo +{ +} + +[MessagePackObject] +public class SomeClass { + [Key(0)] + public Foo SomeFoo { get; set; } +} +"; + + await VerifyCS.VerifyAnalyzerAsync(input); + } + [Fact] public async Task NullStringKey() { @@ -106,12 +157,13 @@ public async Task CodeFixAppliesAcrossFiles() { var inputs = new string[] { - @" + @" public class Foo { public int {|MsgPack004:Member1|} { get; set; } } -", @"using MessagePack; +", + @"using MessagePack; [MessagePackObject] public class Bar : Foo @@ -122,13 +174,14 @@ public class Bar : Foo }; var outputs = new string[] { - @" + @" public class Foo { [MessagePack.Key(1)] public int Member1 { get; set; } } -", @"using MessagePack; +", + @"using MessagePack; [MessagePackObject] public class Bar : Foo diff --git a/tools/Check-DotNetRuntime.ps1 b/tools/Check-DotNetRuntime.ps1 new file mode 100644 index 000000000..9d0121095 --- /dev/null +++ b/tools/Check-DotNetRuntime.ps1 @@ -0,0 +1,41 @@ +<# +.SYNOPSIS + Checks whether a given .NET Core runtime is installed. +#> +[CmdletBinding()] +Param ( + [Parameter()] + [ValidateSet('Microsoft.AspNetCore.App','Microsoft.NETCore.App')] + [string]$Runtime='Microsoft.NETCore.App', + [Parameter(Mandatory=$true)] + [Version]$Version +) + +$dotnet = Get-Command dotnet -ErrorAction SilentlyContinue +if (!$dotnet) { + # Nothing is installed. + Write-Output $false + exit 1 +} + +Function IsVersionMatch { + Param( + [Parameter()] + $actualVersion + ) + return $actualVersion -and + $Version.Major -eq $actualVersion.Major -and + $Version.Minor -eq $actualVersion.Minor -and + (($Version.Build -eq -1) -or ($Version.Build -eq $actualVersion.Build)) -and + (($Version.Revision -eq -1) -or ($Version.Revision -eq $actualVersion.Revision)) +} + +$installedRuntimes = dotnet --list-runtimes |? { $_.Split()[0] -ieq $Runtime } |% { $v = $null; [Version]::tryparse($_.Split()[1], [ref] $v); $v } +$matchingRuntimes = $installedRuntimes |? { IsVersionMatch -actualVersion $_ } +if (!$matchingRuntimes) { + Write-Output $false + exit 1 +} + +Write-Output $true +exit 0 diff --git a/tools/Check-DotNetSdk.ps1 b/tools/Check-DotNetSdk.ps1 new file mode 100644 index 000000000..6c9fa772c --- /dev/null +++ b/tools/Check-DotNetSdk.ps1 @@ -0,0 +1,37 @@ +<# +.SYNOPSIS + Checks whether the .NET Core SDK required by this repo is installed. +#> +[CmdletBinding()] +Param ( +) + +$dotnet = Get-Command dotnet -ErrorAction SilentlyContinue +if (!$dotnet) { + # Nothing is installed. + Write-Output $false + exit 1 +} + +# We need to set the current directory so dotnet considers the SDK required by our global.json file. +Push-Location "$PSScriptRoot\.." +try { + dotnet -h 2>&1 | Out-Null + if (($LASTEXITCODE -eq 129) -or # On Linux + ($LASTEXITCODE -eq -2147450751) # On Windows + ) { + # These exit codes indicate no matching SDK exists. + Write-Output $false + exit 2 + } + + # The required SDK is already installed! + Write-Output $true + exit 0 +} catch { + # I don't know why, but on some build agents (e.g. MicroBuild), an exception is thrown from the `dotnet` invocation when a match is not found. + Write-Output $false + exit 3 +} finally { + Pop-Location +} diff --git a/tools/Install-DotNetSdk.ps1 b/tools/Install-DotNetSdk.ps1 index 05cfef02a..0606d802c 100755 --- a/tools/Install-DotNetSdk.ps1 +++ b/tools/Install-DotNetSdk.ps1 @@ -2,19 +2,19 @@ <# .SYNOPSIS -Installs the .NET SDK specified in the global.json file at the root of this repository, -along with supporting .NET Core runtimes used for testing. + Installs the .NET SDK specified in the global.json file at the root of this repository, + along with supporting .NET Core runtimes used for testing. .DESCRIPTION -This MAY not require elevation, as the SDK and runtimes are installed locally to this repo location, -unless `-InstallLocality machine` is specified. + This MAY not require elevation, as the SDK and runtimes are installed locally to this repo location, + unless `-InstallLocality machine` is specified. .PARAMETER InstallLocality -A value indicating whether dependencies should be installed locally to the repo or at a per-user location. -Per-user allows sharing the installed dependencies across repositories and allows use of a shared expanded package cache. -Visual Studio will only notice and use these SDKs/runtimes if VS is launched from the environment that runs this script. -Per-repo allows for high isolation, allowing for a more precise recreation of the environment within an Azure Pipelines build. -When using 'repo', environment variables are set to cause the locally installed dotnet SDK to be used. -Per-repo can lead to file locking issues when dotnet.exe is left running as a build server and can be mitigated by running `dotnet build-server shutdown`. -Per-machine requires elevation and will download and install all SDKs and runtimes to machine-wide locations so all applications can find it. + A value indicating whether dependencies should be installed locally to the repo or at a per-user location. + Per-user allows sharing the installed dependencies across repositories and allows use of a shared expanded package cache. + Visual Studio will only notice and use these SDKs/runtimes if VS is launched from the environment that runs this script. + Per-repo allows for high isolation, allowing for a more precise recreation of the environment within an Azure Pipelines build. + When using 'repo', environment variables are set to cause the locally installed dotnet SDK to be used. + Per-repo can lead to file locking issues when dotnet.exe is left running as a build server and can be mitigated by running `dotnet build-server shutdown`. + Per-machine requires elevation and will download and install all SDKs and runtimes to machine-wide locations so all applications can find it. #> [CmdletBinding(SupportsShouldProcess=$true,ConfirmImpact='Medium')] Param ( @@ -29,20 +29,43 @@ $DotNetInstallScriptRoot = Resolve-Path $DotNetInstallScriptRoot # Look up actual required .NET Core SDK version from global.json $sdkVersion = & "$PSScriptRoot/../azure-pipelines/variables/DotNetSdkVersion.ps1" +$arch = [System.Runtime.InteropServices.RuntimeInformation]::ProcessArchitecture +if (!$arch) { # Windows Powershell leaves this blank + $arch = 'x64' + if ($env:PROCESSOR_ARCHITECTURE -eq 'ARM64') { $arch = 'ARM64' } +} + # Search for all .NET Core runtime versions referenced from MSBuild projects and arrange to install them. $runtimeVersions = @() +$windowsDesktopRuntimeVersions = @() Get-ChildItem "$PSScriptRoot\..\src\*.*proj","$PSScriptRoot\..\tests\*.*proj","$PSScriptRoot\..\Directory.Build.props" -Recurse |% { $projXml = [xml](Get-Content -Path $_) - $targetFrameworks = $projXml.Project.PropertyGroup.TargetFramework - if (!$targetFrameworks) { - $targetFrameworks = $projXml.Project.PropertyGroup.TargetFrameworks - if ($targetFrameworks) { - $targetFrameworks = $targetFrameworks -Split ';' + $pg = $projXml.Project.PropertyGroup + if ($pg) { + $targetFrameworks = $pg.TargetFramework + if (!$targetFrameworks) { + $targetFrameworks = $pg.TargetFrameworks + if ($targetFrameworks) { + $targetFrameworks = $targetFrameworks -Split ';' + } } } - $targetFrameworks |? { $_ -match 'netcoreapp(\d+\.\d+)' } |% { - $runtimeVersions += $Matches[1] + $targetFrameworks |? { $_ -match 'net(?:coreapp)?(\d+\.\d+)' } |% { + $v = $Matches[1] + $runtimeVersions += $v + if ($v -ge '3.0' -and -not ($IsMacOS -or $IsLinux)) { + $windowsDesktopRuntimeVersions += $v + } } + + # Add target frameworks of the form: netXX + $targetFrameworks |? { $_ -match 'net(\d+\.\d+)' } |% { + $v = $Matches[1] + $runtimeVersions += $v + if (-not ($IsMacOS -or $IsLinux)) { + $windowsDesktopRuntimeVersions += $v + } + } } Function Get-FileFromWeb([Uri]$Uri, $OutDir) { @@ -69,7 +92,7 @@ Function Get-InstallerExe($Version, [switch]$Runtime) { $Version = $versionInfo[-1] } - Get-FileFromWeb -Uri "https://dotnetcli.blob.core.windows.net/dotnet/$sdkOrRuntime/$Version/dotnet-$($sdkOrRuntime.ToLowerInvariant())-$Version-win-x64.exe" -OutDir "$DotNetInstallScriptRoot" + Get-FileFromWeb -Uri "https://dotnetcli.blob.core.windows.net/dotnet/$sdkOrRuntime/$Version/dotnet-$($sdkOrRuntime.ToLowerInvariant())-$Version-win-$arch.exe" -OutDir "$DotNetInstallScriptRoot" } Function Install-DotNet($Version, [switch]$Runtime) { @@ -86,7 +109,7 @@ Function Install-DotNet($Version, [switch]$Runtime) { } $switches = @( - '-Architecture','x64' + '-Architecture',$arch ) $envVars = @{ # For locally installed dotnet, skip first time experience which takes a long time @@ -128,16 +151,16 @@ if ($InstallLocality -eq 'machine') { Write-Host "Installing .NET Core SDK and runtimes to $DotNetInstallDir" -ForegroundColor Blue if ($DotNetInstallDir) { - $switches += '-InstallDir',$DotNetInstallDir + $switches += '-InstallDir',"`"$DotNetInstallDir`"" $envVars['DOTNET_MULTILEVEL_LOOKUP'] = '0' $envVars['DOTNET_ROOT'] = $DotNetInstallDir } if ($IsMacOS -or $IsLinux) { - $DownloadUri = "https://dot.net/v1/dotnet-install.sh" + $DownloadUri = "https://raw.githubusercontent.com/dotnet/install-scripts/781752509a890ca7520f1182e8bae71f9a53d754/src/dotnet-install.sh" $DotNetInstallScriptPath = "$DotNetInstallScriptRoot/dotnet-install.sh" } else { - $DownloadUri = "https://dot.net/v1/dotnet-install.ps1" + $DownloadUri = "https://raw.githubusercontent.com/dotnet/install-scripts/781752509a890ca7520f1182e8bae71f9a53d754/src/dotnet-install.ps1" $DotNetInstallScriptPath = "$DotNetInstallScriptRoot/dotnet-install.ps1" } @@ -148,22 +171,78 @@ if (-not (Test-Path $DotNetInstallScriptPath)) { } } +# In case the script we invoke is in a directory with spaces, wrap it with single quotes. +# In case the path includes single quotes, escape them. +$DotNetInstallScriptPathExpression = $DotNetInstallScriptPath.Replace("'", "''") +$DotNetInstallScriptPathExpression = "& '$DotNetInstallScriptPathExpression'" + +$anythingInstalled = $false +$global:LASTEXITCODE = 0 + if ($PSCmdlet.ShouldProcess(".NET Core SDK $sdkVersion", "Install")) { - Invoke-Expression -Command "$DotNetInstallScriptPath -Version $sdkVersion $switches" + $anythingInstalled = $true + Invoke-Expression -Command "$DotNetInstallScriptPathExpression -Version $sdkVersion $switches" + + if ($LASTEXITCODE -ne 0) { + Write-Error ".NET SDK installation failure: $LASTEXITCODE" + exit $LASTEXITCODE + } } else { - Invoke-Expression -Command "$DotNetInstallScriptPath -Version $sdkVersion $switches -DryRun" + Invoke-Expression -Command "$DotNetInstallScriptPathExpression -Version $sdkVersion $switches -DryRun" } -$switches += '-Runtime','dotnet' +$dotnetRuntimeSwitches = $switches + '-Runtime','dotnet' -$runtimeVersions | Get-Unique |% { +$runtimeVersions | Sort-Object -Unique |% { if ($PSCmdlet.ShouldProcess(".NET Core runtime $_", "Install")) { - Invoke-Expression -Command "$DotNetInstallScriptPath -Channel $_ $switches" + $anythingInstalled = $true + Invoke-Expression -Command "$DotNetInstallScriptPathExpression -Channel $_ $dotnetRuntimeSwitches" + + if ($LASTEXITCODE -ne 0) { + Write-Error ".NET SDK installation failure: $LASTEXITCODE" + exit $LASTEXITCODE + } + } else { + Invoke-Expression -Command "$DotNetInstallScriptPathExpression -Channel $_ $dotnetRuntimeSwitches -DryRun" + } +} + +$windowsDesktopRuntimeSwitches = $switches + '-Runtime','windowsdesktop' + +$windowsDesktopRuntimeVersions | Sort-Object -Unique |% { + if ($PSCmdlet.ShouldProcess(".NET Core WindowsDesktop runtime $_", "Install")) { + $anythingInstalled = $true + Invoke-Expression -Command "$DotNetInstallScriptPathExpression -Channel $_ $windowsDesktopRuntimeSwitches" + + if ($LASTEXITCODE -ne 0) { + Write-Error ".NET SDK installation failure: $LASTEXITCODE" + exit $LASTEXITCODE + } + } else { + Invoke-Expression -Command "$DotNetInstallScriptPathExpression -Channel $_ $windowsDesktopRuntimeSwitches -DryRun" + } +} + +$aspnetRuntimeSwitches = $switches + '-Runtime','aspnetcore' + +$runtimeVersions | Sort-Object -Unique |% { + if ($PSCmdlet.ShouldProcess(".NET Core ASP.NET runtime $_", "Install")) { + $anythingInstalled = $true + Invoke-Expression -Command "$DotNetInstallScriptPathExpression -Channel $_ $aspnetRuntimeSwitches" + + if ($LASTEXITCODE -ne 0) { + Write-Error ".NET SDK installation failure: $LASTEXITCODE" + exit $LASTEXITCODE + } } else { - Invoke-Expression -Command "$DotNetInstallScriptPath -Channel $_ $switches -DryRun" + Invoke-Expression -Command "$DotNetInstallScriptPathExpression -Channel $_ $aspnetRuntimeSwitches -DryRun" } } if ($PSCmdlet.ShouldProcess("Set DOTNET environment variables to discover these installed runtimes?")) { - & "$PSScriptRoot/../azure-pipelines/Set-EnvVars.ps1" -Variables $envVars -PrependPath $DotNetInstallDir | Out-Null + & "$PSScriptRoot/Set-EnvVars.ps1" -Variables $envVars -PrependPath $DotNetInstallDir | Out-Null +} + +if ($anythingInstalled -and ($InstallLocality -ne 'machine') -and !$env:TF_BUILD -and !$env:GITHUB_ACTIONS) { + Write-Warning ".NET Core runtimes or SDKs were installed to a non-machine location. Perform your builds or open Visual Studio from this same environment in order for tools to discover the location of these dependencies." } diff --git a/tools/Install-NuGetCredProvider.ps1 b/tools/Install-NuGetCredProvider.ps1 index 2b3fb6fb4..6d3100349 100644 --- a/tools/Install-NuGetCredProvider.ps1 +++ b/tools/Install-NuGetCredProvider.ps1 @@ -19,6 +19,8 @@ Param ( [string]$AccessToken ) +$envVars = @{} + $toolsPath = & "$PSScriptRoot\..\azure-pipelines\Get-TempToolsPath.ps1" if ($IsMacOS -or $IsLinux) { @@ -66,9 +68,9 @@ if ($AccessToken) { Add-Member -InputObject $auth -MemberType NoteProperty -Name endpointCredentials -Value $endpoints $authJson = ConvertTo-Json -InputObject $auth - $envVars = @{ + $envVars += @{ 'VSS_NUGET_EXTERNAL_FEED_ENDPOINTS'=$authJson; } - - & "$PSScriptRoot\..\azure-pipelines\Set-EnvVars.ps1" -Variables $envVars | Out-Null } + +& "$PSScriptRoot/Set-EnvVars.ps1" -Variables $envVars | Out-Null diff --git a/azure-pipelines/Set-EnvVars.ps1 b/tools/Set-EnvVars.ps1 similarity index 67% rename from azure-pipelines/Set-EnvVars.ps1 rename to tools/Set-EnvVars.ps1 index 9d14d9aa0..3f6f86ba5 100644 --- a/azure-pipelines/Set-EnvVars.ps1 +++ b/tools/Set-EnvVars.ps1 @@ -4,8 +4,13 @@ Azure Pipeline and CMD environments are considered. .PARAMETER Variables A hashtable of variables to be set. +.PARAMETER PrependPath + A set of paths to prepend to the PATH environment variable. .OUTPUTS A boolean indicating whether the environment variables can be expected to propagate to the caller's environment. +.DESCRIPTION + The CmdEnvScriptPath environment variable may be optionally set to a path to a cmd shell script to be created (or appended to if it already exists) that will set the environment variables in cmd.exe that are set within the PowerShell environment. + This is used by init.cmd in order to reapply any new environment variables to the parent cmd.exe process that were set in the powershell child process. #> [CmdletBinding(SupportsShouldProcess=$true)] Param( @@ -18,7 +23,7 @@ if ($Variables.Count -eq 0) { return $true } -$cmdInstructions = !$env:TF_BUILD -and !$env:GITHUB_ACTIONS -and $env:PS1UnderCmd -eq '1' +$cmdInstructions = !$env:TF_BUILD -and !$env:GITHUB_ACTIONS -and !$env:CmdEnvScriptPath -and ($env:PS1UnderCmd -eq '1') if ($cmdInstructions) { Write-Warning "Environment variables have been set that will be lost because you're running under cmd.exe" Write-Host "Environment variables that must be set manually:" -ForegroundColor Blue @@ -38,6 +43,7 @@ if ($env:GITHUB_ACTIONS) { Write-Host "GitHub Actions detected. Logging commands will be used to propagate environment variables and prepend path." } +$CmdEnvScript = '' $Variables.GetEnumerator() |% { Set-Item -Path env:$($_.Key) -Value $_.Value @@ -46,12 +52,14 @@ $Variables.GetEnumerator() |% { Write-Host "##vso[task.setvariable variable=$($_.Key);]$($_.Value)" } if ($env:GITHUB_ACTIONS) { - Write-Host "::set-env name=$($_.Key)::$($_.Value)" + Add-Content -Path $env:GITHUB_ENV -Value "$($_.Key)=$($_.Value)" } if ($cmdInstructions) { Write-Host "SET $($_.Key)=$($_.Value)" } + + $CmdEnvScript += "SET $($_.Key)=$($_.Value)`r`n" } $pathDelimiter = ';' @@ -71,9 +79,19 @@ if ($PrependPath) { Write-Host "##vso[task.prependpath]$_" } if ($env:GITHUB_ACTIONS) { - Write-Host "::add-path::$_" + Add-Content -Path $env:GITHUB_PATH -Value $_ } + + $CmdEnvScript += "SET PATH=$_$pathDelimiter%PATH%" + } +} + +if ($env:CmdEnvScriptPath) { + if (Test-Path $env:CmdEnvScriptPath) { + $CmdEnvScript = (Get-Content -Path $env:CmdEnvScriptPath) + $CmdEnvScript } + + Set-Content -Path $env:CmdEnvScriptPath -Value $CmdEnvScript } return !$cmdInstructions diff --git a/version.json b/version.json index 007bf56e1..fff14ab3f 100644 --- a/version.json +++ b/version.json @@ -1,6 +1,6 @@ { "$schema": "https://raw.githubusercontent.com/dotnet/Nerdbank.GitVersioning/master/src/NerdBank.GitVersioning/version.schema.json", - "version": "2.2", + "version": "2.4", "publicReleaseRefSpec": [ "^refs/heads/master$", "^refs/heads/v1\\.x$",