Skip to main content

Defaultable

Trait Defaultable 

Source
pub trait Defaultable<O: Ops>: Codec<O> {
    // Required method
    fn is_default(&self) -> bool;
}
Expand description

A trait that represents a subset of types with Default.

This is required for a #[codec(optional)] to work on a type. Also see impl_defaultable.

Required Methods§

Source

fn is_default(&self) -> bool

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl<O: Ops, T: Codec<O>> Defaultable<O> for Vec<T>

Source§

impl<O: Ops> Defaultable<O> for NbtCompound

Source§

impl<O: Ops> Defaultable<O> for bool

Source§

impl<O: Ops> Defaultable<O> for f32

Source§

impl<O: Ops> Defaultable<O> for f64

Source§

impl<O: Ops> Defaultable<O> for i8

Source§

impl<O: Ops> Defaultable<O> for i16

Source§

impl<O: Ops> Defaultable<O> for i32

Source§

impl<O: Ops> Defaultable<O> for i64

Source§

impl<O: Ops> Defaultable<O> for u8

Source§

impl<O: Ops> Defaultable<O> for u16

Source§

impl<O: Ops> Defaultable<O> for u32

Source§

impl<O: Ops> Defaultable<O> for u64

Source§

impl<T: Codec<O> + Defaultable<O>, O: Ops> Defaultable<O> for Box<T>

Source§

impl<T: Codec<O>, O: Ops> Defaultable<O> for Option<T>

Implementors§