pub struct Header {
pub format_version: i32,
/* private fields */
}Expand description
The header struct represents the header of a DMX file.
Fields§
§format_version: i32The version of the format.
Implementations§
Source§impl Header
impl Header
Sourcepub fn new(format: impl Into<String>, format_version: i32) -> Self
pub fn new(format: impl Into<String>, format_version: i32) -> Self
Creates a new header with the given format and format version. The format is truncated to 64 characters.
Sourcepub fn set_format(&mut self, format: impl Into<String>)
pub fn set_format(&mut self, format: impl Into<String>)
Sets the format of the header. The format is truncated to 64 characters.
Sourcepub fn get_format(&self) -> &str
pub fn get_format(&self) -> &str
Returns the format of the header.
Sourcepub fn from_string(
value: String,
) -> Result<(Self, String, i32), FileHeaderError>
pub fn from_string( value: String, ) -> Result<(Self, String, i32), FileHeaderError>
Returns a header from a string.
Sourcepub fn from_buffer(
buffer: &mut impl BufRead,
) -> Result<(Self, String, i32), FileHeaderError>
pub fn from_buffer( buffer: &mut impl BufRead, ) -> Result<(Self, String, i32), FileHeaderError>
Reads a header from a buffer.
Sourcepub fn create_header(&self, encoding: &str, encoding_version: i32) -> String
pub fn create_header(&self, encoding: &str, encoding_version: i32) -> String
Creates a dmx header string.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Header
impl RefUnwindSafe for Header
impl Send for Header
impl Sync for Header
impl Unpin for Header
impl UnwindSafe for Header
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