vm_resource

Trait ResourceId

Source
pub trait ResourceId<K> {
    const ID: &'static str;
}
Expand description

A trait identifying a resource type’s ID (within a given ResourceKind).

enum DiskKind {}

#[derive(mesh::MeshPayload)]
struct FileDiskConfig {
    path: String,
}

impl vm_resource::ResourceId<DiskKind> for FileDiskConfig {
    const ID: &'static str = "file";
}

Required Associated Constants§

Source

const ID: &'static str

The ID of this resource type.

This must be unique amongst resource types of this kind. It does not need to be unique between types of different resource kinds.

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<K: ResourceKind> ResourceId<K> for PlatformResource

Source§

const ID: &'static str = "platform"