#[non_exhaustive]#[repr(C)]pub struct ValueVTable {Show 16 fields
pub type_name: fn(&mut Formatter<'_>, TypeNameOpts) -> Result<(), Error>,
pub marker_traits: fn() -> MarkerTraits,
pub drop_in_place: fn() -> Option<for<'mem> unsafe fn(PtrMut<'mem>) -> PtrUninit<'mem>>,
pub invariants: fn() -> Option<for<'mem> unsafe fn(PtrConst<'mem>) -> bool>,
pub display: fn() -> Option<for<'mem> unsafe fn(PtrConst<'mem>, &mut Formatter<'_>) -> Result<(), Error>>,
pub debug: fn() -> Option<for<'mem> unsafe fn(PtrConst<'mem>, &mut Formatter<'_>) -> Result<(), Error>>,
pub default_in_place: fn() -> Option<for<'mem> unsafe fn(PtrUninit<'mem>) -> PtrMut<'mem>>,
pub clone_into: fn() -> Option<for<'src, 'dst> unsafe fn(PtrConst<'src>, PtrUninit<'dst>) -> PtrMut<'dst>>,
pub partial_eq: fn() -> Option<for<'l, 'r> unsafe fn(PtrConst<'l>, PtrConst<'r>) -> bool>,
pub partial_ord: fn() -> Option<for<'l, 'r> unsafe fn(PtrConst<'l>, PtrConst<'r>) -> Option<Ordering>>,
pub ord: fn() -> Option<for<'l, 'r> unsafe fn(PtrConst<'l>, PtrConst<'r>) -> Ordering>,
pub hash: fn() -> Option<for<'mem> unsafe fn(PtrConst<'mem>, PtrMut<'mem>, for<'mem> unsafe fn(PtrMut<'mem>, &[u8]))>,
pub parse: fn() -> Option<for<'mem> unsafe fn(&str, PtrUninit<'mem>) -> Result<PtrMut<'mem>, ParseError>>,
pub try_from: fn() -> Option<for<'src, 'mem, 'shape> unsafe fn(PtrConst<'src>, &'shape Shape<'shape>, PtrUninit<'mem>) -> Result<PtrMut<'mem>, TryFromError<'shape>>>,
pub try_into_inner: fn() -> Option<for<'src, 'dst> unsafe fn(PtrMut<'src>, PtrUninit<'dst>) -> Result<PtrMut<'dst>, TryIntoInnerError>>,
pub try_borrow_inner: fn() -> Option<for<'src> unsafe fn(PtrConst<'src>) -> Result<PtrConst<'src>, TryBorrowInnerError>>,
}Expand description
VTable for common operations that can be performed on any shape
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.type_name: fn(&mut Formatter<'_>, TypeNameOpts) -> Result<(), Error>cf. TypeNameFn
marker_traits: fn() -> MarkerTraitsMarker traits implemented by the type
drop_in_place: fn() -> Option<for<'mem> unsafe fn(PtrMut<'mem>) -> PtrUninit<'mem>>cf. DropInPlaceFn — if None, drops without side-effects
invariants: fn() -> Option<for<'mem> unsafe fn(PtrConst<'mem>) -> bool>cf. InvariantsFn
display: fn() -> Option<for<'mem> unsafe fn(PtrConst<'mem>, &mut Formatter<'_>) -> Result<(), Error>>cf. DisplayFn
debug: fn() -> Option<for<'mem> unsafe fn(PtrConst<'mem>, &mut Formatter<'_>) -> Result<(), Error>>cf. DebugFn
default_in_place: fn() -> Option<for<'mem> unsafe fn(PtrUninit<'mem>) -> PtrMut<'mem>>cf. DefaultInPlaceFn
clone_into: fn() -> Option<for<'src, 'dst> unsafe fn(PtrConst<'src>, PtrUninit<'dst>) -> PtrMut<'dst>>cf. CloneIntoFn
partial_eq: fn() -> Option<for<'l, 'r> unsafe fn(PtrConst<'l>, PtrConst<'r>) -> bool>cf. PartialEqFn for equality comparison
partial_ord: fn() -> Option<for<'l, 'r> unsafe fn(PtrConst<'l>, PtrConst<'r>) -> Option<Ordering>>cf. PartialOrdFn for partial ordering comparison
ord: fn() -> Option<for<'l, 'r> unsafe fn(PtrConst<'l>, PtrConst<'r>) -> Ordering>cf. CmpFn for total ordering
hash: fn() -> Option<for<'mem> unsafe fn(PtrConst<'mem>, PtrMut<'mem>, for<'mem> unsafe fn(PtrMut<'mem>, &[u8]))>cf. HashFn
parse: fn() -> Option<for<'mem> unsafe fn(&str, PtrUninit<'mem>) -> Result<PtrMut<'mem>, ParseError>>cf. ParseFn
try_from: fn() -> Option<for<'src, 'mem, 'shape> unsafe fn(PtrConst<'src>, &'shape Shape<'shape>, PtrUninit<'mem>) -> Result<PtrMut<'mem>, TryFromError<'shape>>>cf. TryFromFn
This also acts as a “TryFromInner” — you can use it to go:
String=>Utf8PathBufString=>UuidT=>Option<T>T=>Arc<T>T=>NonZero<T>- etc.
try_into_inner: fn() -> Option<for<'src, 'dst> unsafe fn(PtrMut<'src>, PtrUninit<'dst>) -> Result<PtrMut<'dst>, TryIntoInnerError>>cf. TryIntoInnerFn
This is used by transparent types to convert the wrapper type into its inner value. Primarily used during serialization.
try_borrow_inner: fn() -> Option<for<'src> unsafe fn(PtrConst<'src>) -> Result<PtrConst<'src>, TryBorrowInnerError>>cf. TryBorrowInnerFn
This is used by transparent types to efficiently access the inner value without copying.
Implementations§
Source§impl ValueVTable
impl ValueVTable
Sourcepub fn marker_traits(&self) -> MarkerTraits
pub fn marker_traits(&self) -> MarkerTraits
Get the marker traits implemented for the type
Sourcepub fn is_unwind_safe(&self) -> bool
pub fn is_unwind_safe(&self) -> bool
Check if the type implements the UnwindSafe marker trait
Sourcepub fn is_ref_unwind_safe(&self) -> bool
pub fn is_ref_unwind_safe(&self) -> bool
Check if the type implements the RefUnwindSafe marker trait
Sourcepub const fn builder<T>() -> ValueVTableBuilder<T>
pub const fn builder<T>() -> ValueVTableBuilder<T>
Creates a new ValueVTableBuilder
Sourcepub const fn builder_unsized<T>() -> ValueVTableBuilderUnsized<T>where
T: ?Sized,
pub const fn builder_unsized<T>() -> ValueVTableBuilderUnsized<T>where
T: ?Sized,
Creates a new ValueVTableBuilderUnsized
Trait Implementations§
Source§impl Clone for ValueVTable
impl Clone for ValueVTable
Source§fn clone(&self) -> ValueVTable
fn clone(&self) -> ValueVTable
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ValueVTable
impl Debug for ValueVTable
Source§impl Hash for ValueVTable
impl Hash for ValueVTable
Source§impl PartialEq for ValueVTable
impl PartialEq for ValueVTable
impl Copy for ValueVTable
impl Eq for ValueVTable
impl StructuralPartialEq for ValueVTable
Auto Trait Implementations§
impl Freeze for ValueVTable
impl RefUnwindSafe for ValueVTable
impl Send for ValueVTable
impl Sync for ValueVTable
impl Unpin for ValueVTable
impl UnwindSafe for ValueVTable
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<D> OwoColorize for D
impl<D> OwoColorize for D
Source§fn fg<C>(&self) -> FgColorDisplay<'_, C, Self>where
C: Color,
fn fg<C>(&self) -> FgColorDisplay<'_, C, Self>where
C: Color,
Source§fn bg<C>(&self) -> BgColorDisplay<'_, C, Self>where
C: Color,
fn bg<C>(&self) -> BgColorDisplay<'_, C, Self>where
C: Color,
Source§fn black(&self) -> FgColorDisplay<'_, Black, Self>
fn black(&self) -> FgColorDisplay<'_, Black, Self>
Source§fn on_black(&self) -> BgColorDisplay<'_, Black, Self>
fn on_black(&self) -> BgColorDisplay<'_, Black, Self>
Source§fn red(&self) -> FgColorDisplay<'_, Red, Self>
fn red(&self) -> FgColorDisplay<'_, Red, Self>
Source§fn on_red(&self) -> BgColorDisplay<'_, Red, Self>
fn on_red(&self) -> BgColorDisplay<'_, Red, Self>
Source§fn green(&self) -> FgColorDisplay<'_, Green, Self>
fn green(&self) -> FgColorDisplay<'_, Green, Self>
Source§fn on_green(&self) -> BgColorDisplay<'_, Green, Self>
fn on_green(&self) -> BgColorDisplay<'_, Green, Self>
Source§fn yellow(&self) -> FgColorDisplay<'_, Yellow, Self>
fn yellow(&self) -> FgColorDisplay<'_, Yellow, Self>
Source§fn on_yellow(&self) -> BgColorDisplay<'_, Yellow, Self>
fn on_yellow(&self) -> BgColorDisplay<'_, Yellow, Self>
Source§fn blue(&self) -> FgColorDisplay<'_, Blue, Self>
fn blue(&self) -> FgColorDisplay<'_, Blue, Self>
Source§fn on_blue(&self) -> BgColorDisplay<'_, Blue, Self>
fn on_blue(&self) -> BgColorDisplay<'_, Blue, Self>
Source§fn magenta(&self) -> FgColorDisplay<'_, Magenta, Self>
fn magenta(&self) -> FgColorDisplay<'_, Magenta, Self>
Source§fn on_magenta(&self) -> BgColorDisplay<'_, Magenta, Self>
fn on_magenta(&self) -> BgColorDisplay<'_, Magenta, Self>
Source§fn purple(&self) -> FgColorDisplay<'_, Magenta, Self>
fn purple(&self) -> FgColorDisplay<'_, Magenta, Self>
Source§fn on_purple(&self) -> BgColorDisplay<'_, Magenta, Self>
fn on_purple(&self) -> BgColorDisplay<'_, Magenta, Self>
Source§fn cyan(&self) -> FgColorDisplay<'_, Cyan, Self>
fn cyan(&self) -> FgColorDisplay<'_, Cyan, Self>
Source§fn on_cyan(&self) -> BgColorDisplay<'_, Cyan, Self>
fn on_cyan(&self) -> BgColorDisplay<'_, Cyan, Self>
Source§fn white(&self) -> FgColorDisplay<'_, White, Self>
fn white(&self) -> FgColorDisplay<'_, White, Self>
Source§fn on_white(&self) -> BgColorDisplay<'_, White, Self>
fn on_white(&self) -> BgColorDisplay<'_, White, Self>
Source§fn default_color(&self) -> FgColorDisplay<'_, Default, Self>
fn default_color(&self) -> FgColorDisplay<'_, Default, Self>
Source§fn on_default_color(&self) -> BgColorDisplay<'_, Default, Self>
fn on_default_color(&self) -> BgColorDisplay<'_, Default, Self>
Source§fn bright_black(&self) -> FgColorDisplay<'_, BrightBlack, Self>
fn bright_black(&self) -> FgColorDisplay<'_, BrightBlack, Self>
Source§fn on_bright_black(&self) -> BgColorDisplay<'_, BrightBlack, Self>
fn on_bright_black(&self) -> BgColorDisplay<'_, BrightBlack, Self>
Source§fn bright_red(&self) -> FgColorDisplay<'_, BrightRed, Self>
fn bright_red(&self) -> FgColorDisplay<'_, BrightRed, Self>
Source§fn on_bright_red(&self) -> BgColorDisplay<'_, BrightRed, Self>
fn on_bright_red(&self) -> BgColorDisplay<'_, BrightRed, Self>
Source§fn bright_green(&self) -> FgColorDisplay<'_, BrightGreen, Self>
fn bright_green(&self) -> FgColorDisplay<'_, BrightGreen, Self>
Source§fn on_bright_green(&self) -> BgColorDisplay<'_, BrightGreen, Self>
fn on_bright_green(&self) -> BgColorDisplay<'_, BrightGreen, Self>
Source§fn bright_yellow(&self) -> FgColorDisplay<'_, BrightYellow, Self>
fn bright_yellow(&self) -> FgColorDisplay<'_, BrightYellow, Self>
Source§fn on_bright_yellow(&self) -> BgColorDisplay<'_, BrightYellow, Self>
fn on_bright_yellow(&self) -> BgColorDisplay<'_, BrightYellow, Self>
Source§fn bright_blue(&self) -> FgColorDisplay<'_, BrightBlue, Self>
fn bright_blue(&self) -> FgColorDisplay<'_, BrightBlue, Self>
Source§fn on_bright_blue(&self) -> BgColorDisplay<'_, BrightBlue, Self>
fn on_bright_blue(&self) -> BgColorDisplay<'_, BrightBlue, Self>
Source§fn bright_magenta(&self) -> FgColorDisplay<'_, BrightMagenta, Self>
fn bright_magenta(&self) -> FgColorDisplay<'_, BrightMagenta, Self>
Source§fn on_bright_magenta(&self) -> BgColorDisplay<'_, BrightMagenta, Self>
fn on_bright_magenta(&self) -> BgColorDisplay<'_, BrightMagenta, Self>
Source§fn bright_purple(&self) -> FgColorDisplay<'_, BrightMagenta, Self>
fn bright_purple(&self) -> FgColorDisplay<'_, BrightMagenta, Self>
Source§fn on_bright_purple(&self) -> BgColorDisplay<'_, BrightMagenta, Self>
fn on_bright_purple(&self) -> BgColorDisplay<'_, BrightMagenta, Self>
Source§fn bright_cyan(&self) -> FgColorDisplay<'_, BrightCyan, Self>
fn bright_cyan(&self) -> FgColorDisplay<'_, BrightCyan, Self>
Source§fn on_bright_cyan(&self) -> BgColorDisplay<'_, BrightCyan, Self>
fn on_bright_cyan(&self) -> BgColorDisplay<'_, BrightCyan, Self>
Source§fn bright_white(&self) -> FgColorDisplay<'_, BrightWhite, Self>
fn bright_white(&self) -> FgColorDisplay<'_, BrightWhite, Self>
Source§fn on_bright_white(&self) -> BgColorDisplay<'_, BrightWhite, Self>
fn on_bright_white(&self) -> BgColorDisplay<'_, BrightWhite, Self>
Source§fn bold(&self) -> BoldDisplay<'_, Self>
fn bold(&self) -> BoldDisplay<'_, Self>
Source§fn dimmed(&self) -> DimDisplay<'_, Self>
fn dimmed(&self) -> DimDisplay<'_, Self>
Source§fn italic(&self) -> ItalicDisplay<'_, Self>
fn italic(&self) -> ItalicDisplay<'_, Self>
Source§fn underline(&self) -> UnderlineDisplay<'_, Self>
fn underline(&self) -> UnderlineDisplay<'_, Self>
Source§fn blink(&self) -> BlinkDisplay<'_, Self>
fn blink(&self) -> BlinkDisplay<'_, Self>
Source§fn blink_fast(&self) -> BlinkFastDisplay<'_, Self>
fn blink_fast(&self) -> BlinkFastDisplay<'_, Self>
Source§fn reversed(&self) -> ReversedDisplay<'_, Self>
fn reversed(&self) -> ReversedDisplay<'_, Self>
Source§fn strikethrough(&self) -> StrikeThroughDisplay<'_, Self>
fn strikethrough(&self) -> StrikeThroughDisplay<'_, Self>
Source§fn color<Color>(&self, color: Color) -> FgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
fn color<Color>(&self, color: Color) -> FgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
OwoColorize::fg or
a color-specific method, such as OwoColorize::green, Read moreSource§fn on_color<Color>(&self, color: Color) -> BgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
fn on_color<Color>(&self, color: Color) -> BgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
OwoColorize::bg or
a color-specific method, such as OwoColorize::on_yellow, Read more