Expand description
Contains helpers for the fields.
Structs§
- String
OrVec ToVec - Builder to create a parser, that parses a separated string or a vec into a vec.
Enums§
- Pattern
- Pattern on which a string can be split.
Functions§
- bool_
true - Allows a
bool
field to be defaulted totrue
, rather than the normal default offalse
. Useful for fields where the default value should betrue
. - default_
i16 - Allows compact setting
i16
field default value. - default_
i32 - Allows compact setting
i32
field default value. - default_
i64 - Allows compact setting
i64
field default value. - default_
u16 - Allows compact setting
u16
field default value. - default_
u32 - Allows compact setting
u32
field default value. - default_
u64 - Allows compact setting
u64
field default value. - deserialize_
bool_ from_ anything - Deserializes boolean from anything (string, number, boolean). If input is a string,
it is expected, that it is possible to convert it to a number. The return boolean is
true
if the number was either1
or1.0
after parsing. - deserialize_
cell_ option_ number_ from_ string - Deserializes a
Cell
option number from string or a number. Same logic as"deserialize_option_number_from_string"
. - deserialize_
datetime_ utc_ from_ milliseconds - Deserializes a
chrono::DateTime<Utc>
from a milliseconds time stamp. Useful when the data is coming from a number which is not a seconds time stamp but milliseconds one. It also handles the string to number conversion if the data was passed as a string with number inside like “1519927261900”. - deserialize_
datetime_ utc_ from_ seconds - Deserializes a
chrono::DateTime<Utc>
from a seconds time stamp. It also handles the string to number conversion if the data was passed as a string with number inside like “1519927261”. - deserialize_
default_ from_ empty_ object - Deserializes default value from nullable value or empty object. If the original value is
null
or{}
,Default::default()
is used. - deserialize_
default_ from_ null - Deserializes default value from nullable value. If the original value is
null
,Default::default()
is used. - deserialize_
mutex_ option_ number_ from_ string - Deserializes a
Mutex
option number from string or a number. Same logic as"deserialize_option_number_from_string"
. - deserialize_
number_ from_ string - Deserializes a number from string or a number.
- deserialize_
option_ number_ from_ string - Deserializes an option number from string or a number.
- deserialize_
ref_ cell_ option_ number_ from_ string - Deserializes a
RefCell
option number from string or a number. Same logic as"deserialize_option_number_from_string"
. - deserialize_
rw_ lock_ option_ number_ from_ string - Deserializes a
RwLock
option number from string or a number. Same logic as"deserialize_option_number_from_string"
. - deserialize_
string_ from_ number - Deserializes string from a number. If the original value is a number value, it will be converted to a string.
- deserialize_
to_ type_ or_ fallback - Deserialize to primary or fallback type.
- deserialize_
to_ type_ or_ none - Deserialize to a given type, while ignoring any invalid fields.
- deserialize_
to_ type_ or_ string_ lossy - Deserialize to a given type, while returning invalid fields as
String
. - deserialize_
vec_ from_ string_ or_ vec - Deserializes a comma separated string into a
Vec<T>
.
Type Aliases§
- String
OrVec Parser - A functor returning a
Result
of parsing a string into a vector of objects of typeT
.