pub struct TranslatableComponent {
pub base: BaseComponent,
pub key: String,
pub args: Vec<StringOrComponent>,
}
Expand description
A message whose content depends on the client’s language.
Fields§
§base: BaseComponent
§key: String
§args: Vec<StringOrComponent>
Implementations§
Source§impl TranslatableComponent
impl TranslatableComponent
pub fn new(key: String, args: Vec<StringOrComponent>) -> Self
Sourcepub fn read(&self) -> Result<TextComponent, Error>
pub fn read(&self) -> Result<TextComponent, Error>
Convert the key and args to a FormattedText.
Trait Implementations§
Source§impl Clone for TranslatableComponent
impl Clone for TranslatableComponent
Source§fn clone(&self) -> TranslatableComponent
fn clone(&self) -> TranslatableComponent
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 TranslatableComponent
impl Debug for TranslatableComponent
Source§impl Display for TranslatableComponent
impl Display for TranslatableComponent
Source§impl Hash for TranslatableComponent
impl Hash for TranslatableComponent
Source§impl PartialEq for TranslatableComponent
impl PartialEq for TranslatableComponent
Source§impl Serialize for TranslatableComponent
impl Serialize for TranslatableComponent
Source§impl Serialize for TranslatableComponent
impl Serialize for TranslatableComponent
fn to_compound(self) -> NbtCompound
fn to_nbt(self) -> BaseNbt
impl Eq for TranslatableComponent
impl StructuralPartialEq for TranslatableComponent
Auto Trait Implementations§
impl Freeze for TranslatableComponent
impl RefUnwindSafe for TranslatableComponent
impl Send for TranslatableComponent
impl Sync for TranslatableComponent
impl Unpin for TranslatableComponent
impl UnwindSafe for TranslatableComponent
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
)