pub struct NoopCustomTagParser<S>(_);
Expand description

A fake custom tag parser which always fail.

Why need this

If a tag convertor support custom tag and you also want it to be optional and impl Default trait, normally you will use a Option<T: CustomTagParser<Custom>> in the convertor.

But the user still need to provide some type of that T(which the usually can’t) even if they do not want custom tag.

With this type, you can add a T = NoopCustomTagParser<Custom> in struct to make them happy.

Trait Implementations

Custom tag type.

Parse string to custom tag type.

Formats the value using the given formatter. Read more

Returns the “default value” for a type. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.