Skip to content

byte_size

Functions

  • deserialize - Deserializes a unit-bearing byte size such as "4 MiB".
  • serialize - Serializes a byte size as an exact byte count such as "4194304 B".

firma_config_utils::byte_size::deserialize

Section titled “firma_config_utils::byte_size::deserialize”

Function

Deserializes a unit-bearing byte size such as "4 MiB".

Returns an error when the value is not a string, is a bare number, or is not a valid byte size.

fn deserialize<'de, D>(deserializer: D) -> Result<bytesize::ByteSize, <D as >::Error>

Function

Serializes a byte size as an exact byte count such as "4194304 B".

Returns the serializer’s error.

fn serialize<S>(value: &bytesize::ByteSize, serializer: S) -> Result<<S as >::Ok, <S as >::Error>