pub struct GameClient<S: PlayConnection> {
pub state: GameState,
/* private fields */
}Fields§
§state: GameStateImplementations§
Source§impl<S: PlayConnection> GameClient<S>
impl<S: PlayConnection> GameClient<S>
pub fn new(session: S) -> Self
pub fn entity_id(&self) -> EntityId
pub async fn wait_until_ready(&mut self) -> Result<()>
Sourcepub fn drain_events(&mut self)
pub fn drain_events(&mut self)
Drain all pending server events (non-blocking).
Sourcepub async fn next_event(&mut self) -> Option<SessionEvent>
pub async fn next_event(&mut self) -> Option<SessionEvent>
Wait for the next server event.
pub async fn handle_event(&mut self, event: SessionEvent) -> Result<()>
pub fn is_connected(&self) -> bool
pub fn toggle_stats(&mut self)
pub async fn move_by(&mut self, forward: f32, strafe: f32) -> Result<()>
pub async fn harvest_nearest(&mut self) -> Result<()>
pub async fn craft_next_available(&mut self) -> Result<()>
pub async fn craft(&mut self, blueprint_id: &str) -> Result<()>
pub async fn interact_nearest(&mut self) -> Result<()>
pub async fn test_damage(&mut self, amount: f32) -> Result<()>
pub async fn say(&mut self, channel: ChatChannel, text: &str) -> Result<()>
pub async fn stop(&mut self) -> Result<()>
pub fn disconnect(&self)
Auto Trait Implementations§
impl<S> Freeze for GameClient<S>where
S: Freeze,
impl<S> RefUnwindSafe for GameClient<S>where
S: RefUnwindSafe,
impl<S> Send for GameClient<S>
impl<S> Sync for GameClient<S>where
S: Sync,
impl<S> Unpin for GameClient<S>where
S: Unpin,
impl<S> UnsafeUnpin for GameClient<S>where
S: UnsafeUnpin,
impl<S> UnwindSafe for GameClient<S>where
S: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more