Function validate

Source
pub fn validate(s: &str) -> Result<(), Error>
Expand description

Validate the order of an m.space.child event.

According to the specification, the order:

Must consist of ASCII characters within the range \x20 (space) and \x7E (~), inclusive. Must not exceed 50 characters.

Returns Ok(()) if the order passes validation, or an error if the order doesn’t respect the rules from the spec, as it cannot be used for ordering.