pub trait IntoText<'a>: Sized {
Show 32 methods
// Required method
fn into_cow_text(self) -> Cow<'a, Text>;
// Provided methods
fn into_text(self) -> Text { ... }
fn color(self, color: impl Into<Color>) -> Text { ... }
fn clear_color(self) -> Text { ... }
fn font(self, font: Font) -> Text { ... }
fn clear_font(self) -> Text { ... }
fn bold(self) -> Text { ... }
fn not_bold(self) -> Text { ... }
fn clear_bold(self) -> Text { ... }
fn italic(self) -> Text { ... }
fn not_italic(self) -> Text { ... }
fn clear_italic(self) -> Text { ... }
fn underlined(self) -> Text { ... }
fn not_underlined(self) -> Text { ... }
fn clear_underlined(self) -> Text { ... }
fn strikethrough(self) -> Text { ... }
fn not_strikethrough(self) -> Text { ... }
fn clear_strikethrough(self) -> Text { ... }
fn obfuscated(self) -> Text { ... }
fn not_obfuscated(self) -> Text { ... }
fn clear_obfuscated(self) -> Text { ... }
fn insertion(self, insertion: impl Into<Cow<'static, str>>) -> Text { ... }
fn clear_insertion(self) -> Text { ... }
fn on_click_open_url(self, url: impl Into<Cow<'static, str>>) -> Text { ... }
fn on_click_run_command(self, command: impl Into<Cow<'static, str>>) -> Text { ... }
fn on_click_suggest_command(
self,
command: impl Into<Cow<'static, str>>,
) -> Text { ... }
fn on_click_change_page(self, page: impl Into<i32>) -> Text { ... }
fn on_click_copy_to_clipboard(
self,
text: impl Into<Cow<'static, str>>,
) -> Text { ... }
fn clear_click_event(self) -> Text { ... }
fn on_hover_show_text(self, text: impl IntoText<'static>) -> Text { ... }
fn clear_hover_event(self) -> Text { ... }
fn add_child(self, text: impl IntoText<'static>) -> Text { ... }
}
Expand description
Required Methods§
sourcefn into_cow_text(self) -> Cow<'a, Text>
fn into_cow_text(self) -> Cow<'a, Text>
Converts to a Text
object, either owned or borrowed.
Provided Methods§
sourcefn clear_color(self) -> Text
fn clear_color(self) -> Text
Clears the color of the text. Color of parent Text
object will be
used.
sourcefn clear_font(self) -> Text
fn clear_font(self) -> Text
Clears the font of the text. Font of parent Text
object will be
used.
sourcefn clear_bold(self) -> Text
fn clear_bold(self) -> Text
Clears the bold
property of the text. Property of the parent Text
object will be used.
sourcefn not_italic(self) -> Text
fn not_italic(self) -> Text
Makes the text not italic.
sourcefn clear_italic(self) -> Text
fn clear_italic(self) -> Text
Clears the italic
property of the text. Property of the parent
Text
object will be used.
sourcefn underlined(self) -> Text
fn underlined(self) -> Text
Makes the text underlined.
sourcefn not_underlined(self) -> Text
fn not_underlined(self) -> Text
Makes the text not underlined.
sourcefn clear_underlined(self) -> Text
fn clear_underlined(self) -> Text
Clears the underlined
property of the text. Property of the parent
Text
object will be used.
sourcefn strikethrough(self) -> Text
fn strikethrough(self) -> Text
Adds a strikethrough effect to the text.
sourcefn not_strikethrough(self) -> Text
fn not_strikethrough(self) -> Text
Removes the strikethrough effect from the text.
sourcefn clear_strikethrough(self) -> Text
fn clear_strikethrough(self) -> Text
Clears the strikethrough
property of the text. Property of the parent
Text
object will be used.
sourcefn obfuscated(self) -> Text
fn obfuscated(self) -> Text
Makes the text obfuscated.
sourcefn not_obfuscated(self) -> Text
fn not_obfuscated(self) -> Text
Makes the text not obfuscated.
sourcefn clear_obfuscated(self) -> Text
fn clear_obfuscated(self) -> Text
Clears the obfuscated
property of the text. Property of the parent
Text
object will be used.
sourcefn insertion(self, insertion: impl Into<Cow<'static, str>>) -> Text
fn insertion(self, insertion: impl Into<Cow<'static, str>>) -> Text
Adds an insertion
property to the text. When shift-clicked, the given
text will be inserted into chat box for the client.
sourcefn clear_insertion(self) -> Text
fn clear_insertion(self) -> Text
Clears the insertion
property of the text. Property of the parent
Text
object will be used.
sourcefn on_click_open_url(self, url: impl Into<Cow<'static, str>>) -> Text
fn on_click_open_url(self, url: impl Into<Cow<'static, str>>) -> Text
On click, opens the given URL. Has to be http
or https
protocol.
sourcefn on_click_run_command(self, command: impl Into<Cow<'static, str>>) -> Text
fn on_click_run_command(self, command: impl Into<Cow<'static, str>>) -> Text
On click, sends a command. Doesn’t actually have to be a command, can be a simple chat message.
sourcefn on_click_suggest_command(self, command: impl Into<Cow<'static, str>>) -> Text
fn on_click_suggest_command(self, command: impl Into<Cow<'static, str>>) -> Text
On click, copies the given text to the chat box.
sourcefn on_click_change_page(self, page: impl Into<i32>) -> Text
fn on_click_change_page(self, page: impl Into<i32>) -> Text
On click, turns the page of the opened book to the given number.
Indexing starts at 1
.
sourcefn on_click_copy_to_clipboard(self, text: impl Into<Cow<'static, str>>) -> Text
fn on_click_copy_to_clipboard(self, text: impl Into<Cow<'static, str>>) -> Text
On click, copies the given text to clipboard.
sourcefn clear_click_event(self) -> Text
fn clear_click_event(self) -> Text
Clears the click_event
property of the text. Property of the parent
Text
object will be used.
sourcefn on_hover_show_text(self, text: impl IntoText<'static>) -> Text
fn on_hover_show_text(self, text: impl IntoText<'static>) -> Text
On mouse hover, shows the given text in a tooltip.
sourcefn clear_hover_event(self) -> Text
fn clear_hover_event(self) -> Text
Clears the hover_event
property of the text. Property of the parent
Text
object will be used.