Struct s2protocol::init_data::InitData
source · pub struct InitData {
pub sync_lobby_state: LobbySyncState,
pub sha256: String,
pub file_name: String,
pub version: u32,
}
Fields§
§sync_lobby_state: LobbySyncState
The lobby state
sha256: String
The sha256 of the file, prevent duplicates and provide a unique identifier
file_name: String
The file name
version: u32
The version of the protocol
Implementations§
source§impl InitData
impl InitData
sourcepub fn new(
file_name: &str,
mpq: &MPQ,
file_contents: &[u8]
) -> Result<Self, S2ProtocolError>
pub fn new( file_name: &str, mpq: &MPQ, file_contents: &[u8] ) -> Result<Self, S2ProtocolError>
Calls the per-protocol parser for the InitData and sets the metadadata.
pub fn set_metadata(self, file_name: &str, file_contents: &[u8]) -> Self
pub fn set_version(&mut self, version: u32)
Trait Implementations§
source§impl ArrowDeserialize for InitData
impl ArrowDeserialize for InitData
§type ArrayType = InitDataArray
type ArrayType = InitDataArray
The
arrow2::Array
type corresponding to this fieldsource§fn arrow_deserialize<'a>(v: Option<Self>) -> Option<Self>
fn arrow_deserialize<'a>(v: Option<Self>) -> Option<Self>
Deserialize this field from arrow
source§impl ArrowField for InitData
impl ArrowField for InitData
source§impl ArrowSerialize for InitData
impl ArrowSerialize for InitData
§type MutableArrayType = MutableInitDataArray
type MutableArrayType = MutableInitDataArray
The
arrow2::array::MutableArray
that holds this valuesource§fn new_array() -> Self::MutableArrayType
fn new_array() -> Self::MutableArrayType
Create a new mutable array
source§fn arrow_serialize(v: &Self, array: &mut Self::MutableArrayType) -> Result<()>
fn arrow_serialize(v: &Self, array: &mut Self::MutableArrayType) -> Result<()>
Serialize this field to arrow
source§impl<'de> Deserialize<'de> for InitData
impl<'de> Deserialize<'de> for InitData
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl PartialEq for InitData
impl PartialEq for InitData
source§impl TryFrom<PathBuf> for InitData
impl TryFrom<PathBuf> for InitData
source§fn try_from(path: PathBuf) -> Result<Self, Self::Error>
fn try_from(path: PathBuf) -> Result<Self, Self::Error>
Reads the file from the path and calls the per-protocol parser for the InitData. Sets the metadata if successful. Returns an error if the file cannot be read or the parser fails.
§type Error = S2ProtocolError
type Error = S2ProtocolError
The type returned in the event of a conversion error.
source§impl TryFrom<ReplaySInitData> for InitData
impl TryFrom<ReplaySInitData> for InitData
§type Error = S2ProtocolError
type Error = S2ProtocolError
The type returned in the event of a conversion error.
impl StructuralPartialEq for InitData
Auto Trait Implementations§
impl RefUnwindSafe for InitData
impl Send for InitData
impl Sync for InitData
impl Unpin for InitData
impl UnwindSafe for InitData
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