pub struct NtConn<'nt> { /* private fields */ }Expand description
A NetworkTables connection
Implementations§
Source§impl<'nt> NtConn<'nt>
impl<'nt> NtConn<'nt>
Sourcepub async fn new(
server: impl Into<IpAddr>,
client_ident: impl Into<String>,
) -> Result<Self, Box<dyn Error>>
pub async fn new( server: impl Into<IpAddr>, client_ident: impl Into<String>, ) -> Result<Self, Box<dyn Error>>
Connect to a NetworkTables server
Sourcepub async fn publish<T: DataType>(
&self,
name: impl Into<String>,
) -> Result<NtTopic<'_, T>, Box<dyn Error>>
pub async fn publish<T: DataType>( &self, name: impl Into<String>, ) -> Result<NtTopic<'_, T>, Box<dyn Error>>
Publish a topic
The topic will be unpublished when the NtTopic is dropped.
Sourcepub fn subscribe(&mut self, topics: &[&str]) -> Result<(), Box<dyn Error>>
pub fn subscribe(&mut self, topics: &[&str]) -> Result<(), Box<dyn Error>>
Subscribe to topic(s)
Auto Trait Implementations§
impl<'nt> !Freeze for NtConn<'nt>
impl<'nt> !RefUnwindSafe for NtConn<'nt>
impl<'nt> Send for NtConn<'nt>
impl<'nt> Sync for NtConn<'nt>
impl<'nt> Unpin for NtConn<'nt>
impl<'nt> UnsafeUnpin for NtConn<'nt>
impl<'nt> UnwindSafe for NtConn<'nt>
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