twilight_validate::request

Function stage_topic

source
pub fn stage_topic(topic: impl AsRef<str>) -> Result<(), ValidationError>
Expand description

Ensure that the stage instance’s topic length is correct.

The length must be at least STAGE_TOPIC_LENGTH_MIN and at most STAGE_TOPIC_LENGTH_MAX. This is based on this documentation entry.

§Errors

Returns an error of type StageTopic if the length is invalid.