pub struct TextComponent(pub NbtComponent);Expand description
A text component encoded as an NBT tag.
Plain text-only components may use an NBT string tag. Components with styling, events, or other data use an NBT compound tag. See the text component format and NBT specification.
Tuple Fields§
§0: NbtComponentThe structured text component value.
Implementations§
Source§impl TextComponent
impl TextComponent
Sourcepub const MAX_DECODE_BYTES: usize
pub const MAX_DECODE_BYTES: usize
The maximum number of NBT bytes accepted while decoding a component.
Sourcepub const MAX_DECODE_NODES: usize = 262_144
pub const MAX_DECODE_NODES: usize = 262_144
The maximum number of NBT values accepted while decoding a component.
Trait Implementations§
Source§impl Clone for TextComponent
impl Clone for TextComponent
Source§fn clone(&self) -> TextComponent
fn clone(&self) -> TextComponent
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 moreSource§impl Debug for TextComponent
impl Debug for TextComponent
Source§impl Default for TextComponent
impl Default for TextComponent
Source§impl From<&str> for TextComponent
impl From<&str> for TextComponent
Source§impl From<Component<Value>> for TextComponent
impl From<Component<Value>> for TextComponent
Source§fn from(value: NbtComponent) -> Self
fn from(value: NbtComponent) -> Self
Converts to this type from the input type.
Source§impl From<String> for TextComponent
impl From<String> for TextComponent
Source§impl PartialEq for TextComponent
impl PartialEq for TextComponent
impl StructuralPartialEq for TextComponent
Auto Trait Implementations§
impl Freeze for TextComponent
impl RefUnwindSafe for TextComponent
impl Send for TextComponent
impl Sync for TextComponent
impl Unpin for TextComponent
impl UnsafeUnpin for TextComponent
impl UnwindSafe for TextComponent
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§impl<T> ContextualCodec for Twhere
T: TypeCodec,
impl<T> ContextualCodec for Twhere
T: TypeCodec,
Source§fn encode_with_context(
&self,
writer: &mut impl Write,
_context: &Context,
) -> Result<(), CodecError>
fn encode_with_context( &self, writer: &mut impl Write, _context: &Context, ) -> Result<(), CodecError>
Encodes this value using context supplied by its enclosing structure.
Source§fn decode_with_context(
reader: &mut impl Read,
_context: &Context,
) -> Result<T, CodecError>where
T: Sized,
fn decode_with_context(
reader: &mut impl Read,
_context: &Context,
) -> Result<T, CodecError>where
T: Sized,
Decodes this value using context supplied by its enclosing structure.