mgx

Struct Record

Source
pub struct Record {
Show 55 fields pub md5: Option<String>, pub filename: String, pub filesize: usize, pub lastmod: u64, pub guid: Option<String>, pub verlog: Option<u32>, pub ver: Option<Version>, pub verraw: Option<String>, pub versave: Option<f32>, pub versave2: Option<u32>, pub verscenario: Option<f32>, pub include_ai: Option<bool>, pub speed_raw: Option<u32>, pub speed: Option<String>, pub recorder: Option<u16>, pub totalplayers: Option<u8>, pub mapsize_raw: Option<u32>, pub mapsize: Option<String>, pub revealmap_raw: Option<i32>, pub revealmap: Option<String>, pub mapx: Option<i32>, pub mapy: Option<i32>, pub nofog: Option<bool>, pub instantbuild: Option<bool>, pub enablecheats: Option<bool>, pub restoretime: Option<u32>, pub ismultiplayer: Option<bool>, pub isconquest: Option<bool>, pub relics2win: Option<i32>, pub explored2win: Option<i32>, pub anyorall: Option<bool>, pub victorytype_raw: Option<i32>, pub victorytype: Option<String>, pub score2win: Option<i32>, pub time2win_raw: Option<i32>, pub time2win: Option<String>, pub scenariofilename_raw: Option<Vec<u8>>, pub scenariofilename: Option<String>, pub instructions_raw: Option<Vec<u8>>, pub instructions: Option<String>, pub duration: u32, pub chat: Vec<Chat>, pub mapid: Option<u32>, pub mapname: Option<String>, pub difficulty_raw: Option<i32>, pub difficulty: Option<String>, pub lockteams: Option<bool>, pub poplimit: Option<u32>, pub gametype_raw: Option<u8>, pub gametype: Option<String>, pub lockdiplomacy: Option<bool>, pub haswinner: bool, pub matchup: Option<Vec<usize>>, pub players: [Player; 9], pub debug: DebugInfo,
}
Expand description

Store information of this game extracted from the recorded game. Most fields will be None if not present in the recorded game or exception occurs during parsing

Fields§

§md5: Option<String>§filename: String§filesize: usize§lastmod: u64§guid: Option<String>§verlog: Option<u32>§ver: Option<Version>§verraw: Option<String>§versave: Option<f32>

11.76 for aoc10a/c

§versave2: Option<u32>§verscenario: Option<f32>§include_ai: Option<bool>§speed_raw: Option<u32>§speed: Option<String>§recorder: Option<u16>§totalplayers: Option<u8>

GAIA is counted

§mapsize_raw: Option<u32>§mapsize: Option<String>§revealmap_raw: Option<i32>§revealmap: Option<String>§mapx: Option<i32>§mapy: Option<i32>§nofog: Option<bool>§instantbuild: Option<bool>§enablecheats: Option<bool>§restoretime: Option<u32>§ismultiplayer: Option<bool>§isconquest: Option<bool>§relics2win: Option<i32>§explored2win: Option<i32>§anyorall: Option<bool>§victorytype_raw: Option<i32>§victorytype: Option<String>§score2win: Option<i32>§time2win_raw: Option<i32>§time2win: Option<String>§scenariofilename_raw: Option<Vec<u8>>§scenariofilename: Option<String>§instructions_raw: Option<Vec<u8>>§instructions: Option<String>§duration: u32§chat: Vec<Chat>§mapid: Option<u32>§mapname: Option<String>§difficulty_raw: Option<i32>§difficulty: Option<String>§lockteams: Option<bool>§poplimit: Option<u32>§gametype_raw: Option<u8>§gametype: Option<String>§lockdiplomacy: Option<bool>§haswinner: bool§matchup: Option<Vec<usize>>§players: [Player; 9]§debug: DebugInfo

Debug data used by the parser. Strip this out in output json.

Implementations§

Source§

impl Record

Source

pub fn new(filename: String, filesize: usize, lastmod: u64) -> Self

Source§

impl Record

Source

pub fn detect_encoding(&self) -> Option<String>

Source

pub fn translate(&mut self, lang: &str)

Source

pub fn convert_encoding(&mut self)

Source

pub fn dump_json(&mut self) -> Result<String>

Trait Implementations§

Source§

impl Debug for Record

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for Record

Source§

fn default() -> Record

Returns the “default value” for a type. Read more
Source§

impl Serialize for Record

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

§

impl Freeze for Record

§

impl RefUnwindSafe for Record

§

impl Send for Record

§

impl Sync for Record

§

impl Unpin for Record

§

impl UnwindSafe for Record

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

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

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<R, P> ReadPrimitive<R> for P
where R: Read + ReadEndian<P>, P: Default,

Source§

fn read_from_little_endian(read: &mut R) -> Result<Self, Error>

Read this value from the supplied reader. Same as ReadEndian::read_from_little_endian().
Source§

fn read_from_big_endian(read: &mut R) -> Result<Self, Error>

Read this value from the supplied reader. Same as ReadEndian::read_from_big_endian().
Source§

fn read_from_native_endian(read: &mut R) -> Result<Self, Error>

Read this value from the supplied reader. Same as ReadEndian::read_from_native_endian().
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<SS, SP> SupersetOf<SS> for SP
where SS: SubsetOf<SP>,

Source§

fn to_subset(&self) -> Option<SS>

The inverse inclusion map: attempts to construct self from the equivalent element of its superset. Read more
Source§

fn is_in_subset(&self) -> bool

Checks if self is actually part of its subset T (and can be converted to it).
Source§

fn to_subset_unchecked(&self) -> SS

Use with care! Same as self.to_subset but without any property checks. Always succeeds.
Source§

fn from_subset(element: &SS) -> SP

The inclusion map: converts self to the equivalent element of its superset.
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V