Crate bluefile

Source
Expand description

Experimental Rust library for handling X-Midas Bluefiles.

use std::fs::File;
use bluefile::read_header;

let file = File::open("/path/to/bluefile").unwrap();
let header = read_header(&file).unwrap();
println!("{}", header.type_code);
println!("{}", header.data_type);

Structs§

DataType
Two bytes that represent rank and format
ExtKeyword
Extended header keyword.
ExtKeywordValue
Represents an extended header keyword value with the necessary information to render it from raw bytes.
Header
Represents the main header.
HeaderKeyword
Represents a from the main header (not extended header).
Type1000Adjunct
Represents the adjunct header fields for type 1000 files.
Type2000Adjunct
Represents the adjunct header fields for type 2000 files.

Enums§

Endianness
Defines endianness type.
Error

Functions§

byte_to_i8
Converts a byte to an i8.
bytes_to_complex_f32
Converts bytes to a complex f32 (CF).
bytes_to_complex_f64
Converts bytes to a complex f64 (CD).
bytes_to_complex_i8
Converts bytes to a complex i8 (CB).
bytes_to_complex_i16
Converts bytes to a complex i16 (CI).
bytes_to_complex_i32
Converts bytes to a complex i32 (CL).
bytes_to_complex_i64
Converts bytes to a complex i64 (CX).
bytes_to_f32
Converts bytes to an f32.
bytes_to_f64
Converts bytes to an f64.
bytes_to_i16
Converts bytes to an i16.
bytes_to_i32
Concerts bytes to an i32.
bytes_to_i64
Converts bytes to an i64.
parse_header
Parses the main header from raw bytes.
read_ext_header
Reads the extended header keywords.
read_header
Reads the main header from a file.
read_type1000_adjunct_header
Reads the adjunct header from a type 1000 file.
read_type2000_adjunct_header
Reads the adjunct header from a type 2000 file.

Type Aliases§

Result
TypeCode
Represents the bluefile type, such as 1000, 2000, etc.