Skip to main content

DataBundle

Struct DataBundle 

Source
pub struct DataBundle {
    pub format_version: String,
    pub bundle_version: u32,
    pub variants: HashMap<String, VariantCache>,
}
Expand description

Bundled data for a single format version (e.g., FV2504).

Contains all VariantCaches for every message type in that FV, serialized as one bincode file for distribution via GitHub releases.

Fields§

§format_version: String§bundle_version: u32§variants: HashMap<String, VariantCache>

Implementations§

Source§

impl DataBundle

Source

pub const CURRENT_VERSION: u32 = 2

Source

pub fn variant(&self, name: &str) -> Option<&VariantCache>

Source

pub fn write_to<W>(&self, writer: &mut W) -> Result<(), MappingError>
where W: Write,

Source

pub fn read_from<R>(reader: &mut R) -> Result<DataBundle, MappingError>
where R: Read,

Source

pub fn read_from_checked<R>(reader: &mut R) -> Result<DataBundle, MappingError>
where R: Read,

Source

pub fn save(&self, path: &Path) -> Result<(), MappingError>

Source

pub fn load(path: &Path) -> Result<DataBundle, MappingError>

Trait Implementations§

Source§

impl<'de> Deserialize<'de> for DataBundle

Source§

fn deserialize<__D>( __deserializer: __D, ) -> Result<DataBundle, <__D as Deserializer<'de>>::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Serialize for DataBundle

Source§

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

Serialize this value into the given Serde serializer. 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> 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, 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<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,