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
sourceimpl Rocket
impl Rocket
sourcepub fn get_track_mut(&mut self, name: &str) -> &mut Track
pub fn get_track_mut(&mut self, name: &str) -> &mut Track
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);
sourcepub fn get_track(&self, name: &str) -> Option<&Track>
pub fn get_track(&self, name: &str) -> Option<&Track>
Get Track by name.
You should use get_track_mut
to create a track.
sourcepub fn set_row(&mut self, row: u32)
pub fn set_row(&mut self, row: u32)
Send a SetRow message.
This changes the current row on the tracker side.
sourcepub fn poll_events(&mut self) -> Option<Event>
pub fn poll_events(&mut self) -> Option<Event>
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
Auto Trait Implementations
impl RefUnwindSafe for Rocket
impl Send for Rocket
impl Sync for Rocket
impl Unpin for Rocket
impl UnwindSafe for Rocket
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more