pub trait IntoWriteFn<Ts> {
    type WriteFn;

    // Required method
    fn into_write_fn(self) -> Self::WriteFn;
}
Expand description

A trait used to inference type of write closure wrapper.

This trait used by FmtWriter, ConcatWriter and IoWriter.

Both IntoWriteFn and IntoTryWriteFn traits provides the same wrappers for closures with *const u8, usize, &[u8], &str and String arguments. This variant uses panicking versions for closures with &CStr, CString, and *const c_char arguments, for a “fail fast” approach.

Required Associated Types§

source

type WriteFn

The corresponding write function wrapper.

Required Methods§

source

fn into_write_fn(self) -> Self::WriteFn

Returns the wrapped function.

Implementors§

source§

impl<F, R> IntoWriteFn<(&str,)> for Fwhere F: FnMut(&str) -> R,

§

type WriteFn = WriteStrFn<F, R>

source§

impl<F, R> IntoWriteFn<(&CStr,)> for Fwhere F: FnMut(&CStr) -> R,

§

type WriteFn = WriteCStrFn<F, R>

source§

impl<F, R> IntoWriteFn<(&[u8],)> for Fwhere F: FnMut(&[u8]) -> R,

§

type WriteFn = WriteBytesFn<F, R>

source§

impl<F, R> IntoWriteFn<(*const i8,)> for Fwhere F: FnMut(*const c_char) -> R,

source§

impl<F, R> IntoWriteFn<(*const u8, usize)> for Fwhere F: FnMut(*const u8, usize) -> R,

source§

impl<F, R> IntoWriteFn<(usize, *const u8)> for Fwhere F: FnMut(usize, *const u8) -> R,

source§

impl<F, R> IntoWriteFn<(CString,)> for Fwhere F: FnMut(CString) -> R,

source§

impl<F, R> IntoWriteFn<(String,)> for Fwhere F: FnMut(String) -> R,