Struct Header

Source
pub struct Header {
    pub signature: Signature,
    pub version: Version,
    pub structs: Section,
    pub fields: Section,
    pub labels: Section,
    pub field_data: Section,
    pub field_indices: Section,
    pub list_indices: Section,
}
Expand description

Заголовок GFF файла. Заголовок содержит вид файла, версию формата и информацию о 6 областях, файла, содержащих данные:

  • Список структур в файле
  • Общий список полей всех структур файла
  • Список уникальных названий полей
  • Список с данными полей
  • Вспомогательный список для индексов для сложных структур данных
  • Вспомогательный список для хранения списочных значений полей

Fields§

§signature: Signature

Конкретный вид GFF файла

§version: Version

Версия файла

§structs: Section

Содержит смещение в байтах от начала файла области с расположением структур и их количество

§fields: Section

Содержит смещение в байтах от начала файла области с расположением полей структур и их количество

§labels: Section

Содержит смещение в байтах от начала файла области с расположением меток полей в структурах и их количество

§field_data: Section

Содержит смещение в байтах от начала файла области с расположением сериализованных значений полей и суммарное число байт данных

§field_indices: Section

Содержит смещение в байтах от начала файла области с расположением индексов полей и их количество

§list_indices: Section

Содержит смещение в байтах от начала файла области с расположением индексов списков и их количество

Implementations§

Source§

impl Header

Source

pub fn new(signature: Signature) -> Self

Создает заголовок для пустого файла с указанным типом

Source

pub fn with_version(signature: Signature, version: Version) -> Self

Создает заголовок для пустого файла с указанным типом и версией

Source

pub fn read<R: Read>(reader: &mut R) -> Result<Self>

Читает значение GFF заголовка из потока

Source

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

Записывает значение GFF заголовка в поток

Source

pub fn token_count(&self) -> usize

Возвращает нижнюю границу на количество токенов, которые может произвести данный файл

Trait Implementations§

Source§

impl Debug for Header

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

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> 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.