pub struct OptionalTextComponent(/* private fields */);Expand description
A Boolean-prefixed optional text component.
Implementations§
Source§impl OptionalTextComponent
impl OptionalTextComponent
Sourcepub const fn some(value: TextComponent) -> Self
pub const fn some(value: TextComponent) -> Self
Creates a present value.
Sourcepub fn value(&self) -> Option<&TextComponent>
pub fn value(&self) -> Option<&TextComponent>
Returns the contained value by reference, if present.
Sourcepub fn into_option(self) -> Option<TextComponent>
pub fn into_option(self) -> Option<TextComponent>
Extracts the wrapped optional value.
Trait Implementations§
Source§impl Clone for OptionalTextComponent
impl Clone for OptionalTextComponent
Source§fn clone(&self) -> OptionalTextComponent
fn clone(&self) -> OptionalTextComponent
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 OptionalTextComponent
impl Debug for OptionalTextComponent
Source§impl Default for OptionalTextComponent
impl Default for OptionalTextComponent
Source§impl From<Option<TextComponent>> for OptionalTextComponent
impl From<Option<TextComponent>> for OptionalTextComponent
Source§fn from(value: Option<TextComponent>) -> Self
fn from(value: Option<TextComponent>) -> Self
Converts to this type from the input type.
Source§impl From<OptionalTextComponent> for Option<TextComponent>
impl From<OptionalTextComponent> for Option<TextComponent>
Source§fn from(value: OptionalTextComponent) -> Self
fn from(value: OptionalTextComponent) -> Self
Converts to this type from the input type.
Source§impl PartialEq for OptionalTextComponent
impl PartialEq for OptionalTextComponent
impl StructuralPartialEq for OptionalTextComponent
Source§impl TypeCodec for OptionalTextComponent
impl TypeCodec for OptionalTextComponent
Auto Trait Implementations§
impl Freeze for OptionalTextComponent
impl RefUnwindSafe for OptionalTextComponent
impl Send for OptionalTextComponent
impl Sync for OptionalTextComponent
impl Unpin for OptionalTextComponent
impl UnsafeUnpin for OptionalTextComponent
impl UnwindSafe for OptionalTextComponent
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.