Enum valence_text::TextContent
source · pub enum TextContent {
Text {
text: Cow<'static, str>,
},
Translate {
translate: Cow<'static, str>,
with: Vec<Text>,
},
ScoreboardValue {
score: ScoreboardValueContent,
},
EntityNames {
selector: Cow<'static, str>,
separator: Option<Text>,
},
Keybind {
keybind: Cow<'static, str>,
},
BlockNbt {
block: Cow<'static, str>,
nbt: Cow<'static, str>,
interpret: Option<bool>,
separator: Option<Text>,
},
EntityNbt {
entity: Cow<'static, str>,
nbt: Cow<'static, str>,
interpret: Option<bool>,
separator: Option<Text>,
},
StorageNbt {
storage: Ident<Cow<'static, str>>,
nbt: Cow<'static, str>,
interpret: Option<bool>,
separator: Option<Text>,
},
}
Expand description
The text content of a Text object.
Variants§
Text
Normal text
Translate
A piece of text that will be translated on the client based on the client language. If no corresponding translation can be found, the identifier itself is used as the translated text.
Fields
ScoreboardValue
Displays a score holder’s current score in an objective.
Fields
§
score: ScoreboardValueContent
EntityNames
Displays the name of one or more entities found by a selector
.
Fields
Keybind
Displays the name of the button that is currently bound to a certain configurable control on the client.
Fields
§
keybind: Cow<'static, str>
A keybind identifier
, to be displayed as the name of the button
that is currently bound to that action.
BlockNbt
Displays NBT values from block entities.
Fields
EntityNbt
Displays NBT values from entities.
Fields
StorageNbt
Displays NBT values from command storage.
Trait Implementations§
source§impl Clone for TextContent
impl Clone for TextContent
source§fn clone(&self) -> TextContent
fn clone(&self) -> TextContent
Returns a copy 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 Default for TextContent
impl Default for TextContent
source§impl<'de> Deserialize<'de> for TextContent
impl<'de> Deserialize<'de> for TextContent
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl PartialEq for TextContent
impl PartialEq for TextContent
source§impl Serialize for TextContent
impl Serialize 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 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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)