[][src]Struct const_format::marker_traits::IsAWriteMarker

pub struct IsAWriteMarker<K, T: ?Sized, R: ?Sized>(_);

Hack used to automatically convert a mutable reference to a StrWriter to a StrWriterMut, and do nothing with other types.

The conversion is done with the coerce methods.

Type parameters

K is <R as WriteMarker>::Kind The kind of type that T is, either a IsAStrWriter or IsNotAStrWriter

T is <R as WriteMarker>::This: The R type after removing all layers of references.

Coerce Method

The coerce method is what does the conversion from a &mut T depending on the K type parameter:

Implementations

impl<R: ?Sized> IsAWriteMarker<R::Kind, R::This, R> where
    R: WriteMarker
[src]

pub const NEW: Self[src]

Constructs a IsAWriteMarker

impl<K, T: ?Sized, R: ?Sized> IsAWriteMarker<K, T, R>[src]

pub const fn infer_type(self, _: &R) -> Self[src]

Infers the type parmaeters of this IsAWriteMarker with the passed reference.

impl<T: ?Sized, R: ?Sized> IsAWriteMarker<IsAStrWriter, StrWriter<T>, R>[src]

pub const fn coerce(self, mutref: &mut StrWriter) -> StrWriterMut<'_>[src]

Converts the &mut StrWriter to a StrWriterMut<'_>.

impl<T: ?Sized, R: ?Sized> IsAWriteMarker<IsNotAStrWriter, T, R>[src]

pub const fn coerce(self, mutref: &mut T) -> &mut T[src]

An idntity function, just takesmutref and returns it.

Trait Implementations

impl<K, T: ?Sized, R: ?Sized> Clone for IsAWriteMarker<K, T, R>[src]

impl<K, T: ?Sized, R: ?Sized> Copy for IsAWriteMarker<K, T, R>[src]

Auto Trait Implementations

impl<K, T: ?Sized, R: ?Sized> RefUnwindSafe for IsAWriteMarker<K, T, R>

impl<K, T: ?Sized, R: ?Sized> Send for IsAWriteMarker<K, T, R>

impl<K, T: ?Sized, R: ?Sized> Sync for IsAWriteMarker<K, T, R>

impl<K, T: ?Sized, R: ?Sized> Unpin for IsAWriteMarker<K, T, R>

impl<K, T: ?Sized, R: ?Sized> UnwindSafe for IsAWriteMarker<K, T, R>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.