pub struct TextFieldsBuilder(/* private fields */);
Expand description
A builder for text fields.
Implementations§
source§impl TextFieldsBuilder
impl TextFieldsBuilder
sourcepub const MIN_NAME_LENGTH: usize = 1usize
pub const MIN_NAME_LENGTH: usize = 1usize
The minimum number of UTF-16 code points that can be in a channel name.
This is used by new
.
sourcepub const MAX_NAME_LENGTH: usize = 100usize
pub const MAX_NAME_LENGTH: usize = 100usize
The maximum number of UTF-16 code points that can be in a channel name.
This is used by new
.
sourcepub const MAX_RATE_LIMIT: u16 = 21_600u16
pub const MAX_RATE_LIMIT: u16 = 21_600u16
The maximum length of a rate limit.
This is used by rate_limit_per_user
.
sourcepub const MAX_TOPIC_LENGTH: usize = 1_024usize
pub const MAX_TOPIC_LENGTH: usize = 1_024usize
The maximum number of UTF-16 code points that can be in a channel topic.
This is used by topic
.
sourcepub fn build(self) -> Result<TextFields, TextFieldsError>
pub fn build(self) -> Result<TextFields, TextFieldsError>
Build the text fields.
§Errors
Returns a TextFieldsErrorType::NameTooShort
error type if the name
is too short.
Returns a TextFieldsErrorType::NameTooLong
error type if the name is
too long.
sourcepub fn permission_overwrites(self, overwrites: Vec<PermissionOverwrite>) -> Self
pub fn permission_overwrites(self, overwrites: Vec<PermissionOverwrite>) -> Self
Set the channel’s permission overwrites.
sourcepub fn rate_limit_per_user(self, limit: u16) -> Self
pub fn rate_limit_per_user(self, limit: u16) -> Self
Set the channel’s rate limit per user.
§Errors
Returns a TextFieldsErrorType::RateLimitInvalid
error type if the
rate limit is invalid.
sourcepub fn topic(self, topic: String) -> Self
pub fn topic(self, topic: String) -> Self
Set the channel’s topic.
§Errors
Returns a TextFieldsErrorType::TopicTooLong
error type if the topic
is too long.