Function twilight_validate::component::component
source · [−]pub fn component(component: &Component) -> Result<(), ComponentValidationError>Expand description
Ensure a component is correct.
Errors
Returns an error of type ActionRowComponentCount if the provided list of
components is too many for an ActionRow.
Returns an error of type InvalidChildComponent if the provided nested
component is an ActionRow. Action rows can not contain another action
row.
Returns an error of type InvalidRootComponent if the root component is
not an ActionRow.
Returns an error of type SelectMaximumValuesCount if the provided number
of select menu values that can be chosen is smaller than the minimum or
larger than the maximum.
Returns an error of type SelectMinimumValuesCount if the provided number
of select menu values that must be chosen is larger than the maximum.
Returns an error of type SelectOptionDescriptionLength if a provided
select option description is too long.
Returns an error of type SelectOptionLabelLength if a provided select
option label is too long.
Returns an error of type SelectOptionValueLength error type if
a provided select option value is too long.
Returns an error of type SelectPlaceholderLength if a provided select
placeholder is too long.