Skip to content

Commit 9f9e69c

Browse files
committed
deploy: fcae1f1
1 parent a303f12 commit 9f9e69c

File tree

8 files changed

+605
-17
lines changed

8 files changed

+605
-17
lines changed

api/message_types.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ <h2 id="protobufmessaget"><a class="header" href="#protobufmessaget"><code>Proto
179179
<i class="fa fa-angle-left"></i>
180180
</a>
181181

182-
<a rel="next prefetch" href="../project_status.html" class="mobile-nav-chapters next" title="Next chapter" aria-label="Next chapter" aria-keyshortcuts="Right">
182+
<a rel="next prefetch" href="../api/service_server.html" class="mobile-nav-chapters next" title="Next chapter" aria-label="Next chapter" aria-keyshortcuts="Right">
183183
<i class="fa fa-angle-right"></i>
184184
</a>
185185

@@ -193,7 +193,7 @@ <h2 id="protobufmessaget"><a class="header" href="#protobufmessaget"><code>Proto
193193
<i class="fa fa-angle-left"></i>
194194
</a>
195195

196-
<a rel="next prefetch" href="../project_status.html" class="nav-chapters next" title="Next chapter" aria-label="Next chapter" aria-keyshortcuts="Right">
196+
<a rel="next prefetch" href="../api/service_server.html" class="nav-chapters next" title="Next chapter" aria-label="Next chapter" aria-keyshortcuts="Right">
197197
<i class="fa fa-angle-right"></i>
198198
</a>
199199
</nav>

api/service_client.html

Lines changed: 253 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,253 @@
1+
<!DOCTYPE HTML>
2+
<html lang="en" class="light sidebar-visible" dir="ltr">
3+
<head>
4+
<!-- Book generated using mdBook -->
5+
<meta charset="UTF-8">
6+
<title>Service Client - rustecal Documentation</title>
7+
8+
9+
<!-- Custom HTML head -->
10+
11+
<meta name="description" content="">
12+
<meta name="viewport" content="width=device-width, initial-scale=1">
13+
<meta name="theme-color" content="#ffffff">
14+
15+
<link rel="icon" href="../favicon.svg">
16+
<link rel="shortcut icon" href="../favicon.png">
17+
<link rel="stylesheet" href="../css/variables.css">
18+
<link rel="stylesheet" href="../css/general.css">
19+
<link rel="stylesheet" href="../css/chrome.css">
20+
<link rel="stylesheet" href="../css/print.css" media="print">
21+
22+
<!-- Fonts -->
23+
<link rel="stylesheet" href="../FontAwesome/css/font-awesome.css">
24+
<link rel="stylesheet" href="../fonts/fonts.css">
25+
26+
<!-- Highlight.js Stylesheets -->
27+
<link rel="stylesheet" id="highlight-css" href="../highlight.css">
28+
<link rel="stylesheet" id="tomorrow-night-css" href="../tomorrow-night.css">
29+
<link rel="stylesheet" id="ayu-highlight-css" href="../ayu-highlight.css">
30+
31+
<!-- Custom theme stylesheets -->
32+
33+
34+
<!-- Provide site root and default themes to javascript -->
35+
<script>
36+
const path_to_root = "../";
37+
const default_light_theme = "light";
38+
const default_dark_theme = "navy";
39+
</script>
40+
<!-- Start loading toc.js asap -->
41+
<script src="../toc.js"></script>
42+
</head>
43+
<body>
44+
<div id="body-container">
45+
<!-- Work around some values being stored in localStorage wrapped in quotes -->
46+
<script>
47+
try {
48+
let theme = localStorage.getItem('mdbook-theme');
49+
let sidebar = localStorage.getItem('mdbook-sidebar');
50+
51+
if (theme.startsWith('"') && theme.endsWith('"')) {
52+
localStorage.setItem('mdbook-theme', theme.slice(1, theme.length - 1));
53+
}
54+
55+
if (sidebar.startsWith('"') && sidebar.endsWith('"')) {
56+
localStorage.setItem('mdbook-sidebar', sidebar.slice(1, sidebar.length - 1));
57+
}
58+
} catch (e) { }
59+
</script>
60+
61+
<!-- Set the theme before any content is loaded, prevents flash -->
62+
<script>
63+
const default_theme = window.matchMedia("(prefers-color-scheme: dark)").matches ? default_dark_theme : default_light_theme;
64+
let theme;
65+
try { theme = localStorage.getItem('mdbook-theme'); } catch(e) { }
66+
if (theme === null || theme === undefined) { theme = default_theme; }
67+
const html = document.documentElement;
68+
html.classList.remove('light')
69+
html.classList.add(theme);
70+
html.classList.add("js");
71+
</script>
72+
73+
<input type="checkbox" id="sidebar-toggle-anchor" class="hidden">
74+
75+
<!-- Hide / unhide sidebar before it is displayed -->
76+
<script>
77+
let sidebar = null;
78+
const sidebar_toggle = document.getElementById("sidebar-toggle-anchor");
79+
if (document.body.clientWidth >= 1080) {
80+
try { sidebar = localStorage.getItem('mdbook-sidebar'); } catch(e) { }
81+
sidebar = sidebar || 'visible';
82+
} else {
83+
sidebar = 'hidden';
84+
}
85+
sidebar_toggle.checked = sidebar === 'visible';
86+
html.classList.remove('sidebar-visible');
87+
html.classList.add("sidebar-" + sidebar);
88+
</script>
89+
90+
<nav id="sidebar" class="sidebar" aria-label="Table of contents">
91+
<!-- populated by js -->
92+
<mdbook-sidebar-scrollbox class="sidebar-scrollbox"></mdbook-sidebar-scrollbox>
93+
<noscript>
94+
<iframe class="sidebar-iframe-outer" src="../toc.html"></iframe>
95+
</noscript>
96+
<div id="sidebar-resize-handle" class="sidebar-resize-handle">
97+
<div class="sidebar-resize-indicator"></div>
98+
</div>
99+
</nav>
100+
101+
<div id="page-wrapper" class="page-wrapper">
102+
103+
<div class="page">
104+
<div id="menu-bar-hover-placeholder"></div>
105+
<div id="menu-bar" class="menu-bar sticky">
106+
<div class="left-buttons">
107+
<label id="sidebar-toggle" class="icon-button" for="sidebar-toggle-anchor" title="Toggle Table of Contents" aria-label="Toggle Table of Contents" aria-controls="sidebar">
108+
<i class="fa fa-bars"></i>
109+
</label>
110+
<button id="theme-toggle" class="icon-button" type="button" title="Change theme" aria-label="Change theme" aria-haspopup="true" aria-expanded="false" aria-controls="theme-list">
111+
<i class="fa fa-paint-brush"></i>
112+
</button>
113+
<ul id="theme-list" class="theme-popup" aria-label="Themes" role="menu">
114+
<li role="none"><button role="menuitem" class="theme" id="default_theme">Auto</button></li>
115+
<li role="none"><button role="menuitem" class="theme" id="light">Light</button></li>
116+
<li role="none"><button role="menuitem" class="theme" id="rust">Rust</button></li>
117+
<li role="none"><button role="menuitem" class="theme" id="coal">Coal</button></li>
118+
<li role="none"><button role="menuitem" class="theme" id="navy">Navy</button></li>
119+
<li role="none"><button role="menuitem" class="theme" id="ayu">Ayu</button></li>
120+
</ul>
121+
<button id="search-toggle" class="icon-button" type="button" title="Search. (Shortkey: s)" aria-label="Toggle Searchbar" aria-expanded="false" aria-keyshortcuts="S" aria-controls="searchbar">
122+
<i class="fa fa-search"></i>
123+
</button>
124+
</div>
125+
126+
<h1 class="menu-title">rustecal Documentation</h1>
127+
128+
<div class="right-buttons">
129+
<a href="../print.html" title="Print this book" aria-label="Print this book">
130+
<i id="print-button" class="fa fa-print"></i>
131+
</a>
132+
133+
</div>
134+
</div>
135+
136+
<div id="search-wrapper" class="hidden">
137+
<form id="searchbar-outer" class="searchbar-outer">
138+
<input type="search" id="searchbar" name="searchbar" placeholder="Search this book ..." aria-controls="searchresults-outer" aria-describedby="searchresults-header">
139+
</form>
140+
<div id="searchresults-outer" class="searchresults-outer hidden">
141+
<div id="searchresults-header" class="searchresults-header"></div>
142+
<ul id="searchresults">
143+
</ul>
144+
</div>
145+
</div>
146+
147+
<!-- Apply ARIA attributes after the sidebar and the sidebar toggle button are added to the DOM -->
148+
<script>
149+
document.getElementById('sidebar-toggle').setAttribute('aria-expanded', sidebar === 'visible');
150+
document.getElementById('sidebar').setAttribute('aria-hidden', sidebar !== 'visible');
151+
Array.from(document.querySelectorAll('#sidebar a')).forEach(function(link) {
152+
link.setAttribute('tabIndex', sidebar === 'visible' ? 0 : -1);
153+
});
154+
</script>
155+
156+
<div id="content" class="content">
157+
<main>
158+
<h1 id="service-client"><a class="header" href="#service-client">Service Client</a></h1>
159+
<p>The <code>ServiceClient</code> API allows a Rust application to call eCAL services, either generically or per-instance.</p>
160+
<h2 id="connecting-to-a-service"><a class="header" href="#connecting-to-a-service">Connecting to a Service</a></h2>
161+
<pre><pre class="playground"><code class="language-rust"><span class="boring">#![allow(unused)]
162+
</span><span class="boring">fn main() {
163+
</span>use rustecal::service::client::ServiceClient;
164+
165+
let client = ServiceClient::new("mirror")?;
166+
<span class="boring">}</span></code></pre></pre>
167+
<h2 id="calling-methods"><a class="header" href="#calling-methods">Calling Methods</a></h2>
168+
<pre><pre class="playground"><code class="language-rust"><span class="boring">#![allow(unused)]
169+
</span><span class="boring">fn main() {
170+
</span>use rustecal::service::types::ServiceRequest;
171+
172+
let request = ServiceRequest {
173+
payload: b"stressed".to_vec(),
174+
};
175+
176+
let response = client.call("echo", request, Some(1000));
177+
<span class="boring">}</span></code></pre></pre>
178+
<p>To call all connected instances:</p>
179+
<pre><pre class="playground"><code class="language-rust"><span class="boring">#![allow(unused)]
180+
</span><span class="boring">fn main() {
181+
</span>for instance in client.get_client_instances() {
182+
let response = instance.call("reverse", request.clone(), Some(1000));
183+
}
184+
<span class="boring">}</span></code></pre></pre>
185+
<h2 id="return-handling"><a class="header" href="#return-handling">Return Handling</a></h2>
186+
<pre><pre class="playground"><code class="language-rust"><span class="boring">#![allow(unused)]
187+
</span><span class="boring">fn main() {
188+
</span>match response {
189+
Some(res) if res.success =&gt; {
190+
println!("Response: {}", String::from_utf8_lossy(&amp;res.payload));
191+
}
192+
Some(res) =&gt; {
193+
println!("Error: {}", res.error_msg.unwrap_or("Unknown error".into()));
194+
}
195+
None =&gt; {
196+
println!("No response or timeout.");
197+
}
198+
}
199+
<span class="boring">}</span></code></pre></pre>
200+
<h2 id="runtime-compatibility"><a class="header" href="#runtime-compatibility">Runtime Compatibility</a></h2>
201+
<p>This API matches the usage and behavior of <code>mirror_client.cpp</code> in the eCAL C++ samples.</p>
202+
203+
</main>
204+
205+
<nav class="nav-wrapper" aria-label="Page navigation">
206+
<!-- Mobile navigation buttons -->
207+
<a rel="prev" href="../api/service_server.html" class="mobile-nav-chapters previous" title="Previous chapter" aria-label="Previous chapter" aria-keyshortcuts="Left">
208+
<i class="fa fa-angle-left"></i>
209+
</a>
210+
211+
<a rel="next prefetch" href="../project_status.html" class="mobile-nav-chapters next" title="Next chapter" aria-label="Next chapter" aria-keyshortcuts="Right">
212+
<i class="fa fa-angle-right"></i>
213+
</a>
214+
215+
<div style="clear: both"></div>
216+
</nav>
217+
</div>
218+
</div>
219+
220+
<nav class="nav-wide-wrapper" aria-label="Page navigation">
221+
<a rel="prev" href="../api/service_server.html" class="nav-chapters previous" title="Previous chapter" aria-label="Previous chapter" aria-keyshortcuts="Left">
222+
<i class="fa fa-angle-left"></i>
223+
</a>
224+
225+
<a rel="next prefetch" href="../project_status.html" class="nav-chapters next" title="Next chapter" aria-label="Next chapter" aria-keyshortcuts="Right">
226+
<i class="fa fa-angle-right"></i>
227+
</a>
228+
</nav>
229+
230+
</div>
231+
232+
233+
234+
235+
<script>
236+
window.playground_copyable = true;
237+
</script>
238+
239+
240+
<script src="../elasticlunr.min.js"></script>
241+
<script src="../mark.min.js"></script>
242+
<script src="../searcher.js"></script>
243+
244+
<script src="../clipboard.min.js"></script>
245+
<script src="../highlight.js"></script>
246+
<script src="../book.js"></script>
247+
248+
<!-- Custom JS scripts -->
249+
250+
251+
</div>
252+
</body>
253+
</html>

0 commit comments

Comments
 (0)