Skip to main content

FieldType

Enum FieldType 

Source
#[repr(u32)]
pub enum FieldType {
Show 16 variants Byte = 0, Char = 1, Word = 2, Short = 3, Dword = 4, Int = 5, Dword64 = 6, Int64 = 7, Float = 8, Double = 9, String = 10, ResRef = 11, LocString = 12, Void = 13, Struct = 14, List = 15,
}
Expand description

Типы полей, которые возможно встретить в GFF файле

Variants§

§

Byte = 0

Беззнаковое байтовое значение (от 0 до 255), занимающее один байт

§

Char = 1

Символ текста в диапазоне 0x00-0xFF, занимающий один байт

§

Word = 2

Беззнаковое целое (от 0 до 65535), занимающее 2 байта

§

Short = 3

Знаковое целое (от -32768 до 32767), занимающее 2 байта

§

Dword = 4

Беззнаковое целое (от 0 до 4294967296), занимающее 4 байта

§

Int = 5

Знаковое целое (от -2147483648 до 2147483647), занимающее 4 байта

§

Dword64 = 6

Беззнаковое целое (от 0 до примерно 18e+18), занимающее 8 байт

§

Int64 = 7

Знаковое целое (примерно от -9e+18 до +9e+18), занимающее 8 байт

§

Float = 8

Число с плавающей запятой одинарной точности, занимающее 4 байта

§

Double = 9

Число с плавающей запятой двойной точности, занимающее 8 байт

§

String = 10

Нелокализуемая строка.

Предпочитаемый максимальный размер - 1024 символа. Это ограничение установлено в первую очередь для того, чтобы сохранить пропускную способность сети в том случае, если строку необходимо передавать с сервера на клиент.

Данный вид строк не должен использоваться для текста, который может увидеть игрок, так как он будет одинаковым независимо от языка клиента игры. Область применения данного типа - текст для разработчиков/дизайнеров уровней, например, тегов объектов, используемых в скриптах.

§

ResRef = 11

Имя файла ресурса, до 16 символов

§

LocString = 12

Локализуемая строка. Содержит StringRef и несколько CExoString, каждую со своим номером языка

§

Void = 13

Произвольные данные любой длины

§

Struct = 14

Вложенная структура

§

List = 15

Список значений любой длины

Implementations§

Source§

impl FieldType

Source

pub fn is_complex(&self) -> bool

Возвращает true, если данные поля указанного типа хранятся не в структуре Field, а в отдельной области полей GFF файла. Поля типа Struct и List хранятся совершенно отдельно и данный метод для них возвращает false

Source

pub fn is_simple(&self) -> bool

Возвращает true, если данные поля указанного типа хранятся внутри структуры Field

Trait Implementations§

Source§

impl Clone for FieldType

Source§

fn clone(&self) -> FieldType

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for FieldType

Source§

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

Formats the value using the given formatter. Read more
Source§

impl Hash for FieldType

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl PartialEq for FieldType

Source§

fn eq(&self, other: &FieldType) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Copy for FieldType

Source§

impl Eq for FieldType

Source§

impl StructuralPartialEq for FieldType

Auto Trait Implementations§

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.