Grpc.Core.Marshaller-1.html 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317
  1. <!DOCTYPE html>
  2. <!--[if IE]><![endif]-->
  3. <html>
  4. <head>
  5. <meta charset="utf-8">
  6. <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  7. <title>Class Marshaller&lt;T&gt;
  8. | gRPC for .NET </title>
  9. <meta name="viewport" content="width=device-width">
  10. <meta name="title" content="Class Marshaller&lt;T&gt;
  11. | gRPC for .NET ">
  12. <meta name="generator" content="docfx 2.36.0.0">
  13. <link rel="shortcut icon" href="../favicon.ico">
  14. <link rel="stylesheet" href="../styles/docfx.vendor.css">
  15. <link rel="stylesheet" href="../styles/docfx.css">
  16. <link rel="stylesheet" href="../styles/main.css">
  17. <meta property="docfx:navrel" content="../toc.html">
  18. <meta property="docfx:tocrel" content="toc.html">
  19. <meta property="docfx:rel" content="../">
  20. </head>
  21. <body data-spy="scroll" data-target="#affix" data-offset="120">
  22. <div id="wrapper">
  23. <header>
  24. <nav id="autocollapse" class="navbar navbar-inverse ng-scope" role="navigation">
  25. <div class="container">
  26. <div class="navbar-header">
  27. <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#navbar">
  28. <span class="sr-only">Toggle navigation</span>
  29. <span class="icon-bar"></span>
  30. <span class="icon-bar"></span>
  31. <span class="icon-bar"></span>
  32. </button>
  33. <a class="navbar-brand" href="../index.html">
  34. <img id="logo" class="svg" src="../logo.svg" alt="">
  35. </a>
  36. </div>
  37. <div class="collapse navbar-collapse" id="navbar">
  38. <form class="navbar-form navbar-right" role="search" id="search">
  39. <div class="form-group">
  40. <input type="text" class="form-control" id="search-query" placeholder="Search" autocomplete="off">
  41. </div>
  42. </form>
  43. </div>
  44. </div>
  45. </nav>
  46. <div class="subnav navbar navbar-default">
  47. <div class="container hide-when-search" id="breadcrumb">
  48. <ul class="breadcrumb">
  49. <li></li>
  50. </ul>
  51. </div>
  52. </div>
  53. </header>
  54. <div class="container body-content">
  55. <div id="search-results">
  56. <div class="search-list"></div>
  57. <div class="sr-items">
  58. <p><i class="glyphicon glyphicon-refresh index-loading"></i></p>
  59. </div>
  60. <ul id="pagination"></ul>
  61. </div>
  62. </div>
  63. <div role="main" class="container body-content hide-when-search">
  64. <div class="sidenav hide-when-search">
  65. <a class="btn toc-toggle collapse" data-toggle="collapse" href="#sidetoggle" aria-expanded="false" aria-controls="sidetoggle">Show / Hide Table of Contents</a>
  66. <div class="sidetoggle collapse" id="sidetoggle">
  67. <div id="sidetoc"></div>
  68. </div>
  69. </div>
  70. <div class="article row grid-right">
  71. <div class="col-md-10">
  72. <article class="content wrap" id="_content" data-uid="Grpc.Core.Marshaller`1">
  73. <h1 id="Grpc_Core_Marshaller_1" data-uid="Grpc.Core.Marshaller`1" class="text-break">Class Marshaller&lt;T&gt;
  74. </h1>
  75. <div class="markdown level0 summary"><p>Encapsulates the logic for serializing and deserializing messages.</p>
  76. </div>
  77. <div class="markdown level0 conceptual"></div>
  78. <div class="inheritance">
  79. <h5>Inheritance</h5>
  80. <div class="level0"><span class="xref">System.Object</span></div>
  81. <div class="level1"><span class="xref">Marshaller&lt;T&gt;</span></div>
  82. </div>
  83. <h6><strong>Namespace</strong>: <a class="xref" href="Grpc.Core.html">Grpc.Core</a></h6>
  84. <h6><strong>Assembly</strong>: Grpc.Core.Api.dll</h6>
  85. <h5 id="Grpc_Core_Marshaller_1_syntax">Syntax</h5>
  86. <div class="codewrapper">
  87. <pre><code class="lang-csharp hljs">public class Marshaller&lt;T&gt; : object</code></pre>
  88. </div>
  89. <h5 class="typeParameters">Type Parameters</h5>
  90. <table class="table table-bordered table-striped table-condensed">
  91. <thead>
  92. <tr>
  93. <th>Name</th>
  94. <th>Description</th>
  95. </tr>
  96. </thead>
  97. <tbody>
  98. <tr>
  99. <td><span class="parametername">T</span></td>
  100. <td></td>
  101. </tr>
  102. </tbody>
  103. </table>
  104. <h3 id="constructors">Constructors
  105. </h3>
  106. <a id="Grpc_Core_Marshaller_1__ctor_" data-uid="Grpc.Core.Marshaller`1.#ctor*"></a>
  107. <h4 id="Grpc_Core_Marshaller_1__ctor_Action__0_Grpc_Core_SerializationContext__Func_Grpc_Core_DeserializationContext__0__" data-uid="Grpc.Core.Marshaller`1.#ctor(Action{`0,Grpc.Core.SerializationContext},Func{Grpc.Core.DeserializationContext,`0})">Marshaller(Action&lt;T, SerializationContext&gt;, Func&lt;DeserializationContext, T&gt;)</h4>
  108. <div class="markdown level1 summary"><p>Initializes a new marshaller from serialize/deserialize fuctions that can access serialization and deserialization
  109. context. Compared to the simple serializer/deserializer functions, using the contextual version provides more
  110. flexibility and can lead to increased efficiency (and better performance).
  111. Note: This constructor is part of an experimental API that can change or be removed without any prior notice.</p>
  112. </div>
  113. <div class="markdown level1 conceptual"></div>
  114. <h5 class="decalaration">Declaration</h5>
  115. <div class="codewrapper">
  116. <pre><code class="lang-csharp hljs">public Marshaller(Action&lt;T, SerializationContext&gt; serializer, Func&lt;DeserializationContext, T&gt; deserializer)</code></pre>
  117. </div>
  118. <h5 class="parameters">Parameters</h5>
  119. <table class="table table-bordered table-striped table-condensed">
  120. <thead>
  121. <tr>
  122. <th>Type</th>
  123. <th>Name</th>
  124. <th>Description</th>
  125. </tr>
  126. </thead>
  127. <tbody>
  128. <tr>
  129. <td><span class="xref">Action</span>&lt;T, <a class="xref" href="Grpc.Core.SerializationContext.html">SerializationContext</a>&gt;</td>
  130. <td><span class="parametername">serializer</span></td>
  131. <td><p>Function that will be used to serialize messages.</p>
  132. </td>
  133. </tr>
  134. <tr>
  135. <td><span class="xref">Func</span>&lt;<a class="xref" href="Grpc.Core.DeserializationContext.html">DeserializationContext</a>, T&gt;</td>
  136. <td><span class="parametername">deserializer</span></td>
  137. <td><p>Function that will be used to deserialize messages.</p>
  138. </td>
  139. </tr>
  140. </tbody>
  141. </table>
  142. <a id="Grpc_Core_Marshaller_1__ctor_" data-uid="Grpc.Core.Marshaller`1.#ctor*"></a>
  143. <h4 id="Grpc_Core_Marshaller_1__ctor_Func__0_System_Byte____Func_System_Byte____0__" data-uid="Grpc.Core.Marshaller`1.#ctor(Func{`0,System.Byte[]},Func{System.Byte[],`0})">Marshaller(Func&lt;T, Byte[]&gt;, Func&lt;Byte[], T&gt;)</h4>
  144. <div class="markdown level1 summary"><p>Initializes a new marshaller from simple serialize/deserialize functions.</p>
  145. </div>
  146. <div class="markdown level1 conceptual"></div>
  147. <h5 class="decalaration">Declaration</h5>
  148. <div class="codewrapper">
  149. <pre><code class="lang-csharp hljs">public Marshaller(Func&lt;T, byte[]&gt; serializer, Func&lt;byte[], T&gt; deserializer)</code></pre>
  150. </div>
  151. <h5 class="parameters">Parameters</h5>
  152. <table class="table table-bordered table-striped table-condensed">
  153. <thead>
  154. <tr>
  155. <th>Type</th>
  156. <th>Name</th>
  157. <th>Description</th>
  158. </tr>
  159. </thead>
  160. <tbody>
  161. <tr>
  162. <td><span class="xref">Func</span>&lt;T, <span class="xref">System.Byte</span>[]&gt;</td>
  163. <td><span class="parametername">serializer</span></td>
  164. <td><p>Function that will be used to serialize messages.</p>
  165. </td>
  166. </tr>
  167. <tr>
  168. <td><span class="xref">Func</span>&lt;<span class="xref">System.Byte</span>[], T&gt;</td>
  169. <td><span class="parametername">deserializer</span></td>
  170. <td><p>Function that will be used to deserialize messages.</p>
  171. </td>
  172. </tr>
  173. </tbody>
  174. </table>
  175. <h3 id="properties">Properties
  176. </h3>
  177. <a id="Grpc_Core_Marshaller_1_ContextualDeserializer_" data-uid="Grpc.Core.Marshaller`1.ContextualDeserializer*"></a>
  178. <h4 id="Grpc_Core_Marshaller_1_ContextualDeserializer" data-uid="Grpc.Core.Marshaller`1.ContextualDeserializer">ContextualDeserializer</h4>
  179. <div class="markdown level1 summary"><p>Gets the serializer function.
  180. Note: experimental API that can change or be removed without any prior notice.</p>
  181. </div>
  182. <div class="markdown level1 conceptual"></div>
  183. <h5 class="decalaration">Declaration</h5>
  184. <div class="codewrapper">
  185. <pre><code class="lang-csharp hljs">public Func&lt;DeserializationContext, T&gt; ContextualDeserializer { get; }</code></pre>
  186. </div>
  187. <h5 class="propertyValue">Property Value</h5>
  188. <table class="table table-bordered table-striped table-condensed">
  189. <thead>
  190. <tr>
  191. <th>Type</th>
  192. <th>Description</th>
  193. </tr>
  194. </thead>
  195. <tbody>
  196. <tr>
  197. <td><span class="xref">Func</span>&lt;<a class="xref" href="Grpc.Core.DeserializationContext.html">DeserializationContext</a>, T&gt;</td>
  198. <td></td>
  199. </tr>
  200. </tbody>
  201. </table>
  202. <a id="Grpc_Core_Marshaller_1_ContextualSerializer_" data-uid="Grpc.Core.Marshaller`1.ContextualSerializer*"></a>
  203. <h4 id="Grpc_Core_Marshaller_1_ContextualSerializer" data-uid="Grpc.Core.Marshaller`1.ContextualSerializer">ContextualSerializer</h4>
  204. <div class="markdown level1 summary"><p>Gets the serializer function.
  205. Note: experimental API that can change or be removed without any prior notice.</p>
  206. </div>
  207. <div class="markdown level1 conceptual"></div>
  208. <h5 class="decalaration">Declaration</h5>
  209. <div class="codewrapper">
  210. <pre><code class="lang-csharp hljs">public Action&lt;T, SerializationContext&gt; ContextualSerializer { get; }</code></pre>
  211. </div>
  212. <h5 class="propertyValue">Property Value</h5>
  213. <table class="table table-bordered table-striped table-condensed">
  214. <thead>
  215. <tr>
  216. <th>Type</th>
  217. <th>Description</th>
  218. </tr>
  219. </thead>
  220. <tbody>
  221. <tr>
  222. <td><span class="xref">Action</span>&lt;T, <a class="xref" href="Grpc.Core.SerializationContext.html">SerializationContext</a>&gt;</td>
  223. <td></td>
  224. </tr>
  225. </tbody>
  226. </table>
  227. <a id="Grpc_Core_Marshaller_1_Deserializer_" data-uid="Grpc.Core.Marshaller`1.Deserializer*"></a>
  228. <h4 id="Grpc_Core_Marshaller_1_Deserializer" data-uid="Grpc.Core.Marshaller`1.Deserializer">Deserializer</h4>
  229. <div class="markdown level1 summary"><p>Gets the deserializer function.</p>
  230. </div>
  231. <div class="markdown level1 conceptual"></div>
  232. <h5 class="decalaration">Declaration</h5>
  233. <div class="codewrapper">
  234. <pre><code class="lang-csharp hljs">public Func&lt;byte[], T&gt; Deserializer { get; }</code></pre>
  235. </div>
  236. <h5 class="propertyValue">Property Value</h5>
  237. <table class="table table-bordered table-striped table-condensed">
  238. <thead>
  239. <tr>
  240. <th>Type</th>
  241. <th>Description</th>
  242. </tr>
  243. </thead>
  244. <tbody>
  245. <tr>
  246. <td><span class="xref">Func</span>&lt;<span class="xref">System.Byte</span>[], T&gt;</td>
  247. <td></td>
  248. </tr>
  249. </tbody>
  250. </table>
  251. <a id="Grpc_Core_Marshaller_1_Serializer_" data-uid="Grpc.Core.Marshaller`1.Serializer*"></a>
  252. <h4 id="Grpc_Core_Marshaller_1_Serializer" data-uid="Grpc.Core.Marshaller`1.Serializer">Serializer</h4>
  253. <div class="markdown level1 summary"><p>Gets the serializer function.</p>
  254. </div>
  255. <div class="markdown level1 conceptual"></div>
  256. <h5 class="decalaration">Declaration</h5>
  257. <div class="codewrapper">
  258. <pre><code class="lang-csharp hljs">public Func&lt;T, byte[]&gt; Serializer { get; }</code></pre>
  259. </div>
  260. <h5 class="propertyValue">Property Value</h5>
  261. <table class="table table-bordered table-striped table-condensed">
  262. <thead>
  263. <tr>
  264. <th>Type</th>
  265. <th>Description</th>
  266. </tr>
  267. </thead>
  268. <tbody>
  269. <tr>
  270. <td><span class="xref">Func</span>&lt;T, <span class="xref">System.Byte</span>[]&gt;</td>
  271. <td></td>
  272. </tr>
  273. </tbody>
  274. </table>
  275. </article>
  276. </div>
  277. <div class="hidden-sm col-md-2" role="complementary">
  278. <div class="sideaffix">
  279. <nav class="bs-docs-sidebar hidden-print hidden-xs hidden-sm affix" id="affix">
  280. <!-- <p><a class="back-to-top" href="#top">Back to top</a><p> -->
  281. </nav>
  282. </div>
  283. </div>
  284. </div>
  285. </div>
  286. <footer>
  287. <div class="grad-bottom"></div>
  288. <div class="footer">
  289. <div class="container">
  290. <span class="pull-right">
  291. <a href="#top">Back to top</a>
  292. </span>
  293. <span>Generated by <strong>DocFX</strong></span>
  294. </div>
  295. </div>
  296. </footer>
  297. </div>
  298. <script type="text/javascript" src="../styles/docfx.vendor.js"></script>
  299. <script type="text/javascript" src="../styles/docfx.js"></script>
  300. <script type="text/javascript" src="../styles/main.js"></script>
  301. </body>
  302. </html>