Skip to main content

GraphQuery

Trait GraphQuery 

Source
pub trait GraphQuery {
Show 14 methods // Required methods fn get_node_names( &mut self, visit: &mut dyn FnMut(&str, &str) -> bool, ) -> Result<(), NodeError>; fn get_node_names_with_enclaves( &mut self, visit: &mut dyn FnMut(&str, &str, Option<&str>) -> bool, ) -> Result<(), NodeError>; fn get_topic_names_and_types( &mut self, visit: &mut dyn FnMut(&str, &[&str]) -> bool, ) -> Result<(), NodeError>; fn get_service_names_and_types( &mut self, visit: &mut dyn FnMut(&str, &[&str]) -> bool, ) -> Result<(), NodeError>; fn count_publishers(&mut self, topic_name: &str) -> Result<usize, NodeError>; fn count_subscriptions( &mut self, topic_name: &str, ) -> Result<usize, NodeError>; fn count_clients(&mut self, service_name: &str) -> Result<usize, NodeError>; fn count_services(&mut self, service_name: &str) -> Result<usize, NodeError>; fn get_publisher_names_and_types_by_node( &mut self, node_name: &str, node_namespace: &str, visit: &mut dyn FnMut(&str, &[&str]) -> bool, ) -> Result<(), NodeError>; fn get_subscription_names_and_types_by_node( &mut self, node_name: &str, node_namespace: &str, visit: &mut dyn FnMut(&str, &[&str]) -> bool, ) -> Result<(), NodeError>; fn get_service_names_and_types_by_node( &mut self, node_name: &str, node_namespace: &str, visit: &mut dyn FnMut(&str, &[&str]) -> bool, ) -> Result<(), NodeError>; fn get_client_names_and_types_by_node( &mut self, node_name: &str, node_namespace: &str, visit: &mut dyn FnMut(&str, &[&str]) -> bool, ) -> Result<(), NodeError>; fn get_publishers_info_by_topic( &mut self, topic_name: &str, visit: &mut dyn FnMut(&GraphEndpointInfo<'_>) -> bool, ) -> Result<(), NodeError>; fn get_subscriptions_info_by_topic( &mut self, topic_name: &str, visit: &mut dyn FnMut(&GraphEndpointInfo<'_>) -> bool, ) -> Result<(), NodeError>;
}
Expand description

The ROS graph queries a component context forwards: the fourteen the executor’s Node has, which are rclrs’s names, with the executor’s visitor signatures. Object-safe, so a context holds it as &mut dyn GraphQuery.

Every answer is what has been DISCOVERED and never blocks: an empty visit or a low count is “not seen yet”, never proof of absence, and Err(Transport(Unsupported)) from a backend with no graph is a different answer from empty.

An implementor reaches the executor’s session for the length of ONE call and keeps nothing: no session pointer outlives the query.

Required Methods§

Source

fn get_node_names( &mut self, visit: &mut dyn FnMut(&str, &str) -> bool, ) -> Result<(), NodeError>

visit(name, namespace) per node on the graph.

Source

fn get_node_names_with_enclaves( &mut self, visit: &mut dyn FnMut(&str, &str, Option<&str>) -> bool, ) -> Result<(), NodeError>

visit(name, namespace, enclave); enclave is None where the backend does not track one.

Source

fn get_topic_names_and_types( &mut self, visit: &mut dyn FnMut(&str, &[&str]) -> bool, ) -> Result<(), NodeError>

visit(topic, types) once per distinct topic.

Source

fn get_service_names_and_types( &mut self, visit: &mut dyn FnMut(&str, &[&str]) -> bool, ) -> Result<(), NodeError>

visit(service, types) once per distinct service.

Source

fn count_publishers(&mut self, topic_name: &str) -> Result<usize, NodeError>

Publishers visible on topic_name.

Source

fn count_subscriptions(&mut self, topic_name: &str) -> Result<usize, NodeError>

Subscriptions visible on topic_name.

Source

fn count_clients(&mut self, service_name: &str) -> Result<usize, NodeError>

Clients visible on service_name.

Source

fn count_services(&mut self, service_name: &str) -> Result<usize, NodeError>

Servers visible on service_name.

Source

fn get_publisher_names_and_types_by_node( &mut self, node_name: &str, node_namespace: &str, visit: &mut dyn FnMut(&str, &[&str]) -> bool, ) -> Result<(), NodeError>

The topics node node_name in node_namespace publishes.

Source

fn get_subscription_names_and_types_by_node( &mut self, node_name: &str, node_namespace: &str, visit: &mut dyn FnMut(&str, &[&str]) -> bool, ) -> Result<(), NodeError>

The topics node node_name in node_namespace subscribes to.

Source

fn get_service_names_and_types_by_node( &mut self, node_name: &str, node_namespace: &str, visit: &mut dyn FnMut(&str, &[&str]) -> bool, ) -> Result<(), NodeError>

The services node node_name in node_namespace serves.

Source

fn get_client_names_and_types_by_node( &mut self, node_name: &str, node_namespace: &str, visit: &mut dyn FnMut(&str, &[&str]) -> bool, ) -> Result<(), NodeError>

The services node node_name in node_namespace is a client of.

Source

fn get_publishers_info_by_topic( &mut self, topic_name: &str, visit: &mut dyn FnMut(&GraphEndpointInfo<'_>) -> bool, ) -> Result<(), NodeError>

The publishers on topic_name, one visit each.

Source

fn get_subscriptions_info_by_topic( &mut self, topic_name: &str, visit: &mut dyn FnMut(&GraphEndpointInfo<'_>) -> bool, ) -> Result<(), NodeError>

The subscriptions on topic_name, one visit each.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl GraphQuery for Executor<'_>

Available on crate feature rmw-cffi only.

The executor answers each query with its own graph method: the same session path its Node uses, never a second implementation.