Skip to main content

RegistryHolderEntry

Trait RegistryHolderEntry 

Source
pub trait RegistryHolderEntry:
    RegistryEntry
    + Debug
    + Send
    + Sync {
    type Value: Clone + Debug + PartialEq + Send + Sync + WriteTo + ReadFrom + ToNbtTag + FromNbtTag + HashComponent + 'static;

    const REGISTRY_NAME: &'static str;

    // Required methods
    fn holder_value(&self) -> &Self::Value;
    fn holder_by_id(id: usize) -> Option<&'static Self>;
    fn holder_by_key(key: &Identifier) -> Option<&'static Self>;
}
Expand description

Registry operations and direct value type required by RegistryHolder.

Required Associated Constants§

Source

const REGISTRY_NAME: &'static str

Human-readable registry name used in codec errors.

Required Associated Types§

Source

type Value: Clone + Debug + PartialEq + Send + Sync + WriteTo + ReadFrom + ToNbtTag + FromNbtTag + HashComponent + 'static

The value stored in the registry entry and carried by a direct holder.

Required Methods§

Source

fn holder_value(&self) -> &Self::Value

Returns the entry’s registry-independent value.

Source

fn holder_by_id(id: usize) -> Option<&'static Self>

Looks up a registry reference by its protocol ID.

Source

fn holder_by_key(key: &Identifier) -> Option<&'static Self>

Looks up a registry reference by its key.

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementors§