Enum TextContent
pub enum TextContent {
Literal(String),
Translatable {
key: String,
fallback: Option<String>,
arguments: Vec<Text>,
},
Keybind(String),
Selector {
pattern: String,
separator: Option<Box<Text>>,
},
Score {
name: String,
objective: String,
},
Nbt {
path: String,
interpret: bool,
source: TextNbtSource,
separator: Option<Box<Text>>,
},
Object(TextObject),
}Expand description
What supplies the characters or inline object of a component.
Variants§
Literal(String)
Literal characters, without interpreting legacy formatting codes.
Translatable
A translation remains a key and components, not a localized string.
Fields
Keybind(String)
A key binding’s localized display name.
Selector
A selector resolved by the game’s component context.
Fields
Score
A scoreboard value resolved by the game’s component context.
Nbt
NBT resolved by the game’s component context.
Fields
§
source: TextNbtSourceWhere to obtain the NBT.
Object(TextObject)
A non-character inline object.
Trait Implementations§
§impl Clone for TextContent
impl Clone for TextContent
§fn clone(&self) -> TextContent
fn clone(&self) -> TextContent
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read more§impl Debug for TextContent
impl Debug for TextContent
§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