Struct nt::NetworkTables [−][src]
pub struct NetworkTables { /* fields omitted */ }
Core struct representing a connection to a NetworkTables server
Methods
impl NetworkTables
[src]
impl NetworkTables
pub fn connect(
client_name: &'static str,
target: SocketAddr
) -> Result<NetworkTables>
[src]
pub fn connect(
client_name: &'static str,
target: SocketAddr
) -> Result<NetworkTables>
Performs the initial connection process to the given target
.
Assumes that target is a valid, running NetworkTables server.
Returns a new NetworkTables
once a connection has been established.
If any errors are returned when trying to perform the connection, returns an Err
pub fn add_callback<F>(&mut self, action: CallbackType, cb: F) where
F: Fn(&EntryData) + Send + 'static,
[src]
pub fn add_callback<F>(&mut self, action: CallbackType, cb: F) where
F: Fn(&EntryData) + Send + 'static,
Registers the given closure cb
as a callback to be called for CallbackType
action
When action
occurs due to either network or user events, all callbacks registered for that type will be called
pub fn entries(&self) -> HashMap<u16, EntryData>
[src]
pub fn entries(&self) -> HashMap<u16, EntryData>
Returns a clone of all the entries this client currently knows of.
pub fn get_entry(&self, id: u16) -> Entry
[src]
pub fn get_entry(&self, id: u16) -> Entry
Returns an Entry
for the given id
The underlying value of the entry cannot be mutated.
pub fn get_entry_mut(&mut self, id: u16) -> EntryMut
[src]
pub fn get_entry_mut(&mut self, id: u16) -> EntryMut
Returns an EntryMut
for the given id
The underlying value of the entry can be mutated through the given EntryMut
pub fn create_entry(&mut self, data: EntryData) -> u16
[src]
pub fn create_entry(&mut self, data: EntryData) -> u16
Creates a new entry with data contained in data
.
Returns the id of the new entry, once the server has assigned it
pub fn delete_all_entries(&mut self)
[src]
pub fn delete_all_entries(&mut self)
Deletes all entries from the server this client is currently connected to Must be used with care. Cannot be undone
pub fn connected(&self) -> bool
[src]
pub fn connected(&self) -> bool
Checks if the client is actively connected to an NT server true if the 3-way handshake has been completed, and the client is fully synchronized
Trait Implementations
impl Drop for NetworkTables
[src]
impl Drop for NetworkTables
Auto Trait Implementations
impl Send for NetworkTables
impl Send for NetworkTables
impl Sync for NetworkTables
impl Sync for NetworkTables