Expand description
⚠ Deprecated: this crate has been merged into ruma-common. ⚠
Re-exports§
pub use self::base64::Base64;pub use self::base64::Base64DecodeError;pub use self::can_be_empty::is_empty;pub use self::can_be_empty::CanBeEmpty;
Modules§
- base64
- Transparent base64 encoding / decoding as part of (de)serialization.
- can_
be_ empty - Helpers for emptiness checks in
#[serde(skip_serializing_if)]. - duration
- De-/serialization functions for
std::time::Durationobjects - 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
x-www-form-urlencodedmeets Serde- vec_
as_ map_ of_ empty - Serde serialization and deserialization functions that map a
Vec<T>to aBTreeMap<T, Empty>.
Structs§
- Raw
- A wrapper around
Box<RawValue>, to be used in place of any type in the Matrix endpoint definition to allow request and response types to contain that said type represented by the generic argumentEv.
Enums§
- Canonical
Json Error - The set of possible errors when serializing to canonical JSON.
- Canonical
Json Value - 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_
deserialize_ v1_ powerlevel_ values - Take a BTreeMap with values of either an integer number or a string and deserialize those to integer numbers.
- default_
true - Simply returns
true. - deserialize_
cow_ str - Deserialize a
Cow<'de, str>. - deserialize_
v1_ powerlevel - Take either an integer number or a string and deserialize to an integer number.
- 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.
- from_
raw_ json_ value - Helper function for
serde_json::value::RawValuedeserialization. - 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 implementation for T.
- slice_
to_ buf - Converts a byte slice to a buffer by copying.
- to_
canonical_ value - Fallible conversion from any value that impl’s
Serializeto aCanonicalJsonValue. - try_
from_ json_ map - Fallible conversion from a
serde_json::Mapto aCanonicalJsonObject.
Type Aliases§
- Canonical
Json Object - The inner type of
CanonicalJsonValue::Object. - Json
Object - The inner type of
JsonValue::Object.
Derive Macros§
- AsRef
Str - Deserialize
From CowStr - Display
AsRef Str - From
String - OrdAs
RefStr - Outgoing
- Derive the
Outgoingtrait, possibly generating an ‘Incoming’ version of the struct this derive macro is used on. - Partial
EqAs RefStr - Partial
OrdAs RefStr - Serialize
AsRef Str - String
Enum - Shorthand for the derives
AsRefStr,FromString,DisplayAsRefStr,SerializeAsRefStrandDeserializeFromCowStr.