Crate ruma_serde[−][src]
Expand description
(De)serialization helpers for other ruma crates.
Re-exports
pub use can_be_empty::is_empty; | |
pub use can_be_empty::CanBeEmpty; |
Modules
can_be_empty | Helpers for emptiness checks in |
duration | De-/serialization functions for |
json_string | De-/serialization functions to and from json strings, allows the type to be used as a query string. |
single_element_seq | De-/serialization functions to and from single element sequences. |
test | Helpers for tests |
urlencoded |
|
vec_as_map_of_empty | Serde serialization and deserialization functions that map a |
Structs
Raw | A wrapper around |
Enums
CanonicalJsonError | The set of possible errors when serializing to canonical JSON. |
CanonicalJsonValue | Represents a canonical JSON value as per the Matrix specification. |
Traits
Outgoing | A type that can be sent to another party that understands the matrix protocol. |
Functions
btreemap_int_or_string_to_int_values | Take a BTreeMap with values of either an integer number or a string and deserialize those to integer numbers. |
default_true | Simply returns |
deserialize_cow_str | Deserialize a |
empty_string_as_none | Serde deserialization decorator to map empty Strings to None, and forward non-empty Strings to the Deserialize implementation for T. Useful for the typical “A room with an X event with an absent, null, or empty Y field should be treated the same as a room with no such event.” formulation in the spec. |
int_or_string_to_int | Take either an integer number or a string and deserialize to an integer number. |
is_default | Check whether a value is equal to its default value. |
is_true | Simply dereferences the given bool. |
json_to_buf | Creates a buffer and writes a serializable value to it. |
none_as_empty_string | Serde serializiation decorator to map None to an empty String, and forward Somes to the Serialize implemention for T. |
slice_to_buf | Converts a byte slice to a buffer by copying. |
to_canonical_json_string | Returns a canonical JSON string according to Matrix specification. |
to_canonical_value | Fallible conversion from any value that impl’s |
try_from_json_map | Fallible conversion from a |
Type Definitions
CanonicalJsonObject | The inner type of |
Derive Macros
AsRefStr | |
DeserializeFromCowStr | |
DisplayAsRefStr | |
FromString | |
OrdAsRefStr | |
Outgoing | Derive the |
PartialEqAsRefStr | |
PartialOrdAsRefStr | |
SerializeAsRefStr | |
StringEnum | Shorthand for the derives |