pub struct Context { /* private fields */ }
Implementations
sourceimpl Context
impl Context
pub fn is_valid(&self) -> bool
sourcepub fn create_node(&self, name: &str) -> Result<Node>
pub fn create_node(&self, name: &str) -> Result<Node>
Create node with empty namespace and default options
Examples
let ctx = rclrust::init().unwrap();
let node = ctx.create_node("test_node").unwrap();
assert_eq!(&node.fully_qualified_name(), "/test_node");
sourcepub fn create_node_with_options(
&self,
name: &str,
options: &NodeOptions
) -> Result<Node>
pub fn create_node_with_options(
&self,
name: &str,
options: &NodeOptions
) -> Result<Node>
Create node with empty namespace and specified options
Examples
use rclrust::NodeOptions;
let ctx = rclrust::init().unwrap();
let options = NodeOptions::new();
let node = ctx.create_node_with_options("test_node", &options).unwrap();
assert_eq!(&node.fully_qualified_name(), "/test_node");
sourcepub fn create_node_with_ns(&self, name: &str, namespace: &str) -> Result<Node>
pub fn create_node_with_ns(&self, name: &str, namespace: &str) -> Result<Node>
Create node with namespace and default options
Examples
let ctx = rclrust::init().unwrap();
let node = ctx.create_node_with_ns("test_node", "ns").unwrap();
assert_eq!(&node.fully_qualified_name(), "/ns/test_node");
sourcepub fn create_node_with_ns_and_options(
&self,
name: &str,
namespace: &str,
options: &NodeOptions
) -> Result<Node>
pub fn create_node_with_ns_and_options(
&self,
name: &str,
namespace: &str,
options: &NodeOptions
) -> Result<Node>
Create node with empty namespace and specified options
Examples
use rclrust::NodeOptions;
let ctx = rclrust::init().unwrap();
let options = NodeOptions::new();
let node = ctx
.create_node_with_ns_and_options("test_node", "ns", &options)
.unwrap();
assert_eq!(&node.fully_qualified_name(), "/ns/test_node");
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for Context
impl Send for Context
impl Sync for Context
impl Unpin for Context
impl UnwindSafe for Context
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more