pub enum Component<V> {
Text(String),
Sequence(ComponentSequence<V>),
Object(Box<ComponentObject<V>>),
}Expand description
The Java Edition text component schema documented for the current protocol.
V is the wire format’s deliberately dynamic value type. Use
NbtComponent for NBT and JsonComponent for JSON.
Variants§
Text(String)
The string shorthand for a plain-text component.
Sequence(ComponentSequence<V>)
The non-empty list shorthand.
Object(Box<ComponentObject<V>>)
A full component object.
Implementations§
Trait Implementations§
Source§impl<'de, V> Deserialize<'de> for Component<V>where
V: Deserialize<'de>,
impl<'de, V> Deserialize<'de> for Component<V>where
V: Deserialize<'de>,
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 From<Component<Value>> for JsonTextComponent
impl From<Component<Value>> for JsonTextComponent
Source§fn from(value: JsonComponent) -> Self
fn from(value: JsonComponent) -> Self
Converts to this type from the input type.
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.
impl<V: PartialEq> StructuralPartialEq for Component<V>
Auto Trait Implementations§
impl<V> Freeze for Component<V>
impl<V> RefUnwindSafe for Component<V>where
V: RefUnwindSafe,
impl<V> Send for Component<V>where
V: Send,
impl<V> Sync for Component<V>where
V: Sync,
impl<V> Unpin for Component<V>
impl<V> UnsafeUnpin for Component<V>
impl<V> UnwindSafe for Component<V>where
V: UnwindSafe + RefUnwindSafe,
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