flash_lso/types/lso_header.rs
1use super::AMFVersion;
2
3/// The header of a lso file
4#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
5#[derive(Debug, PartialEq, Eq, Clone)]
6pub struct Header {
7 /// The length of the lso in bytes
8 pub length: u32,
9
10 /// The name of the lso file
11 pub name: String,
12
13 /// The version of AMF used to encode the data
14 pub format_version: AMFVersion,
15}
16
17impl Header {
18 /// Create a new header with the given name and version, will have a size of 0 by default
19 #[inline]
20 pub fn new(name: impl Into<String>, version: AMFVersion) -> Self {
21 Self {
22 length: 0,
23 name: name.into(),
24 format_version: version,
25 }
26 }
27}