Struct rust_rocket::client::Rocket

source ·
pub struct Rocket { /* private fields */ }
Expand description

The Rocket type. This contains the connected socket and other fields.

Implementations

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();

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);

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);

Get Track by name.

You should use get_track_mut to create a track.

Send a SetRow message.

This changes the current row on the tracker side.

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.
        _ => (),
    }
}

Trait Implementations

Formats the value using the given formatter. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.