Struct ParserState

Source
pub struct ParserState {
    pub static_baselines: HashMap<ClassId, StaticBaseline, NullHasherBuilder>,
    pub parsed_static_baselines: RefCell<HashMap<ClassId, Vec<SendProp>, NullHasherBuilder>>,
    pub event_definitions: Vec<GameEventDefinition>,
    pub string_tables: Vec<StringTableMeta>,
    pub entity_classes: HashMap<EntityId, ClassId, NullHasherBuilder>,
    pub send_tables: Vec<SendTable>,
    pub server_classes: Vec<ServerClass>,
    pub instance_baselines: [Baseline; 2],
    pub demo_meta: DemoMeta,
    pub protocol_version: u32,
    /* private fields */
}

Fields§

§static_baselines: HashMap<ClassId, StaticBaseline, NullHasherBuilder>§parsed_static_baselines: RefCell<HashMap<ClassId, Vec<SendProp>, NullHasherBuilder>>§event_definitions: Vec<GameEventDefinition>§string_tables: Vec<StringTableMeta>§entity_classes: HashMap<EntityId, ClassId, NullHasherBuilder>§send_tables: Vec<SendTable>§server_classes: Vec<ServerClass>§instance_baselines: [Baseline; 2]§demo_meta: DemoMeta§protocol_version: u32

Implementations§

Source§

impl ParserState

Source

pub fn new( protocol_version: u32, analyser_handles: fn(message_type: MessageType) -> bool, parse_all: bool, ) -> Self

Source

pub fn get_static_baseline( &self, class_id: ClassId, send_table: &SendTable, ) -> Result<Vec<SendProp>>

Source

pub fn get_baseline( &self, baseline_index: BaselineIndex, entity_index: EntityId, class_id: ClassId, send_table: &SendTable, is_delta: bool, ) -> Result<Cow<'_, [SendProp]>>

Source

pub fn handle_data_table( &mut self, parse_tables: &[ParseSendTable], server_classes: Vec<ServerClass>, ) -> Result<()>

Source

pub fn handle_string_table_meta(&mut self, table: StringTableMeta)

Source

pub fn should_parse_message(&self, message_type: MessageType) -> bool

Source

pub fn does_handle(message_type: MessageType) -> bool

Source

pub fn handle_message(&mut self, message: Message<'_>, _tick: DemoTick)

Source

pub fn handle_string_entry( &mut self, table: &str, _index: usize, entry: &StringTableEntry<'_>, )

Source

pub fn index_for_prop( &self, class: ClassId, prop: SendPropIdentifier, ) -> Option<u32>

Trait Implementations§

Source§

impl Clone for ParserState

Source§

fn clone(&self) -> ParserState

Returns a duplicate of the value. Read more
1.0.0 · Source§

const fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more

Auto Trait Implementations§

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> IntoResult<T> for T

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.