pub struct Master { /* private fields */ }
Implementations§
Source§impl Master
impl Master
pub fn new(url: &SocketAddr) -> Master
Sourcepub async fn serve(&self) -> Result<()>
pub async fn serve(&self) -> Result<()>
Starts the ROS core server and listens for incoming requests.
The server will listen on the URI specified during the construction of RosCoreServer
.
The server router will handle requests to both /
and /RPC2
.
§Returns
An anyhow::Result
indicating if the server started successfully or if there was an error.
§Examples
use ros_core_rs::core::Master;
use url::Url;
let socket_address = ros_core_rs::url_to_socket_addr(&Url::parse("http://0.0.0.0:11311").unwrap());
let core = Master::new(&socket_address.unwrap());
core.serve();
Auto Trait Implementations§
impl Freeze for Master
impl RefUnwindSafe for Master
impl Send for Master
impl Sync for Master
impl Unpin for Master
impl UnwindSafe for Master
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more