Struct serde_gff::de::Deserializer

source ·
pub struct Deserializer<R: Read + Seek> { /* private fields */ }
Expand description

Структура для поддержки чтения GFF файлов в экосистеме serde

Implementations

Создает десериализатор для чтения GFF файла из указанного источника данных с использованием кодировки UTF-8 для декодирования строк и генерацией ошибки в случае, если декодировать набор байт, как строку в этой кодировке, не удалось.

Параметры
  • reader: Источник данных для чтения файла
Ошибки

В случае, если не удалось прочитать заголовок GFF файла – например, он слишком короткий

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

Параметры
  • reader: Источник данных для чтения файла
  • encoding: Кодировка для декодирования символов в строках
  • trap: Способ обработки символов в строках, которые не удалось декодировать с использованием выбранной кодировки
Ошибки

В случае, если не удалось прочитать заголовок GFF файла – например, он слишком короткий

Trait Implementations

Всегда разбирает любое значение, как Some(...), формат не умеет хранить признак отсутствия значения. None в опциональные поля будет записываться только потому, что при десериализации данное поле не будет найдено

Десериализует любую GFF структуру в unit, в остальных случаях выдает ошибку

Данный метод вызывается при необходимости десериализовать идентификатор перечисления

Десериализует любую GFF структуру в unit, в остальных случаях выдает ошибку

Разбирает в newtype структуру нижележащее значение

The error type that can be returned if some error occurs during deserialization. Read more
Determine whether Deserialize implementations should expect to deserialize their human-readable form. Read more
Hint that the Deserialize type is expecting an i8 value.
Hint that the Deserialize type is expecting a u8 value.
Hint that the Deserialize type is expecting an i16 value.
Hint that the Deserialize type is expecting a u16 value.
Hint that the Deserialize type is expecting an i32 value.
Hint that the Deserialize type is expecting a u32 value.
Hint that the Deserialize type is expecting an i64 value.
Hint that the Deserialize type is expecting a u64 value.
Hint that the Deserialize type is expecting a f32 value.
Hint that the Deserialize type is expecting a f64 value.
Hint that the Deserialize type is expecting a bool value.
Hint that the Deserialize type is expecting a char value.
Hint that the Deserialize type is expecting a string value and does not benefit from taking ownership of buffered data owned by the Deserializer. Read more
Hint that the Deserialize type is expecting a string value and would benefit from taking ownership of buffered data owned by the Deserializer. Read more
Hint that the Deserialize type is expecting a byte array and does not benefit from taking ownership of buffered data owned by the Deserializer. Read more
Hint that the Deserialize type is expecting a byte array and would benefit from taking ownership of buffered data owned by the Deserializer. Read more
Require the Deserializer to figure out how to drive the visitor based on what data type is in the input. Read more
Hint that the Deserialize type needs to deserialize a value whose type doesn’t matter because it is ignored. Read more
Hint that the Deserialize type is expecting a map of key-value pairs.
Hint that the Deserialize type is expecting a sequence of values.
Hint that the Deserialize type is expecting a sequence of values and knows how many values there are without looking at the serialized data. Read more
Hint that the Deserialize type is expecting a tuple struct with a particular name and number of fields. Read more
Hint that the Deserialize type is expecting a struct with a particular name and fields. Read more
Hint that the Deserialize type is expecting an enum value with a particular name and possible variants. Read more
Hint that the Deserialize type is expecting an i128 value. Read more
Hint that the Deserialize type is expecting an u128 value. Read more
The error type that can be returned if some error occurs during deserialization. Read more
This returns Ok(Some(key)) for the next key in the map, or Ok(None) if there are no more remaining entries. Read more
This returns a Ok(value) for the next value in the map. Read more
source

fn next_entry_seed<K, V>(
    &mut self,
    kseed: K,
    vseed: V
) -> Result<Option<(<K as DeserializeSeed<'de>>::Value, <V as DeserializeSeed<'de>>::Value)>, Self::Error>where
    K: DeserializeSeed<'de>,
    V: DeserializeSeed<'de>,

This returns Ok(Some((key, value))) for the next (key-value) pair in the map, or Ok(None) if there are no more remaining items. Read more
This returns Ok(Some(key)) for the next key in the map, or Ok(None) if there are no more remaining entries. Read more
This returns a Ok(value) for the next value in the map. Read more
source

fn next_entry<K, V>(&mut self) -> Result<Option<(K, V)>, Self::Error>where
    K: Deserialize<'de>,
    V: Deserialize<'de>,

This returns Ok(Some((key, value))) for the next (key-value) pair in the map, or Ok(None) if there are no more remaining items. Read more
Returns the number of entries remaining in the map, if known.
The error type that can be returned if some error occurs during deserialization. Read more
This returns Ok(Some(value)) for the next value in the sequence, or Ok(None) if there are no more remaining items. Read more
This returns Ok(Some(value)) for the next value in the sequence, or Ok(None) if there are no more remaining items. Read more
Returns the number of elements remaining in the sequence, if known.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.