rosrust/tcpros/
mod.rs

1pub use self::client::{Client, ClientResponse};
2pub use self::error::Error;
3pub use self::publisher::{Publisher, PublisherStream};
4pub use self::service::Service;
5pub use self::subscriber::SubscriberRosConnection;
6
7use crate::rosmsg::RosMsg;
8use crate::Clock;
9use std::fmt::Debug;
10use std::sync::atomic::AtomicUsize;
11use std::sync::Arc;
12
13mod client;
14pub mod error;
15mod header;
16mod publisher;
17mod service;
18mod subscriber;
19mod util;
20
21pub type ServiceResult<T> = Result<T, String>;
22
23pub trait Message: Clone + Debug + Default + PartialEq + RosMsg + Send + Sync + 'static {
24    fn msg_definition() -> String;
25    fn md5sum() -> String;
26    fn msg_type() -> String;
27    fn set_header(&mut self, _clock: &Arc<dyn Clock>, _seq: &Arc<AtomicUsize>) {}
28}
29
30pub trait ServicePair: Clone + Debug + Default + PartialEq + Message {
31    type Request: RosMsg + Send + 'static;
32    type Response: RosMsg + Send + 'static;
33}
34
35#[derive(Clone, Debug)]
36pub struct Topic {
37    pub name: String,
38    pub msg_type: String,
39    pub md5sum: String,
40}