pub trait FormattedValueNoneBuilder: FormattedValueFullRange {
// Required method
fn none() -> Self;
// Provided method
fn none_for_format(format: Format) -> Self { ... }
}
Required Methods§
Sourcefn none() -> Self
fn none() -> Self
Returns the None
value for Self
as a FullRange
if such a value can be represented.
- For
SpecificFormattedValue
s, this results inOption::<FormattedValueIntrinsic>::None
. - For
GenericFormattedValue
, this can only be obtained usingSelf::none_for_format
because theNone
is an inner value of some of the variants.
§Panics
Panics if Self
is GenericFormattedValue
in which case, the Format
must be known.
Provided Methods§
Sourcefn none_for_format(format: Format) -> Self
fn none_for_format(format: Format) -> Self
Returns the None
value for Self
if such a value can be represented.
- For
SpecificFormattedValue
s, this is the same asSelf::none()
if theformat
matches theSpecificFormattedValue
’s format. - For
GenericFormattedValue
this is the variant for the specifiedformat
, initialized withNone
as a value, if theformat
can represent that value.
§Panics
Panics if None
can’t be represented by Self
for format
or by the requested
GenericFormattedValue
variant.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.