Struct gds::Record
[−]
[src]
pub struct Record { pub size: u16, pub rec_type: u8, pub data_type: u8, pub data: Vec<RecordData>, }
A structure describing a data record in a GDS file.
This type should normally not used manually as the gds file can be read in automatically into a Library object.
Fields
size: u16
Size of the record in bytes (including the header).
rec_type: u8
Type of the record (see gds::constants).
data_type: u8
Type of data.
- 0 - no data
- 1 - 16 bits containing flags
- 2 - 16 bit signed integer
- 3 - 32 bit signed integer
- 4 - 32 bit real
- 5 - 64 bit real
- 6 - String
data: Vec<RecordData>
Vector of data.
Methods
impl Record
[src]
fn new(rec_type: u8, data_type: u8, data: Vec<RecordData>) -> Record
Creates new record object from given type and data.
The record will be constructed using the given record type rec_type
,
the data type data_type
and a vector of RecordData objects data
.
The size is calculated automatically.
fn new_none(rec_type: u8) -> Record
Creates new record object with no data.
The resulting record will be of the type described by rec_type
(see
also gds::constants).
fn new_single(rec_type: u8, data_type: u8, data: RecordData) -> Record
Creates new record object containing a single RecordData object.
The record will be constructed using the given record type rec_type
,
the data type data_type
and a single RecordData object data
.
The size is calculated automatically.
fn push_data(&mut self, data: RecordData)
Pushes new data to record.
The data
is be pushed to the records data vector and the size is
recalculated.
fn update_size(&mut self)
Calculates new size.
This function calculates the current size of the record data. This function is called automatically so that manually invoking is not necessary.
fn read(file: &mut File) -> Record
Read record from file specified by file
.
fn write(&self, file: &mut File)
Write contents of the record to the file specified by file
.