pub enum TextContent {
Text(String),
Translate {
key: String,
with: Vec<TextComponent>,
},
Keybind(String),
Score {
name: String,
objective: String,
},
Selector(String),
}Expand description
The content payload of a text component.
Determines what text is displayed. Only one content type is active
per component. The most common is Text for literal strings and
Translate for server-side localization.
Variants§
Text(String)
A literal text string displayed as-is.
Translate
A translation key resolved by the client’s language file.
with contains substitution arguments inserted into the template.
Fields
§
with: Vec<TextComponent>Substitution arguments for the translation template.
Keybind(String)
A keybind name resolved to the player’s current key binding
(e.g., key.jump displays whatever key the player has bound to jump).
Score
A scoreboard value resolved by the server.
Fields
Selector(String)
An entity selector resolved by the server into matching entity names.
Trait Implementations§
Source§impl Clone for TextContent
impl Clone for TextContent
Source§fn clone(&self) -> TextContent
fn clone(&self) -> TextContent
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for TextContent
impl Debug for TextContent
Source§impl PartialEq for TextContent
impl PartialEq for TextContent
impl StructuralPartialEq for TextContent
Auto Trait Implementations§
impl Freeze for TextContent
impl RefUnwindSafe for TextContent
impl Send for TextContent
impl Sync for TextContent
impl Unpin for TextContent
impl UnsafeUnpin for TextContent
impl UnwindSafe for TextContent
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more