[−][src]Struct nt::NetworkTables
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 handle(&self) -> Handle
[src]
pub fn handle(&self) -> Handle
Returns a handle to this client
Allows indirect termination of the remote connection without moving self
into closures
pub fn call_rpc<F>(
&mut self,
id: u16,
args: RPCExecutionBody,
cb: F
) -> Result<(), Error> where
F: FnOnce(RPCResponseBody) + Send + 'static,
[src]
pub fn call_rpc<F>(
&mut self,
id: u16,
args: RPCExecutionBody,
cb: F
) -> Result<(), Error> where
F: FnOnce(RPCResponseBody) + Send + 'static,
Initiates an RPC request for the given id.
cb
will be called with the response body when the server has processed the request and returned
pub fn add_callback<F>(&mut self, action: CallbackType, cb: F) where
F: FnMut(&EntryData) + Send + 'static,
[src]
pub fn add_callback<F>(&mut self, action: CallbackType, cb: F) where
F: FnMut(&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 find_id_by_name(&self, name: &str) -> Option<u16>
[src]
pub fn find_id_by_name(&self, name: &str) -> Option<u16>
Attempts to find an entry with the name name
Returns Some with the id if an entry exists with that name. Returns None if there isn't an entry with that name
pub fn find_entries_by_type(&self, ty: EntryType) -> Vec<u16>
[src]
pub fn find_entries_by_type(&self, ty: EntryType) -> Vec<u16>
Find all the entries of type ty
Returns a Vec of entry ids
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
Blanket Implementations
impl<T> From for T
[src]
impl<T> From for T
impl<T, U> Into for T where
U: From<T>,
[src]
impl<T, U> Into for T where
U: From<T>,
impl<T, U> TryFrom for T where
T: From<U>,
[src]
impl<T, U> TryFrom for T where
T: From<U>,
type Error = !
try_from
)The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
impl<T> Borrow for T where
T: ?Sized,
[src]
impl<T> Borrow for T where
T: ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
impl<T> BorrowMut for T where
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
fn borrow_mut(&mut self) -> &mut T
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
try_from
)The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
impl<T> Any for T where
T: 'static + ?Sized,
[src]
impl<T> Any for T where
T: 'static + ?Sized,
fn get_type_id(&self) -> TypeId
[src]
fn get_type_id(&self) -> TypeId
impl<T> Erased for T
impl<T> Erased for T