Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ zip = "5.1"
[dev-dependencies]
# std::assert_matches is still unstable
assert_matches = "1.5"
static_assertions = "1.1"
clap = { version = "4.5", features = ["derive"] }
regex = "1.11"
serde = { version = "*", features = ["derive"] }
Expand Down
4 changes: 2 additions & 2 deletions docs/guide/connector.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ loads a `<domain_participant>` from a `<domain_participant_library>`. For exampl

See a complete example in `examples/MyApplication.xml`.

> **Note:** Operations on the same `Connector` or its contained entities are not
> protected for multi-threaded access. See
> **Note:** Operations on the same `Connector` or its contained entities on
> different threads incur some caveats. See
> [Threading and ownership](crate::guide::threading) for guidance.

## Closing a connector
Expand Down
4 changes: 2 additions & 2 deletions docs/guide/getting_started.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ fn main() -> rtiddsconnector::ConnectorFallible {
let _globals = GlobalsDropGuard;

let connector = Connector::new("MyLibrary::MyParticipant", "/path/to/App.xml")?;
let mut output: Output<'_> = connector.get_output("MyPublisher::MyWriter")?;
let mut input: Input<'_> = connector.get_input("MySubscriber::MyReader")?;
let mut output: Output = connector.get_output("MyPublisher::MyWriter")?;
let mut input: Input = connector.get_input("MySubscriber::MyReader")?;

let mut instance = output.instance();
instance.set_number("x", 100.0)?;
Expand Down
2 changes: 1 addition & 1 deletion docs/guide/input.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ To read or take samples, first get a reference to the input:
```rust
use rtiddsconnector::{Connector, Input};

fn get_input(connector: &Connector) -> rtiddsconnector::ConnectorResult<Input<'_>> {
fn get_input(connector: &Connector) -> rtiddsconnector::ConnectorResult<Input> {
connector.get_input("MySubscriber::MyReader")
}
```
Expand Down
2 changes: 1 addition & 1 deletion docs/guide/output.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ To write a data sample, first look up an output:
```rust
use rtiddsconnector::{Connector, Output};

fn get_output(connector: &Connector) -> rtiddsconnector::ConnectorResult<Output<'_>> {
fn get_output(connector: &Connector) -> rtiddsconnector::ConnectorResult<Output> {
connector.get_output("MyPublisher::MyWriter")
}
```
Expand Down
4 changes: 3 additions & 1 deletion docs/guide/threading.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,6 @@ channels with the rest of your application.
While the connector uses internal locks for native access, this is not a
guarantee of safe concurrent access to the same `Input` or `Output`. Treat the
API as single-threaded unless you control synchronization at the application
level.
level. If you truly need to share an `Input` or `Output` across threads,
you can wrap these on top of `Arc<Mutex<T>>` to manage concurrency on the
application.
3 changes: 1 addition & 2 deletions docs/lib.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ the _RTI Connector_ API:
[omg-dds-xml]: https://www.omg.org/spec/DDS-XML/ "OMG DDS XML Specification"
[gh-connector]: https://github.com/rticommunity/rticonnextdds-connector "RTI Connector on Github"

# User Guide
## User Guide

Start here for a tour of the crate:

Expand All @@ -50,4 +50,3 @@ Start here for a tour of the crate:
* [Error handling](crate::guide::errors)
* [Threading and ownership](crate::guide::threading)
* [Advanced operations](crate::guide::advanced)

2 changes: 1 addition & 1 deletion snippets/output/using_instance.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use rtiddsconnector::{self, Output};

fn using_instance(output: &Output<'_>) -> rtiddsconnector::ConnectorFallible {
fn using_instance(output: &Output) -> rtiddsconnector::ConnectorFallible {
let mut instance = output.instance();

instance.set_number("x", 10.0)?;
Expand Down
4 changes: 2 additions & 2 deletions snippets/quickstart.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ fn start_using_connector() -> rtiddsconnector::ConnectorFallible {
let connector = Connector::new(XML_PARTICIPANT, XML_PATH)?;

// Fetch the Output associated with the Connector instance
let mut output: Output<'_> = connector.get_output(XML_OUTPUT)?;
let mut output: Output = connector.get_output(XML_OUTPUT)?;

// Modifies the data contained by the Output instance
let mut instance = output.instance();
Expand All @@ -49,7 +49,7 @@ fn start_using_connector() -> rtiddsconnector::ConnectorFallible {
output.write()?;

// Fetch the Input associated with the Connector instance
let mut input: Input<'_> = connector.get_input(XML_INPUT)?;
let mut input: Input = connector.get_input(XML_INPUT)?;

// Wait for the data to be available before actually retrieving the samples
input.wait_with_timeout(std::time::Duration::from_secs(5))?;
Expand Down
Loading