[][src]Struct spyparty::replay::Replay

pub struct Replay {
    pub header: Header,
}

A SpyParty replay.

This contains a few useful functions for dealing with a replay, such as checking if a replay contains a specific player.

Fields

header: Header

The header of the replay.

This contains all the information describing the game.

Methods

impl Replay[src]

pub fn from_reader<R: Read>(reader: &mut R) -> Result<Replay>[src]

Create a new replay from a reader.

pub fn has_player(&self, name: &str) -> bool[src]

Checks if the replay contains a particular player.

pub fn has_spy(&self, name: &str) -> bool[src]

Checks if the spy in this replay is a particular player.

pub fn has_sniper(&self, name: &str) -> bool[src]

Checks if the sniper in this replay is a particular player.

pub fn is_spy_win(&self) -> bool[src]

Checks if the replay ends in a spy win.

pub fn is_sniper_win(&self) -> bool[src]

Checks if the replay ends in a sniper win.

pub fn is_win_for(&self, name: &str) -> bool[src]

Checks if the replay ends with a win for a particular player.

pub fn is_loss_for(&self, name: &str) -> bool[src]

Checks if the replay ends with a loss for a particular player.

This is not simply the inverse of is_win_for because replays can be in an unfinished state.

Trait Implementations

impl Default for Replay[src]

Auto Trait Implementations

impl Send for Replay

impl Sync for Replay

Blanket Implementations

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

impl<T> From for 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> Any for T where
    T: 'static + ?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.