Struct wasmer_compiler::lib::std::fmt::FormatterFn
source ยท pub struct FormatterFn<F>(pub F)
where
F: Fn(&mut Formatter<'_>) -> Result<(), Error>;
๐ฌThis is a nightly-only experimental API. (
debug_closure_helpers
)Expand description
Implements fmt::Debug
and fmt::Display
using a function.
ยงExamples
#![feature(debug_closure_helpers)]
use std::fmt;
let value = 'a';
assert_eq!(format!("{}", value), "a");
assert_eq!(format!("{:?}", value), "'a'");
let wrapped = fmt::FormatterFn(|f| write!(f, "{value:?}"));
assert_eq!(format!("{}", wrapped), "'a'");
assert_eq!(format!("{:?}", wrapped), "'a'");
Tuple Fieldsยง
ยง0: F
๐ฌThis is a nightly-only experimental API. (
debug_closure_helpers
)Trait Implementationsยง
sourceยงimpl<F> Debug for FormatterFn<F>
impl<F> Debug for FormatterFn<F>
Auto Trait Implementationsยง
impl<F> Freeze for FormatterFn<F>where
F: Freeze,
impl<F> RefUnwindSafe for FormatterFn<F>where
F: RefUnwindSafe,
impl<F> Send for FormatterFn<F>where
F: Send,
impl<F> Sync for FormatterFn<F>where
F: Sync,
impl<F> Unpin for FormatterFn<F>where
F: Unpin,
impl<F> UnwindSafe for FormatterFn<F>where
F: UnwindSafe,
Blanket Implementationsยง
ยงimpl<T> ArchivePointee for T
impl<T> ArchivePointee for T
ยงtype ArchivedMetadata = ()
type ArchivedMetadata = ()
The archived version of the pointer metadata for this type.
ยงfn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
Converts some archived metadata to the pointer metadata for itself.
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
ยงimpl<T> LayoutRaw for T
impl<T> LayoutRaw for T
ยงfn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
Returns the layout of the type.
ยงimpl<T> Pointee for T
impl<T> Pointee for T
sourceยงimpl<T> Upcastable for T
impl<T> Upcastable for T
sourceยงfn upcast_any_ref(&self) -> &(dyn Any + 'static)
fn upcast_any_ref(&self) -> &(dyn Any + 'static)
upcast ref
sourceยงfn upcast_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn upcast_any_mut(&mut self) -> &mut (dyn Any + 'static)
upcast mut ref