Grpc.Core.Marshaller-1.html 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341
  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 C# </title>
  9. <meta name="viewport" content="width=device-width">
  10. <meta name="title" content="Class Marshaller&lt;T&gt;
  11. | gRPC C# ">
  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. <div class="inheritedMembers">
  84. <h5>Inherited Members</h5>
  85. <div>
  86. <span class="xref">System.Object.Equals(System.Object)</span>
  87. </div>
  88. <div>
  89. <span class="xref">System.Object.Equals(System.Object, System.Object)</span>
  90. </div>
  91. <div>
  92. <span class="xref">System.Object.GetHashCode()</span>
  93. </div>
  94. <div>
  95. <span class="xref">System.Object.GetType()</span>
  96. </div>
  97. <div>
  98. <span class="xref">System.Object.MemberwiseClone()</span>
  99. </div>
  100. <div>
  101. <span class="xref">System.Object.ReferenceEquals(System.Object, System.Object)</span>
  102. </div>
  103. <div>
  104. <span class="xref">System.Object.ToString()</span>
  105. </div>
  106. </div>
  107. <h6><strong>Namespace</strong>: <a class="xref" href="Grpc.Core.html">Grpc.Core</a></h6>
  108. <h6><strong>Assembly</strong>: Grpc.Core.Api.dll</h6>
  109. <h5 id="Grpc_Core_Marshaller_1_syntax">Syntax</h5>
  110. <div class="codewrapper">
  111. <pre><code class="lang-csharp hljs">public class Marshaller&lt;T&gt;</code></pre>
  112. </div>
  113. <h5 class="typeParameters">Type Parameters</h5>
  114. <table class="table table-bordered table-striped table-condensed">
  115. <thead>
  116. <tr>
  117. <th>Name</th>
  118. <th>Description</th>
  119. </tr>
  120. </thead>
  121. <tbody>
  122. <tr>
  123. <td><span class="parametername">T</span></td>
  124. <td></td>
  125. </tr>
  126. </tbody>
  127. </table>
  128. <h3 id="constructors">Constructors
  129. </h3>
  130. <a id="Grpc_Core_Marshaller_1__ctor_" data-uid="Grpc.Core.Marshaller`1.#ctor*"></a>
  131. <h4 id="Grpc_Core_Marshaller_1__ctor_System_Action__0_Grpc_Core_SerializationContext__System_Func_Grpc_Core_DeserializationContext__0__" data-uid="Grpc.Core.Marshaller`1.#ctor(System.Action{`0,Grpc.Core.SerializationContext},System.Func{Grpc.Core.DeserializationContext,`0})">Marshaller(Action&lt;T, SerializationContext&gt;, Func&lt;DeserializationContext, T&gt;)</h4>
  132. <div class="markdown level1 summary"><p>Initializes a new marshaller from serialize/deserialize fuctions that can access serialization and deserialization
  133. context. Compared to the simple serializer/deserializer functions, using the contextual version provides more
  134. flexibility and can lead to increased efficiency (and better performance).
  135. Note: This constructor is part of an experimental API that can change or be removed without any prior notice.</p>
  136. </div>
  137. <div class="markdown level1 conceptual"></div>
  138. <h5 class="decalaration">Declaration</h5>
  139. <div class="codewrapper">
  140. <pre><code class="lang-csharp hljs">public Marshaller(Action&lt;T, SerializationContext&gt; serializer, Func&lt;DeserializationContext, T&gt; deserializer)</code></pre>
  141. </div>
  142. <h5 class="parameters">Parameters</h5>
  143. <table class="table table-bordered table-striped table-condensed">
  144. <thead>
  145. <tr>
  146. <th>Type</th>
  147. <th>Name</th>
  148. <th>Description</th>
  149. </tr>
  150. </thead>
  151. <tbody>
  152. <tr>
  153. <td><span class="xref">System.Action</span>&lt;T, <a class="xref" href="Grpc.Core.SerializationContext.html">SerializationContext</a>&gt;</td>
  154. <td><span class="parametername">serializer</span></td>
  155. <td><p>Function that will be used to serialize messages.</p>
  156. </td>
  157. </tr>
  158. <tr>
  159. <td><span class="xref">System.Func</span>&lt;<a class="xref" href="Grpc.Core.DeserializationContext.html">DeserializationContext</a>, T&gt;</td>
  160. <td><span class="parametername">deserializer</span></td>
  161. <td><p>Function that will be used to deserialize messages.</p>
  162. </td>
  163. </tr>
  164. </tbody>
  165. </table>
  166. <a id="Grpc_Core_Marshaller_1__ctor_" data-uid="Grpc.Core.Marshaller`1.#ctor*"></a>
  167. <h4 id="Grpc_Core_Marshaller_1__ctor_System_Func__0_System_Byte____System_Func_System_Byte____0__" data-uid="Grpc.Core.Marshaller`1.#ctor(System.Func{`0,System.Byte[]},System.Func{System.Byte[],`0})">Marshaller(Func&lt;T, Byte[]&gt;, Func&lt;Byte[], T&gt;)</h4>
  168. <div class="markdown level1 summary"><p>Initializes a new marshaller from simple serialize/deserialize functions.</p>
  169. </div>
  170. <div class="markdown level1 conceptual"></div>
  171. <h5 class="decalaration">Declaration</h5>
  172. <div class="codewrapper">
  173. <pre><code class="lang-csharp hljs">public Marshaller(Func&lt;T, byte[]&gt; serializer, Func&lt;byte[], T&gt; deserializer)</code></pre>
  174. </div>
  175. <h5 class="parameters">Parameters</h5>
  176. <table class="table table-bordered table-striped table-condensed">
  177. <thead>
  178. <tr>
  179. <th>Type</th>
  180. <th>Name</th>
  181. <th>Description</th>
  182. </tr>
  183. </thead>
  184. <tbody>
  185. <tr>
  186. <td><span class="xref">System.Func</span>&lt;T, <span class="xref">System.Byte</span>[]&gt;</td>
  187. <td><span class="parametername">serializer</span></td>
  188. <td><p>Function that will be used to serialize messages.</p>
  189. </td>
  190. </tr>
  191. <tr>
  192. <td><span class="xref">System.Func</span>&lt;<span class="xref">System.Byte</span>[], T&gt;</td>
  193. <td><span class="parametername">deserializer</span></td>
  194. <td><p>Function that will be used to deserialize messages.</p>
  195. </td>
  196. </tr>
  197. </tbody>
  198. </table>
  199. <h3 id="properties">Properties
  200. </h3>
  201. <a id="Grpc_Core_Marshaller_1_ContextualDeserializer_" data-uid="Grpc.Core.Marshaller`1.ContextualDeserializer*"></a>
  202. <h4 id="Grpc_Core_Marshaller_1_ContextualDeserializer" data-uid="Grpc.Core.Marshaller`1.ContextualDeserializer">ContextualDeserializer</h4>
  203. <div class="markdown level1 summary"><p>Gets the serializer function.
  204. Note: experimental API that can change or be removed without any prior notice.</p>
  205. </div>
  206. <div class="markdown level1 conceptual"></div>
  207. <h5 class="decalaration">Declaration</h5>
  208. <div class="codewrapper">
  209. <pre><code class="lang-csharp hljs">public Func&lt;DeserializationContext, T&gt; ContextualDeserializer { get; }</code></pre>
  210. </div>
  211. <h5 class="propertyValue">Property Value</h5>
  212. <table class="table table-bordered table-striped table-condensed">
  213. <thead>
  214. <tr>
  215. <th>Type</th>
  216. <th>Description</th>
  217. </tr>
  218. </thead>
  219. <tbody>
  220. <tr>
  221. <td><span class="xref">System.Func</span>&lt;<a class="xref" href="Grpc.Core.DeserializationContext.html">DeserializationContext</a>, T&gt;</td>
  222. <td></td>
  223. </tr>
  224. </tbody>
  225. </table>
  226. <a id="Grpc_Core_Marshaller_1_ContextualSerializer_" data-uid="Grpc.Core.Marshaller`1.ContextualSerializer*"></a>
  227. <h4 id="Grpc_Core_Marshaller_1_ContextualSerializer" data-uid="Grpc.Core.Marshaller`1.ContextualSerializer">ContextualSerializer</h4>
  228. <div class="markdown level1 summary"><p>Gets the serializer function.
  229. Note: experimental API that can change or be removed without any prior notice.</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 Action&lt;T, SerializationContext&gt; ContextualSerializer { 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">System.Action</span>&lt;T, <a class="xref" href="Grpc.Core.SerializationContext.html">SerializationContext</a>&gt;</td>
  247. <td></td>
  248. </tr>
  249. </tbody>
  250. </table>
  251. <a id="Grpc_Core_Marshaller_1_Deserializer_" data-uid="Grpc.Core.Marshaller`1.Deserializer*"></a>
  252. <h4 id="Grpc_Core_Marshaller_1_Deserializer" data-uid="Grpc.Core.Marshaller`1.Deserializer">Deserializer</h4>
  253. <div class="markdown level1 summary"><p>Gets the deserializer 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;byte[], T&gt; Deserializer { 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">System.Func</span>&lt;<span class="xref">System.Byte</span>[], T&gt;</td>
  271. <td></td>
  272. </tr>
  273. </tbody>
  274. </table>
  275. <a id="Grpc_Core_Marshaller_1_Serializer_" data-uid="Grpc.Core.Marshaller`1.Serializer*"></a>
  276. <h4 id="Grpc_Core_Marshaller_1_Serializer" data-uid="Grpc.Core.Marshaller`1.Serializer">Serializer</h4>
  277. <div class="markdown level1 summary"><p>Gets the serializer function.</p>
  278. </div>
  279. <div class="markdown level1 conceptual"></div>
  280. <h5 class="decalaration">Declaration</h5>
  281. <div class="codewrapper">
  282. <pre><code class="lang-csharp hljs">public Func&lt;T, byte[]&gt; Serializer { get; }</code></pre>
  283. </div>
  284. <h5 class="propertyValue">Property Value</h5>
  285. <table class="table table-bordered table-striped table-condensed">
  286. <thead>
  287. <tr>
  288. <th>Type</th>
  289. <th>Description</th>
  290. </tr>
  291. </thead>
  292. <tbody>
  293. <tr>
  294. <td><span class="xref">System.Func</span>&lt;T, <span class="xref">System.Byte</span>[]&gt;</td>
  295. <td></td>
  296. </tr>
  297. </tbody>
  298. </table>
  299. </article>
  300. </div>
  301. <div class="hidden-sm col-md-2" role="complementary">
  302. <div class="sideaffix">
  303. <nav class="bs-docs-sidebar hidden-print hidden-xs hidden-sm affix" id="affix">
  304. <!-- <p><a class="back-to-top" href="#top">Back to top</a><p> -->
  305. </nav>
  306. </div>
  307. </div>
  308. </div>
  309. </div>
  310. <footer>
  311. <div class="grad-bottom"></div>
  312. <div class="footer">
  313. <div class="container">
  314. <span class="pull-right">
  315. <a href="#top">Back to top</a>
  316. </span>
  317. <span>Generated by <strong>DocFX</strong></span>
  318. </div>
  319. </div>
  320. </footer>
  321. </div>
  322. <script type="text/javascript" src="../styles/docfx.vendor.js"></script>
  323. <script type="text/javascript" src="../styles/docfx.js"></script>
  324. <script type="text/javascript" src="../styles/main.js"></script>
  325. </body>
  326. </html>