Struct rust_rocket::client::Rocket
[−]
[src]
pub struct Rocket { /* fields omitted */ }The Rocket type. This contains the connected socket and other fields.
Methods
impl Rocket[src]
pub fn new() -> Result<Rocket, RocketErr>[src]
Construct a new Rocket.
This constructs a new rocket and connect to localhost on port 1338.
Errors
If a connection cannot be established, or if the handshake fails.
This will raise a RocketErr.
Examples
use rust_rocket::Rocket; let mut rocket = Rocket::new();
pub fn connect(host: &str, port: u16) -> Result<Rocket, RocketErr>[src]
Construct a new Rocket.
This constructs a new rocket and connects to a specified host and port.
Errors
If a connection cannot be established, or if the handshake fails.
This will raise a RocketErr.
Examples
use rust_rocket::Rocket; let mut rocket = Rocket::connect("localhost", 1338);
pub fn get_track_mut(&mut self, name: &str) -> &mut Track[src]
Get a track by name.
If the track does not yet exist it will be created.
Examples
let track = rocket.get_track_mut("namespace:track"); track.get_value(3.5);
pub fn get_track(&self, name: &str) -> Option<&Track>[src]
Get Track by name.
You should use get_track_mut to create a track.
pub fn set_row(&mut self, row: u32)[src]
Send a SetRow message.
This changes the current row on the tracker side.
pub fn poll_events(&mut self) -> Option<Event>[src]
Poll for new events from the tracker.
This polls from events from the tracker. You should call this fairly often your main loop. It is recommended to keep calling this as long as your receive Some(Event).
Examples
while let Some(event) = rocket.poll_events() { match event { // Do something with the various events. _ => (), } }