Skip to content

Commit 501c097

Browse files
Revert internal .md files
1 parent ade2560 commit 501c097

File tree

4 files changed

+20
-120
lines changed

4 files changed

+20
-120
lines changed

docs/connector.md

Lines changed: 2 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,4 @@
11
# Connector and related utilities
22

3-
The [`Connector`] type is the entry point to the RTI Connector for Rust API.
4-
It wraps a DDS `DomainParticipant` configured from an XML file and is used
5-
to acquire [`Input`] and [`Output`] handles for reading and writing data.
6-
7-
## Typical flow
8-
9-
1. Create a `Connector` with [`Connector::new`], passing a participant name and
10-
the path to an XML configuration file.
11-
2. Acquire an [`Input`] or [`Output`] with [`Connector::get_input`] and
12-
[`Connector::get_output`].
13-
3. Use the `Input`/`Output` APIs to read or write samples.
14-
15-
```text
16-
let connector = Connector::new("MyLibrary::MyParticipant", "/path/to/App.xml")?;
17-
let input = connector.get_input("MySubscriber::MyReader")?;
18-
let output = connector.get_output("MyPublisher::MyWriter")?;
19-
```
20-
21-
## Ownership and blocking acquisition
22-
23-
`Connector` enforces thread-aware ownership for `Input` and `Output` instances.
24-
If a named entity is already in use, [`Connector::get_input`] and
25-
[`Connector::get_output`] will return an error. Use [`Connector::take_input`]
26-
or [`Connector::take_output`] to wait until the entity becomes available.
27-
28-
## Waiting for data
29-
30-
You can wait for any `Input` owned by the connector to receive data using
31-
[`Connector::wait_for_data`] or [`Connector::wait_for_data_with_timeout`].
32-
These calls do not read data; you still need to call [`Input::read`] or
33-
[`Input::take`] on the specific `Input` you want to process.
3+
This module contains everything related to the [`Connector`] abstraction,
4+
including methods to create [`Input`] and [`Output`] objects.

docs/input.md

Lines changed: 5 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,8 @@
1-
# Input, Sample, and related utilities
1+
# Input, Sample and related utilities
22

3-
The [`Input`] interface is used to read data samples from DDS topics. It wraps a
4-
`DataReader` configured in your XML file and provides a cached view of samples
5-
retrieved by [`Input::read`] or [`Input::take`].
3+
The [`Input`] interface is used to read data samples from DDS topics.
64

7-
## Reading data
5+
The [`Sample`] interface represents a data sample read from an [`Input`].
86

9-
Use [`Input::read`] to fill the local sample cache without removing samples from
10-
DDS, or [`Input::take`] to remove them from the reader. After either call, iterate
11-
samples using `for sample in input.into_iter()` or filter valid samples with
12-
[`ValidSampleIterator`]:
13-
14-
```text
15-
input.take()?;
16-
17-
for sample in input.into_iter().valid_only() {
18-
println!("Sample: {}", sample);
19-
}
20-
```
21-
22-
If you call `take`, you can return the loan with [`Input::return_loan`] after you
23-
finish processing.
24-
25-
## Waiting for data
26-
27-
To block until data is available, use [`Input::wait`] or
28-
[`Input::wait_with_timeout`]. These calls do not read data; they only wait for
29-
availability. You still need to call `read` or `take` to populate the cache.
30-
31-
## Accessing fields
32-
33-
A [`Sample`] provides typed accessors like [`Sample::get_number`],
34-
[`Sample::get_string`], and [`Sample::get_boolean`]. For dynamic access, use
35-
[`Sample::get_value`] which returns a [`SelectedValue`], or get a JSON string
36-
using [`Sample::get_value_json`]. You can also access sample info fields via
37-
[`Sample::get_info`] and [`Sample::get_info_json`].
38-
39-
## Matched publications
40-
41-
Use [`Input::wait_for_publications`] or [`Input::wait_for_publications_with_timeout`]
42-
to wait for writers, and [`Input::display_matched_publications`] to retrieve the
43-
matched publications as JSON.
7+
The [`SampleIterator`] interface provides an iterator over valid samples
8+
read from an [`Input`].

docs/output.md

Lines changed: 4 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,6 @@
1-
# Output, Instance, and related utilities
1+
# Output, Instance and related utilities
22

3-
The [`Output`] interface is used to write data out to a DDS domain. It wraps a
4-
`DataWriter` configured in your XML file and exposes a single writable
5-
[`Instance`] that represents the next sample to be published.
3+
The [`Output`] interface is used to write data out to a DDS domain.
64

7-
## Writing data
8-
9-
Modify the instance with `set_*` methods or JSON, then publish it using
10-
[`Output::write`]:
11-
12-
```text
13-
let mut instance = output.instance();
14-
instance.set_string("color", "BLUE")?;
15-
instance.set_number("x", 100.0)?;
16-
instance.set_number("y", 150.0)?;
17-
18-
output.write()?;
19-
```
20-
21-
For typed data, use [`Instance::serialize`] to serialize a struct via Serde.
22-
23-
## Write parameters
24-
25-
Use [`Output::write_with_params`] and [`WriteParams`] to control actions like
26-
`dispose` or `unregister`, or to attach timestamps and identities.
27-
28-
## Waiting and matching
29-
30-
You can wait for acknowledgments with [`Output::wait`] or
31-
[`Output::wait_with_timeout`], and you can wait for subscriptions with
32-
[`Output::wait_for_subscriptions`] or [`Output::wait_for_subscriptions_with_timeout`].
33-
Use [`Output::display_matched_subscriptions`] to retrieve matched subscriptions
34-
as JSON.
5+
The [`Instance`] interface is used to manipulate the data to be sent,
6+
and can be accessed by means of [`Output::instance`].

docs/result.md

Lines changed: 9 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,12 @@
1-
# Result types for error handling
1+
# Result types for Error Handling
22

3-
The `rtiddsconnector` API uses a small set of result types:
3+
The [`ConnectorError`] enum represents possible errors that can occur
4+
when using the Connector API.
45

5-
* [`ConnectorResult<T>`]: the standard result type for fallible operations.
6-
* [`ConnectorFallible`]: a convenience alias for `Result<(), ConnectorError>`.
7-
* [`ConnectorError`]: the error type used throughout the crate.
6+
The [`ConnectorResult`] type alias is used throughout the crate
7+
to represent operations that can succeed or fail with a
8+
[`ConnectorError`].
89

9-
## Inspecting errors
10-
11-
`ConnectorError` exposes helper methods to classify errors:
12-
13-
* [`ConnectorError::is_timeout`]
14-
* [`ConnectorError::is_entity_not_found`]
15-
* [`ConnectorError::is_field_not_found`]
16-
* [`ConnectorError::is_native_error`]
17-
* [`ConnectorError::last_error_message`]
18-
19-
These helpers allow you to handle common cases without depending on internal
20-
error kinds.
10+
The [`ConnectorFallible`] type alias is used for operations
11+
that can can fail with [`ConnectorError`] but that doesn't have a
12+
meaningful return value (it is `()`).

0 commit comments

Comments
 (0)