zvariant

Trait NoneValue

Source
pub trait NoneValue {
    type NoneType;

    // Required method
    fn null_value() -> Self::NoneType;
}
Expand description

Type that uses a special value to be used as none.

See Optional documentation for the rationale for this trait’s existence.

§Caveats

Since use of default values as none is typical, this trait is implemented for all types that implement Default for convenience. Unfortunately, this means you can not implement this trait manually for types that implement Default.

Required Associated Types§

Required Methods§

Source

fn null_value() -> Self::NoneType

The none-equivalent value.

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.

Implementors§

Source§

impl<T> NoneValue for T
where T: Default,

impl<'name> NoneValue for BusName<'name>

impl<'name> NoneValue for ErrorName<'name>

impl<'name> NoneValue for InterfaceName<'name>

impl<'name> NoneValue for MemberName<'name>

impl<'name> NoneValue for UniqueName<'name>

impl<'name> NoneValue for WellKnownName<'name>