[][src]Struct nt::NetworkTables

pub struct NetworkTables { /* fields omitted */ }

Core struct representing a connection to a NetworkTables server

Methods

impl NetworkTables[src]

pub fn connect(
    client_name: &'static str,
    target: SocketAddr
) -> Result<NetworkTables>
[src]

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]

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]

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]

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]

Returns a clone of all the entries this client currently knows of.

pub fn get_entry(&self, id: u16) -> Entry[src]

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]

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]

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]

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]

Find all the entries of type ty Returns a Vec of entry ids

pub fn delete_all_entries(&mut self)[src]

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]

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]

Auto Trait Implementations

Blanket Implementations

impl<T> From for T[src]

impl<T, U> Into for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T> BorrowMut for T where
    T: ?Sized
[src]

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Erased for T