Skip to main content

Module writer

Module writer 

Source
Expand description

Demo rewriting APIs and lower-level bitstream writer utilities.

This module is the preferred import path for writing or rewriting demo files. It includes DemoWriter, DemoRewriter, packet message helpers, and the bitstream writer utilities used by advanced rewrites.

Re-exports§

pub use crate::error::ParserError;

Structs§

DemoWriter
Demo writer that reads demo messages and writes a rewritten stream.
PacketMessage
Packet message passed to packet-list rewriters.
RewriteInterests
Bitflags for declaring rewrite interests.
StringTableEntryUpdate
A mutable string table entry update passed to demo rewriters.

Enums§

MessageRewrite
Outcome for a message rewrite operation.

Traits§

DemoRewriter
Trait for handling demo rewrites.

Functions§

rewrite_protobuf_message
Rewrites a prost message by decoding, mutating, and re-encoding it.
write_demo_message
Writes a demo command message and returns the number of bytes emitted.
write_demo_message_with_compression
Writes a demo command message, optionally Snappy-compressing the payload.
write_var_u32_to_buf
Appends an unsigned varint used for 32-bit demo fields to a byte buffer.
write_var_u32_to_vec
Encodes an unsigned varint used for 32-bit demo fields into a new byte vector.
write_var_u64_to_buf
Appends an unsigned 64-bit varint to a byte buffer.
write_var_u64_to_vec
Encodes an unsigned 64-bit varint into a new byte vector.

Attribute Macros§

replace_entity_field
Replaces decoded entity field values with custom logic.
rewrite_demo_message
Rewrites an outer demo command payload.
rewrite_demo_string_tables
Rewrites a decoded CDemoStringTables outer demo message.
rewrite_field
Replaces decoded entity field values with class and field filters.
rewrite_packet_message
Rewrites an individual message inside a demo packet.
rewrite_packet_messages
Mutates the decoded packet message list after per-message rewrites.
rewrite_string_table_entry
Rewrites one decoded string table entry update.
rewrite_svc_create_string_table
Rewrites a decoded svc_CreateStringTable packet message.
rewrite_svc_update_string_table
Rewrites a decoded svc_UpdateStringTable packet message.
rewriter
Implements the DemoRewriter trait for your struct.
should_rewrite_entity
Filters which entities enter the entity field rewrite path.
should_track_entity
Filters which entities retain decoded field state while rewriting.